diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-09-17 22:41:25 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-09-17 22:52:40 +0100 |
commit | 5479b8db587120c1582d755c056ccf26bc095806 (patch) | |
tree | 0c2a6fafcf74f396a3ffb424b69289808c81af23 | |
parent | f9f0767e20847734db3747c06b4ff11729a62a07 (diff) | |
download | libguestfs-5479b8db587120c1582d755c056ccf26bc095806.tar.gz libguestfs-5479b8db587120c1582d755c056ccf26bc095806.tar.xz libguestfs-5479b8db587120c1582d755c056ccf26bc095806.zip |
./run: Write temporary file in tmp directory.
We have a new 'tmp' directory under the top level dir for temporary
files. Use it for the temporary output from the ./run script.
-rw-r--r-- | run.in | 11 | ||||
-rw-r--r-- | tmp/.gitignore | 1 |
2 files changed, 7 insertions, 5 deletions
@@ -121,9 +121,10 @@ else # For tests (./run --test), redirect all output to a file, and # only print the file if the test fails. pid=$$ - rm -f $b/run.$pid + tmpout=$b/tmp/run-$pid + rm -f $tmpout start_t="$(date +'%s')" - $libtool "$@" > $b/run.$pid 2>&1 + $libtool "$@" > $tmpout 2>&1 fail=$? end_t="$(date +'%s')" if [ "$fail" -eq 0 ]; then @@ -131,13 +132,13 @@ else echo $(($end_t - $start_t)) seconds: "$@" elif [ "$fail" -eq 77 ]; then # Tests return 77 to mean skipped. - cat $b/run.$pid + cat $tmpout else # Test failed. echo "$b/run --test" "$@" - cat $b/run.$pid + cat $tmpout echo "$b/run: command failed with exit code $fail" fi - rm -f $b/run.$pid + rm -f $tmpout exit $fail fi diff --git a/tmp/.gitignore b/tmp/.gitignore index 996d0c5d..a69c5bfb 100644 --- a/tmp/.gitignore +++ b/tmp/.gitignore @@ -1,2 +1,3 @@ /.guestfs-* /guestfs.* +/run-* |