This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
Re: [PATCH] Re: [setup] Inaccurate message: See /setup.log.full
Robert Collins wrote:
> 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 :}.
Or, you could say that it gets the file whose minlevel is what you request.
In which case its correct :-)
> 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.
"Check No log was in use for details."
That's worse than what we have in CVS now.
How about:
Index: LogFile.cc
===================================================================
RCS file: /home/max/cvsmirror/cygwin-apps-cvs/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 21:18:17 -0000
@@ -31,6 +31,7 @@ static const char *cvsid =
#include <time.h>
#include <string>
#include "AntiVirus.h"
+#include "filemanip.h"
using namespace std;
@@ -101,9 +102,22 @@ LogFile::setFile (int minlevel, String c
files.insert (t);
}
+String
+LogFile::getFile (int minlevel) const
+{
+ for (FileSet::iterator i = files.begin();
+ i != files.end(); ++i)
+ {
+ if (i->level == minlevel)
+ return i->key;
+ }
+ return String();
+}
+
void
LogFile::exit (int const exit_code)
{
+ String tempString;
AntiVirus::AtExit();
static int been_here = 0;
if (been_here)
@@ -114,8 +128,15 @@ LogFile::exit (int const exit_code)
#endif
been_here = 1;
+ if (exit_msg == IDS_INSTALL_INCOMPLETE)
+ {
+ tempString = backslash(getFile(LOG_BABBLE));
+ if (tempString.size() == 0)
+ exit_msg = IDS_INSTALL_INCOMPLETE_NO_LOG;
+ }
+
if (exit_msg)
- note (NULL, exit_msg);
+ note (NULL, exit_msg, tempString.cstr_oneuse());
log (LOG_TIMESTAMP) << "Ending cygwin install" << endLog;
Index: LogFile.h
===================================================================
RCS file: /home/max/cvsmirror/cygwin-apps-cvs/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 20:48:07 -0000
@@ -23,6 +23,7 @@ public:
LogFile();
void clearFiles(); // delete all target filenames
void setFile (int minlevel, String const &path, bool append);
+ String getFile (int minlevel) 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: /home/max/cvsmirror/cygwin-apps-cvs/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 21:14:55 -0000
@@ -483,7 +483,8 @@ 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_INSTALL_INCOMPLETE_NO_LOG "Installation incomplete. No log was in
use"
IDS_VERSION_INFO "Setup.exe version %1"
IDS_CYGWIN_SETUP "Cygwin Setup"
IDS_CYGWIN_SETUP_WITH_PROGRESS "%1!d!%% - Cygwin Setup"
Index: resource.h
===================================================================
RCS file: /home/max/cvsmirror/cygwin-apps-cvs/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 21:14:00 -0000
@@ -30,6 +30,7 @@
#define IDS_VERSION_INFO 28
#define IDS_CYGWIN_SETUP 29
#define IDS_CYGWIN_SETUP_WITH_PROGRESS 30
+#define IDS_INSTALL_INCOMPLETE_NO_LOG 31
#define IDD_ROOT 101
#define IDD_SOURCE 102
#define IDD_OTHER_URL 103