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


_______________________________________________
Quilt-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to