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

Re: Undeclared dependencies on menu



Package: menu
Version: 1.5-12
Severity: wishlist

[ Re debian-devel discussion: a broken /usr/sbin/update-menus can break
  many other packages' maintainer scripts ]

This is a problem...  If update-menus is being installed and depends on
a a library which doesn't yet exist on the system, it may be unpacked
before the library is unpacked.  If any other maintainer script calls
update-menus in the mean time, using the usual formulation:

  if [ -x /usr/bin/update-menus ]; then /usr/bin/update-menus; fi

then it will fail because `update-menus' will exist but be broken.
I think this can be fixed in two ways.  One is to make all the packages
that call update-menus tolerate its failure by, say, using `update-menus
|| true'.  This is impractical, because of the sheer number of packages
that would have to be changed.

The better solution is to make sure that update-menu doesn't exist
unless it's sure to work.  Here's how that could be done: move the
`update-menus' script to (say) /usr/sbin/update-menus.real, then have
menu's postinst symlink it to /usr/sbin/update-menus, and have menu's
prerm remove the symlink.  This should be fairly bullet-proof, and
doesn't require updating hundreds of other packages.

It's possible that there might be packages which fail to run
/usr/sbin/update-menus if it's a symlink (if they use lstat to check
its executability), so it might be better to use a hard-link, or to just
rename the file (although this seems a bit messy).  There's precedent for
moving files around like this; ldconfig and perl are installed this way...

This message also serves to file this suggestion as a wishlist bug
against menu, which I hope this is the Right Thing to do...

-- 
Charles Briscoe-Smith
White pages entry, with PGP key: <URL:http://alethea.ukc.ac.uk/wp?95cpb4>
PGP public keyprint: 74 68 AB 2E 1C 60 22 94  B8 21 2D 01 DE 66 13 E2


--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: