This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Draft Patch] Debug-Personality


A number of the setup.exe bugs being reported require a clean install to
reproduce. This patch allows an alternate registry key to be used for the
mount table, so enabling setup to simulate a clean install without
interfering with your real install.

NB: THIS ONLY AFFECTS SETUP. The faked installs produced by this options
will *NOT* run, because the Cygwin DLL will look to the real registry key,
not the overridden one.

However, this does allow the testing of setup.exe bugs in a sandboxed
install.

I'm not sure whether this patch should ever go in to CVS. If it does, then
it needs to be #ifdeffed out of release builds. But it should be helpful in
the short term to assist in testing.

Max.

PS: Why 'Personality'? I don't know. Can anyone come up with a more
descriptive name for the option?

#####################################
Index: mount.cc
===================================================================
RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/mount.cc,v
retrieving revision 2.14
diff -u -p -r2.14 mount.cc
--- mount.cc 2002/05/04 04:26:01 2.14
+++ mount.cc 2002/11/29 14:37:06
@@ -73,7 +73,11 @@ enum
 #include "state.h"

 #include "String++.h"
+#include "getopt++/GetOption.h"
+#include "getopt++/StringOption.h"

+static StringOption CygwinRegistryNameOption
(CYGWIN_INFO_CYGWIN_REGISTRY_NAME, '0', "debug-personality", "Debug Option
for alternate personality");
+
 /* Used when treating / and \ as equivalent. */
 #define SLASH_P(ch) \
     ({ \
@@ -139,7 +143,7 @@ create_mount (String const posix, String

   sprintf (buf, "Software\\%s\\%s\\%s\\%s",
     CYGWIN_INFO_CYGNUS_REGISTRY_NAME,
-    CYGWIN_INFO_CYGWIN_REGISTRY_NAME,
+    ((String)CygwinRegistryNameOption).cstr_oneuse(),
     CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME, posix.cstr_oneuse ());

   HKEY kr = issystem ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
@@ -168,7 +172,7 @@ remove1 (HKEY rkey, String const posix)

   sprintf (buf, "Software\\%s\\%s\\%s\\%s",
     CYGWIN_INFO_CYGNUS_REGISTRY_NAME,
-    CYGWIN_INFO_CYGWIN_REGISTRY_NAME,
+    ((String)CygwinRegistryNameOption).cstr_oneuse(),
     CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME, posix.cstr_oneuse ());

   RegDeleteKey (rkey, buf);
@@ -225,7 +229,7 @@ set_cygdrive_flags (int istext, int issy
   char buf[1000];
   sprintf (buf, "Software\\%s\\%s\\%s",
     CYGWIN_INFO_CYGNUS_REGISTRY_NAME,
-    CYGWIN_INFO_CYGWIN_REGISTRY_NAME,
+    ((String)CygwinRegistryNameOption).cstr_oneuse(),
     CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME);

   if (issystem)
@@ -368,7 +372,7 @@ read_mounts ()
     {
       sprintf (buf, "Software\\%s\\%s\\%s",
         CYGWIN_INFO_CYGNUS_REGISTRY_NAME,
-        CYGWIN_INFO_CYGWIN_REGISTRY_NAME,
+        ((String)CygwinRegistryNameOption).cstr_oneuse(),
         CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME);

       HKEY key = issystem ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
#####################################


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]