Release Jed 0.99.18-1
G. Milde
g.milde at web.de
Mon May 15 08:19:25 UTC 2006
Rafael Laboissiere schrieb am Sun 14. May, 20:45 (+0200):
> This problem has nothing to do with version 0.99.18-1, but with the
> postrm script in version 0.99.16-6. Unfortunately, this script was
> changed from version 0.99.16-5 to version 0.99.16-6 in a wrong way.
> It contained in version 0.99.16-5:
>
> if [ -z "`/bin/ls /etc/jed-init.d/`" ]; then
> rmdir /etc/jed-init.d
> fi
>
> In version 0.99.16-6, it changed to:
>
> if [ -d /etc/jed-init.d/ ]; then
> rmdir /etc/jed-init.d
> fi
>
> This change was done by Guenter on 2005-11-08 with the following log
> message:
>
> simplified test syntax as it failed on GNU bash, version
> 3.00.16(1)-release (i386-pc-linux-gnu) (trying to remove nonexistent dir)
>
> The code above obviously fails when the directory exists but is
> non-empty. The goal of the code in 0.99.16-5 was completely different:
> remove the /etc/jed-init.d/ directory only when it is empty. It is very
> unfortunate that this slipped into a version in unstable.
The problem I came across was that if "/etc/jed-init.d" doesnot exist, the
original code tries to remove it (as it obviously doesnot contain
any files) and thus fails.
I was unable to remove, unable to upgrade and unable to downgrade jed after
manually changing jed-init.d to jed.d. The abovementioned change helped me
solve the problem but doesnot care for leftover files in jed-init.d (be them
from another package or the local sysadmin). In the urge to get out of the
trap with the non-working postrm script (that blocked all of my other debian
upgrading attempts), I did not comprehend the original goal of the original
code. I am sorry for this misunderstanding.
> My question to Guenter: could you revert or, if possible, write a code
> that works correctly and is compatible GNU bash 3.00.16(1)?
I might have been overly specific. I do not think the problem is specific to
one version of bash. I can even reproduce it with dash.
Jörg Sommer <joerg at alea.gnuu.de> [2006-05-14 22:36]:
> Günter, can you remember what was the full output? Did rmdir or ls
> report "/etc/jed-init.d/: No such file or directory"?
I think so. Actually, it still does with the modified version:
horst:/home/milde# if [ -z "$(ls /etc/jed-init.d/ 2>/dev/null)" ];
then rmdir /etc/jed-init.d; fi
rmdir: ,,/etc/jed-init.d": Datei oder Verzeichnis nicht gefunden
On 14.05.06, Rafael Laboissiere wrote:
> * Jörg Sommer <joerg at alea.gnuu.de> [2006-05-14 22:36]:
>
> > I would suggest these lines:
> >
> > if [ -z $(ls /etc/jed-init.d/ 2>/dev/null) ]; then
> > rmdir /etc/jed-init.d
> > fi
>
> It only works with quotes:
>
> if [ -z "$(ls /etc/jed-init.d/ 2>/dev/null)" ]; then
> rmdir /etc/jed-init.d
> fi
>
> Günter, can we commit this change?
It will not solve my problem as it still tries to remove a nonexisting dir:
rmdir: ,,/etc/jed-init.d": Datei oder Verzeichnis nicht gefunden
What we need is a double test: if /etc/jed-init.d/ exists *and* is empty,
remove it.
If one of you two could implement this in shell easily, I would be happy,
as I am afraid my experience with shell programming is too small to find a
good implementation in a limited time.
Günter
--
Milde ife.et.tu-dresden.de
More information about the Pkg-jed-devel
mailing list