summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-09-17 22:41:25 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-09-17 22:52:40 +0100
commit5479b8db587120c1582d755c056ccf26bc095806 (patch)
tree0c2a6fafcf74f396a3ffb424b69289808c81af23
parentf9f0767e20847734db3747c06b4ff11729a62a07 (diff)
downloadlibguestfs-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.in11
-rw-r--r--tmp/.gitignore1
2 files changed, 7 insertions, 5 deletions
diff --git a/run.in b/run.in
index 6eb0e0b1..ed4971bd 100644
--- a/run.in
+++ b/run.in
@@ -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-*