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

prerm/postinst scripts failing silently(?)



Hi all,

I'm adopting a package that produces several binaries, and I need to adapt it
so that every binary will have its own prerm and postinst scripts (issue
#315318). I tried calling the scripts debian/binaryX.{prerm,postinst}, but
they seem to be ignored when installing the binary packages (postinst calls
update-alternatives but there is no sign of it actually being called), and I
don't see any error messages when installing the package by hand). Attached
are the scripts for one of the binaries.

Any hints on how I could debug this?

Cheers,
Serafeim

ps. please CC me as I'm not on the list
#!/bin/sh

set -e

utils="bogofilter bogoupgrade bogotune bf_copy bogolexer bogoutil bf_compact bf_tar"
man1_dir=/usr/share/man/man1

case "$1" in
    configure|abort-upgrade)
        for util in $utils; do
            #update-alternatives --quiet --install \
            update-alternatives --verbose --install \
                /usr/bin/$util $util /usr/bin/${util}-bdb 20 \
                --slave $man1_dir/${util}.1 ${util}.1 $man1_dir/${util}-bdb.1
        done
        ;;
    *)
        echo "postint called with unknown argument \`$1'" >&2
        exit 1
        ;;
esac

#!/bin/sh

set -e

utils="bogofilter bogoupgrade bogotune bf_copy bogolexer bogoutil bf_compact bf_tar"

case "$1" in
    remove|deconfigure)
        for util in $utils; do
            # this won't run when upgrading from version 1.2.0-2
            if [ -e "/etc/alternatives/$util" ]; then
                update-alternatives --quiet --remove "$util" "/usr/bin/${util}-bdb}"
            fi
        done
        ;;
    *)
        echo "prerm called with unknown argument \`$1'" >&2
        exit 1
        ;;
esac


Reply to: