[26704] in Source-Commits

home help back first fref pref prev next nref lref last post

Re: /svn/athena r25695 -

daemon@ATHENA.MIT.EDU (Benjamin Kaduk)
Sat Aug 4 19:43:52 2012

Date: Sat, 4 Aug 2012 19:43:48 -0400 (EDT)
From: Benjamin Kaduk <kaduk@MIT.EDU>
To: Jonathan D Reed <jdreed@MIT.EDU>
cc: source-commits@MIT.EDU
In-Reply-To: <201208032354.q73NsDSh006646@drugstore.mit.edu>
Message-ID: <alpine.GSO.1.10.1208041939410.22690@multics.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Fri, 3 Aug 2012, Jonathan D Reed wrote:

> Author: jdreed
> Date: 2012-08-03 19:54:13 -0400 (Fri, 03 Aug 2012)
> New Revision: 25695
>
> Added:
>   trunk/debathena/debathena/locker-menu/debian/debathena-locker-menu.postrm
> Modified:
>   trunk/debathena/debathena/locker-menu/debian/debathena-locker-menu.postinst
> Log:
> Clean up in postrm
>
> Modified: trunk/debathena/debathena/locker-menu/debian/debathena-locker-menu.postinst
> ===================================================================
> --- trunk/debathena/debathena/locker-menu/debian/debathena-locker-menu.postinst	2012-08-03 17:08:42 UTC (rev 25694)
> +++ trunk/debathena/debathena/locker-menu/debian/debathena-locker-menu.postinst	2012-08-03 23:54:13 UTC (rev 25695)
> @@ -19,6 +19,7 @@
>
> SHAREDIR="/usr/share/debathena-locker-menu"
> ICON_NONFREE_DIR="/usr/share/debathena-locker-menu/icons-nonfree"
> +# If you change this list, change it in the postrm too
> ICONS="acroread.png mathematica.png maple.png sas.png stata.png tecplot.png xess.png"
>
> # Source debconf library.
> @@ -30,8 +31,9 @@
> 	if [ "$RET" = "true" ]; then
> 	    echo "Using real icons for debathena-locker-menu..." >&2
> 	    for i in $ICONS; do
> -		if ! cp -f "$ICON_NONFREE_DIR/$i" "$SHAREDIR/$i"; then
> -		    echo "Can't find real icon for $i, falling back to generic" >&2
> +		if [ -f "$ICON_NONFREE_DIR/$i" ] && \
> +		    ln -nsf "$ICON_NONFREE_DIR/$i" "$SHAREDIR/$i"; then

Isn't the logic on the check for ln's return value inverted?

> +		    echo "Can't find or link real icon for $i, falling back to generic" >&2
>  		    ln -nsf "$SHAREDIR/generic-icon.png" "$SHAREDIR/$i"
> 		fi
> 	    done
>
> Added: trunk/debathena/debathena/locker-menu/debian/debathena-locker-menu.postrm
> ===================================================================
> --- trunk/debathena/debathena/locker-menu/debian/debathena-locker-menu.postrm	                        (rev 0)
> +++ trunk/debathena/debathena/locker-menu/debian/debathena-locker-menu.postrm	2012-08-03 23:54:13 UTC (rev 25695)
> @@ -0,0 +1,48 @@
> +#!/bin/sh
> +# postrm script for debathena-locker-menu
> +#
> +# see: dh_installdeb(1)
> +
> +set -e
> +
> +# summary of how this script can be called:
> +#        * <postrm> `remove'
> +#        * <postrm> `purge'
> +#        * <old-postrm> `upgrade' <new-version>
> +#        * <new-postrm> `failed-upgrade' <old-version>
> +#        * <new-postrm> `abort-install'
> +#        * <new-postrm> `abort-install' <old-version>
> +#        * <new-postrm> `abort-upgrade' <old-version>
> +#        * <disappearer's-postrm> `disappear' <overwriter>
> +#          <overwriter-version>
> +# for details, see http://www.debian.org/doc/debian-policy/ or
> +# the debian-policy package
> +
> +SHAREDIR="/usr/share/debathena-locker-menu"
> +ICONS="acroread.png mathematica.png maple.png sas.png stata.png tecplot.png xess.png"
> +
> +case "$1" in
> +    purge|remove)
> +	for i in $ICONS; do
> +	    if [ -L "$SHAREDIR/$i" ] &&
> +		! [ -f "$(readlink "$SHAREDIR/$i")" ]; then
> +		rm -f "$SHAREDIR/$i"
> +	    fi
> +	done

I had in mind just unconditionally removing the link, but this is fine, 
too.

-Ben

> +    ;;
> +
> +    upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
> +    ;;
> +
> +    *)
> +        echo "postrm called with unknown argument \`$1'" >&2
> +        exit 1
> +    ;;
> +esac
> +
> +# dh_installdeb will replace this with shell code automatically
> +# generated by other debhelper scripts.
> +
> +#DEBHELPER#
> +
> +exit 0
>
>

home help back first fref pref prev next nref lref last post