]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
* pkg.c (init_pkgs): Accept an argument to control what root registry key
authorChristopher Faylor <me@cgf.cx>
Sun, 30 Apr 2000 03:58:17 +0000 (03:58 +0000)
committerChristopher Faylor <me@cgf.cx>
Sun, 30 Apr 2000 03:58:17 +0000 (03:58 +0000)
should be used.
* setup.c (get_pkg_stuff): Use HKCLU registry key if default fails.
* setup.h: Reflect init_pkgs prototype change.

ChangeLog
pkg.c
setup.c
setup.h

index 855f5af3a3948395700d879d53bee8f761e3d2c8..6db1cc9ee880ee11d8f0a658252c199ccfc7d860 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+Sat Apr 29 23:53:30 2000  Christopher Faylor <cgf@cygnus.com>
+
+       * pkg.c (init_pkgs): Accept an argument to control what root registry
+       key should be used.
+       * setup.c (get_pkg_stuff): Use HKCLU registry key if default fails.
+       * setup.h: Reflect init_pkgs prototype change.
+
+Sat Apr 29 23:27:14 2000  Christopher Faylor <cgf@cygnus.com>
+
+       * error.c (winerror): Respond to gcc warning.
+       * path.c (cygpath_pipe): Ditto.
+       * setup.c (filedel): Call sa_cleanup on deleteme.
+       (create_shortcut): Coerce argument to eliminate compiler warning.
+       (tarx): Use installed version of cygwin1.dll, overriding tar file name.
+       (refmatches): New function.  Tests if ref is contained in a list of
+       packages to install.
+       (filematches): New function.  Tests if filename matches one of a list
+       of packages to install.
+       (recurse_dirs): Accept list of packages to install.  Generalize tar.gz
+       test to accomodate _tar.gz.
+       (prompt): Ensure that stdout is flushed prior to asking for input.
+       (findhref): Initialize variables to quiet a compiler warning.
+       (processdirlisting): Accept list of packages to install.  Special case
+       cygwin tar file version number.
+       (downloaddir): Accept list of packages to install.
+       (downloadfrom): Ditto.
+       (create_uninstall): Eliminate unneeded variables.  Quote arguments to
+       regtool.
+       (do_start_menu): Don't create uninstall bat file if updating or user
+       specified a list of packages.
+       (mkmount): Eliminate unneeded variables.
+       (get_pkg_stuff): New function.  Checks for previous unversioned
+       installation.
+       (main): Accept -u and -f options and package names on the command line.
+       Use get_pkg_stuff to initialize package information.  Umount /etc.
+       Call recurse_dirs and downloadfrom with list of package to install.
+       Ensure that all /usr/local directories are created.  Output
+       installation time to setup.log.
+       * setup.h: Add some prototypes.
+       * xsystem.c (xcreate_process): Eliminate unneeded variable.
+
 Sat Apr 29 12:43:08 2000  Christopher Faylor <cgf@cygnus.com>
 
        * setup.c (optionprompt): Don't overlap display of already seen options
@@ -128,7 +169,7 @@ Mon Apr 17 00:00:49 2000  Christopher Faylor <cgf@cygnus.com>
 
 Sun Apr 16 18:50:58 2000  Christopher Faylor <cgf@cygnus.com>
 
-       Use "warning" function, where appropriate to output warnings.
+       Use "warning" function, where appropriate, to output warnings.
        * setup.c (warning): New function -- outputs warning to console and log
        file.
        (tarx): Fix index used to reset file protection.
diff --git a/pkg.c b/pkg.c
index bf011f13adc50e272c2567cdaf6e0f383bba1d2d..d8a6e2c0e150995f5a72e727de24424eb9857559 100644 (file)
--- a/pkg.c
+++ b/pkg.c
@@ -219,7 +219,7 @@ err:
 }
 
 pkg *
-init_pkgs ()
+init_pkgs (int use_current_user)
 {
   LONG res;
   DWORD what;
@@ -229,10 +229,13 @@ init_pkgs ()
   DWORD nc = 0;
   static pkg stuff[1000];
 
-  res = RegCreateKeyEx (HKEY_LOCAL_MACHINE,
+  res = RegCreateKeyEx (use_current_user ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER,
                        "SOFTWARE\\Cygnus Solutions\\Cygwin\\Installed Components",
                         0, empty,  REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkpkg, &what);
 
+  if (res != ERROR_SUCCESS)
+    return NULL;
+
   for (nc = 0, sz = sizeof (buf);
        RegEnumValue (hkpkg, nc, buf, &sz, NULL, &ty, NULL, NULL) == ERROR_SUCCESS;
        nc++, sz = sizeof (buf))
diff --git a/setup.c b/setup.c
index a279ac7d47b70a1600385edab8f6489fb95afbc9..9310dd366747ee97d8659227a8433139f95487be 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -1321,10 +1321,12 @@ static pkg *
 get_pkg_stuff (const char *root, int updating)
 {
   const char *ver, *ans;
-  pkg *pkgstuff = init_pkgs ();
+  pkg *pkgstuff = init_pkgs (0);
   static pkg dummy = {NULL, NULL};
 
-  if (!updating)
+  if (!pkgstuff)
+    pkgstuff = init_pkgs (1);  /* Use HKCU */
+  if (!updating || !pkgstuff)
     return &dummy;
 
   if (pkgstuff->name != NULL)
diff --git a/setup.h b/setup.h
index 3facdf803d30def6f7f5ecb21ccb893622d7fcae..e3b25d30ab735beacaeec3a722841948559c345f 100644 (file)
--- a/setup.h
+++ b/setup.h
@@ -23,7 +23,7 @@ typedef struct
   char *version;
 } pkg;
 
-pkg *init_pkgs (void);
+pkg *init_pkgs (int);
 pkg * find_pkg (pkg *stuff, char *name);
 int write_pkg (pkg *pkg, char *name, char *version);
 int newer_pkg (pkg *pkg, char *version);
This page took 0.039064 seconds and 5 git commands to generate.