also sprach Loïc Minier <[EMAIL PROTECTED]> [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 <[EMAIL PROTECTED]>
: :'  :  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

Attachment: signature.asc
Description: Digital signature (GPG/PGP)

Reply via email to