[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#580152: dpkg: trigger - W: Unable to read /etc/apt/preferences.d/ - FileExists (2: No such file or directory)



David Kalnischkies <kalnischkies+debian@gmail.com> writes:

> 2010/5/5 Goswin von Brederlow <goswin-v-b@web.de>:
>> David Kalnischkies <kalnischkies+debian@gmail.com> writes:
>>> 2010/5/4 Raphael Hertzog <hertzog@debian.org>:
>>>> On Mon, 03 May 2010, Jonathan Nieder wrote:
>>>>> >        Processing triggers for menu ...
>>>>> >        W: Unable to read /etc/apt/preferences.d/ - FileExists (2: No such file or directory)
>>
>> At least the warning should be fixed. Is the error that it exists and
>> since when is a directory a file? Or that it doesn't? The two errors
>> contradict each other.
>
> An errormessage generated by Error::Errno (or Error::WarningE) is:
> E/W: generic apt error - method used (errno: strerror() with "exact" reason)
>
> The plain reason is that we have a waste amount of possibilities why a file
> is not readable: doesn't exist, broken link, insufficient rights, ?
> writing a message for all of them in APT would be insane.
> On the other hand some of the error messages given by strerror() aren't
> verbose and/or exact enough to be used alone, so the middle way was chosen.
> (I think the Methodname is their to enable Error to do something special
> with certain failures as noted in the Description of the file, but it is
> unused so far - but from time to time useful to map (translated) error
> messages to their untranslated equivalent in bugreports.
>
>
> I have convert now this and a few other calls from FileExists() to
> DirectoryExists() which was added recently to check if it is really a
> directory and not a file, but this doesn't change much?
>
> Any further suggestions?

Change it to FileExists(): (or DirectoryExists(): in this case) to
signify that the first is a location (the function causing the error)
and not the error message itself. Or:

W: Unable to read /etc/apt/preferences.d/ in FileExists(): (2) No such file or directory

More usefull I guess would be the name of the calling function since, as
you say, lots of places will check if a file exists.

> Best regards,
>
> David Kalnischkies

MfG
        Goswin



Reply to: