Release Jed 0.99.18-1

Rafael Laboissiere rafael at debian.org
Mon May 15 14:00:38 UTC 2006


* 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
> 
> 
> This is still quite convoluted. Actually, rmdir does never remove a
> directory that is not empty (according to the man page:   
>     rmdir - löscht leere Verzeichnisse
> ).

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
     
> So we could skip the test and do instead:
> 
> 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.

> 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 document in the debian/NEWS
file.

I think that we have several possibilities now.  I do not really care
which one we choose (unless the Policy discourages the last one).

Jürgen, what do you think?

-- 
Rafael



More information about the Pkg-jed-devel mailing list