summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2015-06-16 20:54:57 +0200
committerJean Delvare <jdelvare@suse.de>2015-06-16 20:54:57 +0200
commit0ab5e01c9c472f9138bd994659fc4ed36b656e4e (patch)
tree15efad3c1177bc68895ccd7ff5345fd626bb6179
parent3aac54c295ee684a7fd8c6b70036f0f45999d771 (diff)
downloadquilt-0ab5e01c9c472f9138bd994659fc4ed36b656e4e.tar.gz
inspect-wrapper: Skip file copy in fast mode
In fast mode, we only process calls to patch, and we don't let it actually apply the patches, so we never need to make a temporary copy of files read from the standard input. This change results in a 3 % performance gain in my test case.
-rw-r--r--quilt/scripts/inspect-wrapper.in14
1 files changed, 11 insertions, 3 deletions
diff --git a/quilt/scripts/inspect-wrapper.in b/quilt/scripts/inspect-wrapper.in
index 6fa69a1..2cccde3 100644
--- a/quilt/scripts/inspect-wrapper.in
+++ b/quilt/scripts/inspect-wrapper.in
@@ -244,9 +244,17 @@ then
unpackfile=$QUILT_SETUP_PREFIX$(dir_to_dir "$RPM_BUILD_DIR" "$inputfile")
fi
else
- # put data from stdin into tmpfile
- cat > $tmpdir/data
- md5sum=$(md5sum < $tmpdir/data)
+ if [ -n "$QUILT_SETUP_FAST" ]
+ then
+ # In fast mode we can read from stdin directly, we won't let
+ # patch apply the patch anyway
+ md5sum=$(md5sum)
+ else
+ # put data from stdin into tmpfile
+ cat > $tmpdir/data
+ md5sum=$(md5sum < $tmpdir/data)
+ fi
+
unpackfile=$(original_file $md5sum)
if [ $? -ne 0 ]
then