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

Re: dash: fails to install when /usr/share/man doesn't exist

clone 615556 -1
reassign -1 emdebian-grip
retitle -1 emgrip needs to preserve directories where files are removed

On Sun, 27 Feb 2011 06:12:20 -0600
Jonathan Nieder <jrnieder@gmail.com> wrote:

This is an artefact of how Emdebian packages get processed and also
a result of dash not checking for either /usr/share/man/man1 or
the file itself before trying to call 'ln'.

Even if the directory is preserved, dash should still check to ensure
that the diverted manpage actually exists before trying to symlink it.

> > Adding 'diversion of /bin/sh to /bin/sh.distrib by dash'
> > ln: creating symbolic link `/usr/share/man/man1/sh.1.gz.tmp': No
> > such file or directory

There's not much chance of this getting fixed in all the Emdebian
packages themselves - even once I change the processing to only remove
files rather than sub-directories, it's only going to affect updated
packages in sid and wheezy.

> > The error is due to the fact that the chroot where the package is
> > being installed doesn't contain /usr/share/man (it is a EmDebian
> > chroot).

No, the error is down to a combination of emdebian-grip-server removing
the directory and the file and the dash maintainer scripts not checking
whether the file or directory exists.

> I don't believe policy requires the unmodified maintainer scripts to
> work in such a hostile environment (the /usr/share/man/man1 directory
> is part of a number of essential packages), though I could easily be
> wrong.

/usr/share/man/ is not essential in it's own right. Packages should
still install correctly if /usr/share/man does not already exist. The
problem reveals itself because dpkg-divert correctly skips files which
don't exist but then dash assumes that the file does exist.

with dpkg-filters, it is quite possible that ./usr/share/man will not
exist on an otherwise standard Debian system.
> But putting that aside, how are packages supposed to deal with this?

Check that the file and path exists before calling 'ln'.

> Is it only /usr/share/man that might be stripped away or are there
> other directories to worry about?


>  If a directory is missing, is it
> safe to assume nothing should be installed there, or should some
> directories be silently created when needed?

I'll see about only removing files rather than sub-directories. Some
packages might get a little bit larger but the effect on the installed
system will be negligible.

However, simply having empty directories isn't going to prevent ln
failing if the original file does not exist either.

> Does emdebian have a way to provide emdebian-specific changes to
> maintainer scripts?

No, not in Emdebian Grip.

>  Are stock packages supposed to work in an
> emdebian environment?

Yes - although Emdebian (via multistrap) provides mechanisms to ensure
that relevant steps can be made for particular cases. 

e.g. with multistrap, it is trivial to write a setupscript which
ensures that particular directories, like /usr/share/man/ exist before
packages get configured.


Neil Williams

Attachment: pgpKycdBc8DPI.pgp
Description: PGP signature

Reply to: