[Pbuilder-maint] Bug#391390: fails to umount /proc if /proc is not mounted

martin f krafft madduck at debian.org
Sun Oct 29 17:46:45 CET 2006


also sprach Loïc Minier <lool at dooz.org> [2006.10.28.1818 +0200]:
>  Could you please try the attached patch?  I've tested it in both
>  working and not working cases, and it seems do what I want it to
>  do: ignore only your particular type of umount error.

Yup, seems to work.

> +    local UMOUNT_OUTPUT
> +    local error
> +    set +e
> +    UMOUNT_OUTPUT="$( exec 2>&1; LC_ALL=C umount "$BUILDPLACE/$1")"
> +    error="$?"
> +    set -e
> +    if [ "$error" -ne 0 ]; then
> +        if echo "$UMOUNT_OUTPUT" | grep -q ': not mounted$'; then
> +	    echo "W: umount said $1 is not mounted, skipping"
> +        else

First, I would use a case statement instead of echo | grep.

Second, how about:

local UMOUNT_OUTPUT
if UMOUNT_OUTPUT="$(LC_ALL=C umount "$BUILDPLACE/$1")"; then
  # it worked
else
  # it did not
fi

:)

-- 
 .''`.   martin f. krafft <madduck at debian.org>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature (GPG/PGP)
Url : http://lists.alioth.debian.org/pipermail/pbuilder-maint/attachments/20061029/3d66ccc9/attachment.pgp


More information about the Pbuilder-maint mailing list