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

Re: Packages removing alternatives on upgrade



Ivan Shmakov <oneingray@gmail.com> writes:

> 	?  How is the ‘if’ statement above different to, say:

> case "$1" in
>     (remove)
>         update-alternatives --remove <foo> <path-to-foo>
>         ;;
> esac

It's not; what it *is* different from is the more common case
construction, which instead looks like:

case "$1" in
    (remove)
        update-alternatives --remove <foo> <path-to-foo>
        ;;
    (upgrade|failed-upgrade|deconfigure)
        ;;
    (*)
        echo "Unknown call $@" >&2
        exit 1
        ;;
esac

If the case doesn't have that default case, it doesn't have this problem,
but when you see the case statement, you usually see that form.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


Reply to: