From 2cf65e6e7bb5f2fdb80f5ff10c57beaa721f24a0 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 30 Apr 2000 03:58:17 +0000 Subject: [PATCH] * 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. --- ChangeLog | 43 ++++++++++++++++++++++++++++++++++++++++++- pkg.c | 7 +++++-- setup.c | 6 ++++-- setup.h | 2 +- 4 files changed, 52 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 855f5af3..6db1cc9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,44 @@ +Sat Apr 29 23:53:30 2000 Christopher Faylor + + * 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 + + * 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 * setup.c (optionprompt): Don't overlap display of already seen options @@ -128,7 +169,7 @@ Mon Apr 17 00:00:49 2000 Christopher Faylor Sun Apr 16 18:50:58 2000 Christopher Faylor - 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 bf011f13..d8a6e2c0 100644 --- 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 a279ac7d..9310dd36 100644 --- 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 3facdf80..e3b25d30 100644 --- 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); -- 2.43.5