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]

Re: [setup PATCH] Add some log msgs to installOneSource


On Wed, 2003-07-16 at 20:11, Max Bowsher wrote:

> > This isn't an error. It's simply the automagic compressed archive
> > detection.
> 
> The message could be clearer, but it is valuable info to know whether the
> docompress or the dearchive failed. How about:

> if (tmp) {
> /* Existing code */
> } else {
> if (!tmp2) { log ("Decompression failed. Maybe source not compressed?"; }
> else { log ("De-archiving failed.");
> }
> 
> Is that ok?


> 
> >> +        }
> >> +    }
> >> +  else
> >> +    {
> >> +      log(LOG_PLAIN, String("Failed to open: ") + source.Cached() );
> >>      }
> >
> > this is redundant: the if (thefile) check covers this case, as thefile
> > is null on error.
> 
> Yes, but the additional message shows you *how* it failed.

Actually it doesn't *add* any value in the code path..  EIther both log
messages trigger, or neither does.  You can consolidate the logging to
one place easily.

i.e. 
if (thefile) {
 ...
}
-->
if (!thefile) {
  if (tmp2) 
    log ("unable to get an archive from compressed file");
  else if (tmp)
    log ("corrupt compression format or corrupt archive format in
uncompressed file");
  else 
    log ("could not open source file");
} else {
  ...
}

Rob

-- 
GPG key available at: <http://members.aardvark.net.au/lifeless/keys.txt>.

Attachment: signature.asc
Description: This is a digitally signed message part


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