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

Alternative post[inst,rm} script


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


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
   ... do something useful

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

Kind regards


Reply to: