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

Alternative post[inst,rm} script



Hi,

the cdd-dev helper package installs post{inst,rm} scripts which try to obtain
the package name and thus the cdd via the code

pkg=$(basename $0 | sed 's/\.postinst//')
cdd=$(echo ${pkg} | sed 's/^\([a-z]\+\)-[-a-z]\+/\1/')

This works fine for the normal scripts, but if it comes to an error dpkg
tries to use the script of the old package which has the name

     /var/lib/dpkg/tmp.ci/postrm

i.e., we can not obtain pkg and cdd from this script name.  The success
whether $pkg and $cdd is currently checked via


if [ _"$pkg" = _"$cdd" ] ; then
   echo "Unable to parse Custom Debian Distribution name from $pkg" && \
      exit 70 # EX_SOFTWARE
else
   ... do something useful
fi

but I wonder if we could do something more sane here.

Kind regards

         Andreas.



Reply to: