[Pkg-sysvinit-devel] Bug#546405: new sysv-rc.postinst code to clear /var/lib/update-rc.d on upgrades fails with exit status 1

Sven Joachim svenjoac at gmx.de
Sun Sep 13 06:27:36 UTC 2009


Am 13.09.2009 um 08:06 schrieb Felix Zielcke:

> I don't know why setting a variable to an empty string, is considered
> an error with set -e

It is because grep does not find anything and thus returns 1.

> but that patch fixes it for me:
>
> --- sysv-rc.postinst.old	2009-09-13 08:01:40.813301643 +0200
> +++ sysv-rc.postinst	2009-09-13 07:54:13.528534740 +0200
> @@ -182,7 +182,7 @@
>  	    fi
>  	fi
>  	if dpkg --compare-versions "$2" lt 2.87dsf-5 ; then
> -	    removedfiles=$(grep -l 'remove$' /var/lib/update-rc.d/*) 
> +	    removedfiles=$(grep -l 'remove$' /var/lib/update-rc.d/*) || true
>  	    if [ "$removedfiles" ] ; then
>  		rm $removedfiles
>  	    fi

Seems correct to me.

Sven





More information about the Pkg-sysvinit-devel mailing list