[setup PATCH] Add some log msgs to installOneSource

Max Bowsher maxb@ukf.net
Wed Jul 16 10:11:00 GMT 2003


Robert Collins wrote:
> On Wed, 2003-07-16 at 18:44, Max Bowsher wrote:
>> 2003-07-16  Max Bowsher  <maxb@ukf.net>
>>
>>         * install.cc (Installer::installOneSource): Add some log
messages,
>> as
>>         a stopgap until we add some proper error handling here.
>>
>>
>> --- install.cc 25 Mar 2003 20:57:13 -0000 2.61
>> +++ install.cc 16 Jul 2003 08:21:39 -0000
>> @@ -227,7 +227,14 @@ Installer::installOneSource (packagemeta
>>        if (tmp2)
>>   thefile = archive::extract (tmp2);
>>        else
>> - thefile = archive::extract (tmp);
>> +        {
>> +          log(LOG_PLAIN, String("Failed to decompress: ") +
>> source.Cached() );
>> +          thefile = archive::extract (tmp);
>
> 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.

Max.




More information about the Cygwin-apps mailing list