[PATCH] Re: [setup] Inaccurate message: See /setup.log.full

Igor Pechtchanski pechtcha@cs.nyu.edu
Mon Feb 24 20:11:00 GMT 2003


Ping?..
	Igor

On Sat, 1 Feb 2003, Igor Pechtchanski wrote:

> On 2 Feb 2003, Robert Collins wrote:
>
> > On Sun, 2003-02-02 at 07:37, Igor Pechtchanski wrote:
> >
> > > Yes, it does recompile everything when resource.h is modified, but that
> > > only happens once.  A necessary evil...
> >
> > Even so... resource.h urrghh.
> >
> > > Sorry about the (null) bit.  Should be fixed now.  I also took your
> > > suggestion regarding "log file".  The third iteration of the patch is
> > > attached...
> > >       Igor
> > > ====================================
> > > ChangeLog:
> > > 2002-10-17  Igor Pechtchanski <pechtcha@cs.nyu.edu>
> > >
> > >       * res.rc (IDS_INSTALL_INCOMPLETE): Change hard-coded
> > >       log filename to %s.
> > >       (IDS_MISSING_LOG): New string resource.
> > >       * resource.h (IDS_MISSING_LOG): New resource.
> > >       * LogFile.cc (LogFile::exit): Pass log filename for
> > >       LOG_BABBLE to note().
> > >       (LogFile::getFile): New function.
> > >       * LogFile.h (LogFile::getFile): New function.
> >
> > getFile should be getFilename or getFileName.
> >
> > getFileName doesn't take a minlevel, it takes an exactLevel - your
> > parameter name is misleading, or you've got the logic in the loop wrong
> > :}.
> >
> > IDS_MISSING_LOG should be "No log was in use", not "setup.log.full".
> > It'll be ugly in the output, but at least accurate.
> >
> > Do those three changes, and I think this is ready. nice work guys.
> >
> > Rob
>
> Rob,
>
> I was mislead by the setFile() prototype.  I agree with your proposed
> changes (and Max's use of angle brackets).  Take four is attached.
> Thanks.
> 	Igor
> ======================================================================
> ChangeLog:
> 2003-02-01  Igor Pechtchanski <pechtcha@cs.nyu.edu>
>
> 	* res.rc (IDS_INSTALL_INCOMPLETE): Change hard-coded
> 	log filename to %s.
> 	(IDS_MISSING_LOG): New string resource.
> 	* resource.h (IDS_MISSING_LOG): New resource.
> 	* LogFile.cc (LogFile::exit): Pass log filename for
> 	LOG_BABBLE to note().
> 	(LogFile::getFileName): New function.
> 	* LogFile.h (LogFile::getFileName): New function.

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune
-------------- next part --------------
Index: LogFile.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/LogFile.cc,v
retrieving revision 2.6
diff -u -p -r2.6 LogFile.cc
--- LogFile.cc	25 Nov 2002 00:41:24 -0000	2.6
+++ LogFile.cc	1 Feb 2003 23:11:30 -0000
@@ -31,6 +31,8 @@ static const char *cvsid =
 #include <time.h>
 #include <string>
 #include "AntiVirus.h"
+#include "filemanip.h"
+#include "cistring.h"
 
 using namespace std;
 
@@ -101,6 +103,20 @@ LogFile::setFile (int minlevel, String c
   files.insert (t);
 }
 
+String
+LogFile::getFileName (int level) const
+{
+  for (FileSet::iterator i = files.begin();
+       i != files.end(); ++i)
+    {
+      if (i->level == level)
+        return i->key;
+    }
+  cistring bad_file;
+  bad_file.Format(IDS_MISSING_LOG);
+  return bad_file.c_str();
+}
+
 void
 LogFile::exit (int const exit_code)
 {
@@ -115,7 +131,7 @@ LogFile::exit (int const exit_code)
   been_here = 1;
   
   if (exit_msg)
-    note (NULL, exit_msg);
+    note (NULL, exit_msg, backslash(getFileName(LOG_BABBLE)).cstr_oneuse());
   
   log (LOG_TIMESTAMP) << "Ending cygwin install" << endLog;
 
Index: LogFile.h
===================================================================
RCS file: /cvs/cygwin-apps/setup/LogFile.h,v
retrieving revision 2.3
diff -u -p -r2.3 LogFile.h
--- LogFile.h	10 Nov 2002 03:56:05 -0000	2.3
+++ LogFile.h	1 Feb 2003 23:11:30 -0000
@@ -23,6 +23,7 @@ public:
   LogFile();
   void clearFiles(); // delete all target filenames
   void setFile (int minlevel, String const &path, bool append);
+  String getFileName (int level) const;
   /* Some platforms don't call destructors. So this call exists
    * which guarantees to flush any log data...
    * but doesn't call generic C++ destructors
Index: res.rc
===================================================================
RCS file: /cvs/cygwin-apps/setup/res.rc,v
retrieving revision 2.45
diff -u -p -r2.45 res.rc
--- res.rc	19 Jan 2003 20:31:53 -0000	2.45
+++ res.rc	1 Feb 2003 23:11:47 -0000
@@ -483,11 +483,12 @@ BEGIN
     IDS_DOWNLOAD_FAILED     "Unable to download %s"
     IDS_DOWNLOAD_INCOMPLETE "Download Incomplete.  Try again?"
     IDS_INSTALL_ERROR	    "Installation error (%s), Continue with other packages?"
-    IDS_INSTALL_INCOMPLETE  "Installation incomplete.  Check /setup.log.full for details"
+    IDS_INSTALL_INCOMPLETE  "Installation incomplete.  Check %s for details"
     IDS_VERSION_INFO        "Setup.exe version %1"
     IDS_CYGWIN_SETUP        "Cygwin Setup"
     IDS_CYGWIN_SETUP_WITH_PROGRESS "%1!d!%% - Cygwin Setup"
     IDS_CORRUPT_PACKAGE     "Package file %s has a corrupt local copy, please remove and retry."
+    IDS_MISSING_LOG         "<no log was in use>"
 END
 
 #endif    // English (U.S.) resources
Index: resource.h
===================================================================
RCS file: /cvs/cygwin-apps/setup/resource.h,v
retrieving revision 2.20
diff -u -p -r2.20 resource.h
--- resource.h	19 Jan 2003 20:31:53 -0000	2.20
+++ resource.h	1 Feb 2003 23:11:47 -0000
@@ -120,6 +120,7 @@
 #define IDC_DISABLE_AV			1067
 #define IDC_LEAVE_AV			1068
 #define IDC_CHOOSE_KEEP			1069
+#define IDS_MISSING_LOG			1070
 #define IDC_STATIC                      -1
 
 // Next default values for new objects


More information about the Cygwin-apps mailing list