Release Jed 0.99.18-1
G. Milde
g.milde at web.de
Tue May 16 07:16:48 UTC 2006
On 15.05.06, Rafael Laboissiere wrote:
> * G. Milde <g.milde at web.de> [2006-05-15 14:37]:
>
> > On 15.05.06, Rafael Laboissiere wrote:
> >
> > > if [ -d /etc/jed-init.d/ -a -z "$(ls /etc/jed-init.d/ 2>/dev/null)" ]; then
> > > rmdir /etc/jed-init.d"
> > > fi
> Well, the code above does exactly what you expect from it:
>
> * if /etc/jed-init.d/ does not exist :
> => nothing is done
> * if /etc/jed-init.d/ exists :
> + if /etc/jed-init.d/ is empty:
> => the rmdir command is executed
> + if /etc/jed-init.d/ is not empty:
> => nothing is done
However, it is not easy to read for someone who did not write it in the
first place and thus more difficult to maintain than a simpler
alternative with the same functionality.
> > if [ -d /etc/jed-init.d/ ]; then
> > rmdir --ignore-fail-on-non-empty /etc/jed-init.d"
> > fi
> >
> > (Provided the --ignore-fail-on-non-empty option is availbale on all used
> > shell variants.)
>
> The /bin/rmdir command belongs to the coreutils package and has nothing
> to do with shells. I think we can safely assume that the command above
> will work in any Debian system.
>From a bug report from 26 Mar 2000:
Partially upgrading from Slink to unstable [Potato, GM], I found some
packages which used new options of rmdir and chmod in their postinst
scripts, but didn't depend on a recent version of fileutils.deb
This can stop the scripts and thus an upgrade if the user doesn't
manually upgrade his fileutils.deb
For the record, I've had problems with the --ignore-fail-on-non-empty
option of rmdir ...
It shows two points:
* Care must be taken only to use options that are available in the
current stable distribution
* The codes will fail in Slink but run in old-stable (Potato).
>
> > Or combine the two approaches to get a helpfull output:
> >
> > if [ -d /etc/jed-init.d/ ]; then
> > if [ ! `rmdir /etc/jed-init.d` ]; then
> > echo "/etc/jed-init.d/ has been renamed to /etc/jed.d/.
> > Please move or delete remaining files from /etc/jed-init.d/
> > and then delete /etc/jed-init.d/ itself."
> > fi
> > fi
>
> I have to check the Policy, but I think that maintainer scripts must
> avoid displaying messages, if possible. The switch from /etc/jed-init.d/
> to /etc/jed.d/ is something that must be documented in the debian/NEWS
> file.
I would go for the simplest (which is IMO the second variant) and commit
the change if there is no complaint.
Günter
--
Milde ife.et.tu-dresden.de
More information about the Pkg-jed-devel
mailing list