11.04.2012 03:13, Maarten Vanraes kirjoitti: > Hi, > > from a question someone asked, i was reminded why an alternative file ( > /var/lib/rpm/alternative/gl_conf ) was not owned. > > I found out that alternative files are usually %ghost 'ed, but it seems not > in > this case. > > I looked at the alternatives policy, but it was empty as it needs yet to be > written. > > so, is it true that alternative files should be %ghost 'ed? or not?
/var/lib/rpm/alternatives/foo is not an "alternative file" (at least not IMHO), but an internal update-alternaties db, so it is not ghosted. It is automatically removed by update-alternatives when it becomes empty (i.e. all packages providing the alternative have been removed). There is one problem regarding this, though. If the files becomes corrupted, the alternatives system becomes kind of stuck... IMO it should zero/drop the /var/lib/rpm/alternatives/foo on error (possibly with a backup). AFAICS this would mean changing the badfmt() error handler in /usr/sbin/update-alternatives to remove/move the file and changing the open(AF, "$admindir/$name") loop starting in line 135 to handle errors gracefully... -- Anssi Hannula
