[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [FYI] {maint} tests: avoid spurious failure of 't/uninstall-fail.sh'
From: |
Eric Blake |
Subject: |
Re: [FYI] {maint} tests: avoid spurious failure of 't/uninstall-fail.sh' on OpenIndiana |
Date: |
Mon, 06 Aug 2012 06:56:15 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 |
On 08/04/2012 12:15 PM, Stefano Lattarini wrote:
> On current OpenIndiana (based on what once was OpenSolaris 11), the shell
> /bin/sh (which, differently from what happens on Solaris, is a true POSIX
> shell, thus worthy of consideration) somehow manages to "eat" the
> error message from 'rm' when that fails to remove a file due to lacking
> permission on the parent directory:
>
> $ /bin/sh -c "cd unwritable-dir || { echo OOPS; exit 1; }; rm -f foo"
> $ echo rc = $?
> rc = 1
> $ /bin/bash -c "cd unwritable-dir || { echo OOPS; exit 1; }; rm -f foo"
> rm: foo not removed: Permission denied
> $ echo rc = $?
> rc = 2
> $ /bin/sh -c "cd unwritable-dir || { echo OOPS; exit 1; }; env rm -f foo"
> rm: foo not removed: Permission denied
> $ echo rc = $?
> rc = 2
>
> That is probably due to an improper optimization, that is, the shell tries
> to be smart and remove the file itself instead of invoking 'rm', but fails
> spectacularly in the attempt.
Oh my. Probably worth documenting in autoconf's list of shell
programming pitfalls.
>
> -# Make it harder to experience false postives when grepping error messages.
s/postives/positives/
> +# Weird name, to make it harder to experience false positives when
> +# grepping error messages.
> inst=__inst-dir__
>
> ./configure --prefix="$(pwd)/$inst"
>
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [FYI] {maint} tests: avoid spurious failure of 't/uninstall-fail.sh' on OpenIndiana,
Eric Blake <=