[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] [PATCH 3/3] inspect-wrapper: Skip file copy in fast mode
From: |
Jean Delvare |
Subject: |
[Quilt-dev] [PATCH 3/3] inspect-wrapper: Skip file copy in fast mode |
Date: |
Wed, 03 Jun 2015 14:07:38 +0200 |
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.
---
quilt/scripts/inspect-wrapper.in | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
--- 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
--
Jean Delvare
SUSE L3 Support