bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: allow spaces in build tree path


From: Jim Meyering
Subject: Re: allow spaces in build tree path
Date: Sun, 22 Oct 2006 19:43:12 +0200

Ralf Wildenhues <address@hidden> wrote:
> The patch below allows CVS HEAD coreutils to pass the testsuite with
> spaces in the absolute build tree path.  Spaces in the source tree
> path are not tested, neither spaces in $srcdir (the relative path
> pointing from the top builddir to the top source dir, that is given
> by the invocation of `configure').  I have not tested spaces in $prefix.
>
> The changes comprise not only the quoting of all relevant path entities,
> but also changes the trap cleanup code to only perform the `rm' if
> previous `cd' and `chmod' were successful:
>
>   -trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
>   +trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit 
> $status'
>
> Now with quoting in place this should be less of a problem, but before
> it would have helped to avoid accidentally removing unrelated files.
> (Is there a chance that the chmod fails but we should still rm the
> files?)

I can't think of any off hand.

> Tested on GNU/Linux with a
>   env RUN_EXPENSIVE_TESTS=yes RUN_VERY_EXPENSIVE_TESTS=yes make check
>
> test both as normal user (that is member of more than one group) and
> root, and a build dir path containing two consecutive spaces (two
> instead of one helps to find underquoted eval constructs).

Thank you!
I've applied that.

I spent some time a while back making sure most of the trap-related
code is the same as what's in the sample-test file, but there are
a few exceptions as well as some old tests that have no trap-handlers.
This is a good reason to finally factor out those four lines.

> If there is interest, I can try to prepare a similar patch for spaces in
> the absolute source tree path; as long as $srcdir does not contain them,
> that should still work in coreutils, I think.

Sure.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]