Re: [SCM] dpkg's main repository branch, master, updated. 22.214.171.124-131-gc07f7fe
On Thu, 22 Dec 2011, Guillem Jover wrote:
> On Mon, 2011-12-05 at 10:01:25 +0100, Raphael Hertzog wrote:
> > On Mon, 05 Dec 2011, Guillem Jover wrote:
> > > + if (!S_ISREG(stat_buf.st_mode))
> > > + ohshit(_("files list for package '%.250s' is not a regular file"),
> > > + pkg->set->name);
> > My error message included "filelistfile" in the output. The user will want
> > to look up in more details what's wrong with the file and it's a good idea
> > to give him the filename IMO.
> I should have noted in the commit message I modified this.
> In any case, IMO the user should never have the need to touch the db,
> and dpkg should do as much as possible to recover itself from any bad
> situation (or avoid getting into one).
I agree with this. I have even have a "dpkg --recover-db" somewhere in
my TODO. But in the specific case of a .list file that's no longer a file,
we don't have any backup...
What could we do? The only possibility is to delete the corrupted .list
file and mark the package as reinst-required.
Giving out the filename doesn't imply that the user has to touch the db
by himself. It just allows him to make a precise diagnosis of his problem.
We should empower the user to take a decision, not hinder his work by
masking what's really broken. In particular given that the most common
breakages are not dpkg's fault but are random filesystem corruption (due
do dying disks/memory or similar).
> > Any reason you decided to change this ?
> Consistency with all other function error messages. But then the atomic
> file switch will make the errors print the actual file name, something
> I currently consider a small regression.
Honestly it's an improvement not a regression, in particular when you
consider translated messages. If I see "files list file" in russian
I won't be able to recognize the error message. But if it includes the
filename, I will have a clearer idea of where things went wrong.
It also greatly reduces the number of strings to translate. I prefer
to have a single string "cannot write %s" instead of many combinations
"cannot write foo", "cannot write bar", etc.
Raphaël Hertzog ◈ Debian Developer
Pre-order a copy of the Debian Administrator's Handbook and help
liberate it: http://debian-handbook.info/liberation/