Ævar Arnfjörð Bjarmason [off-list ref] writes:
On Mon, Aug 30, 2010 at 09:50, Matthieu Moy [off-list ref] wrote:
quoted
The same pattern is used in many tests, and makes it easy for new ones to
rely on $HOME being a trashable, clean, directory.
Looks good, but why not:
quoted
+HOME=$(pwd)
+export HOME
This instead:
HOME=$TRASH_DIRECTORY
export HOME
Looks like it might be more correct given this (always an absolute
path), but I haven't tested:
That should work too, but with your version, I have to think harder to
make sure $TRASH_DIRECTORY is absolute (that should be OK), and won't
make any issue with symlinks (I have no idea whether it is OK or not),
while it's trivially correct with mine (pwd is absolute, and the -P
option of the cd command right above prevents issue with symlinks).
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
On Mon, Aug 30, 2010 at 10:54, Matthieu Moy
[off-list ref] wrote:
Ęvar Arnfjörš Bjarmason [off-list ref] writes:
quoted
On Mon, Aug 30, 2010 at 09:50, Matthieu Moy [off-list ref] wrote:
quoted
The same pattern is used in many tests, and makes it easy for new ones to
rely on $HOME being a trashable, clean, directory.
Looks good, but why not:
quoted
+HOME=$(pwd)
+export HOME
This instead:
HOME=$TRASH_DIRECTORY
export HOME
Looks like it might be more correct given this (always an absolute
path), but I haven't tested:
That should work too, but with your version, I have to think harder to
make sure $TRASH_DIRECTORY is absolute (that should be OK), and won't
make any issue with symlinks (I have no idea whether it is OK or not),
while it's trivially correct with mine (pwd is absolute, and the -P
option of the cd command right above prevents issue with symlinks).
I don't know what's best here (and I didn't look hard at this).
but I recently brought down the number of $(pwd) invocations in
test-lib.sh down to exactly 1, so everything that comes later is now
defined in terms of that pwd invocation.
Defining everything that comes afterwards in terms of that pwd might
be clearer.
But it's a trivial issue.