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]

setup.exe - three bug reports, one patch


I've run into a couple of problems using setup.exe in unattended mode.
a description of the problems, and a trivial patch for one, follow...

I'm building setup.exe from cvs source.  When running an unattended
install from a local package directory using the command line:

  "C:\image\data\setup.exe" -R "C:\cygwin" -L -l "C:\image\data\release" -5 -r -A -d -q

The installation proceeds nicely, with the following caveats:

1) setup.exe does not create the /etc/setup directory prior to
   starting package installation.

   This means that the various package.lst.gz files are not created
   as part of the install.  For now, as a workaround, I'm creating
   [root]/etc/setup prior to calling setup.exe; this seems to keep
   setup.exe happy (at least, it creates the .lst.gz files and populates
   installed.db).

   I'd offer a fix for setup.exe, but I haven't had time to dig in and
   figure out where or why this directory creation is being skipped.

2) setup.exe does not generate log files in /var/log.

   Neither setup.log nor setup.log.full gets generated, even if the
   [root]/var/log directory is created before setup.exe runs.

   Again, no time == no fix (at least for now).  I consider this more
   of an oddity than anything else - diagnosing the other two problems
   might have been a bit easier if these log files were being generated.

3) setup.exe fails with an exception before running postinstall scripts.

   This is apparently tickled by a line in postinstall.cc that assumes
   a postinstall script always has a name that is at least 5 characters
   long.  This seems seems to be broken by the 'd' package, which has a
   postinstall script named 'd.sh'.

   A trivial patch to correct this problem is below.  I don't know if
   there are other instances (postremove, preremove) where a similar
   problem might crop up.

$ cvs diff -du postinstall.cc 
Index: postinstall.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/postinstall.cc,v
retrieving revision 2.17
diff -d -u -r2.17 postinstall.cc
--- postinstall.cc      25 Dec 2004 20:41:09 -0000      2.17
+++ postinstall.cc      16 Feb 2005 21:38:28 -0000
@@ -45,8 +45,10 @@
   virtual void visitFile(String const &basePath, const WIN32_FIND_DATA *theFile)
     {
       String fileName(theFile->cFileName);
-      if (fileName.substr(fileName.size() - 5) == ".done")
-        return;
+      if (fileName.size() > 5) {
+        if (fileName.substr(fileName.size() - 5) == ".done")
+          return;
+      } 
       String fn = String("/etc/postinstall/")+theFile->cFileName;
       _scripts->push_back(Script (fn));
     }


-Samrobbb


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