summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2015-06-16 20:54:44 +0200
committerJean Delvare <jdelvare@suse.de>2015-06-16 20:54:44 +0200
commit77a31d20c8f21b2c2ad5f2b640995288d31159b5 (patch)
tree5da36181403805ec74ca192645c142d5699ecaae
parenta0dfb9956600407fc44f882151bf169c8b653a7d (diff)
downloadquilt-77a31d20c8f21b2c2ad5f2b640995288d31159b5.tar.gz
inspect-wrapper: Don't look up already known files
If the input file is passed as a command line parameter, we already know its name, don't waste time looking it up. This change results in a 3 to 5 % performance gain in my test case.
-rw-r--r--quilt/scripts/inspect-wrapper.in24
-rw-r--r--quilt/setup.in1
2 files changed, 16 insertions, 9 deletions
diff --git a/quilt/scripts/inspect-wrapper.in b/quilt/scripts/inspect-wrapper.in
index 66471b0..46430e9 100644
--- a/quilt/scripts/inspect-wrapper.in
+++ b/quilt/scripts/inspect-wrapper.in
@@ -236,21 +236,27 @@ unzip)
inputfile=$(unzip_input_file "$@")
;;
esac
+
if [ -n "$inputfile" ]
then
- unpackfile=$(original_file "$inputfile")
+ if [ "${inputfile:0:1}" = / ]
+ then
+ unpackfile=${inputfile/$RPM_SOURCE_DIR}
+ else
+ unpackfile=$QUILT_SETUP_PREFIX$(dir_to_dir "$RPM_BUILD_DIR" "$inputfile")
+ fi
else
# put data from stdin into tmpfile
cat > $tmpdir/data
unpackfile=$(original_file $tmpdir/data)
-fi
-if [ $? -ne 0 ]
-then
- # Report problem to the caller
- echo -n "?" >&4
- printf "Warning: no match for file with md5sum %s\n" \
- $unpackfile >&2
- unpackfile="#$unpackfile"
+ if [ $? -ne 0 ]
+ then
+ # Report problem to the caller
+ echo -n "?" >&4
+ printf "Warning: no match for file with md5sum %s\n" \
+ $unpackfile >&2
+ unpackfile="#$unpackfile"
+ fi
fi
case $command in
diff --git a/quilt/setup.in b/quilt/setup.in
index 93efb99..165c008 100644
--- a/quilt/setup.in
+++ b/quilt/setup.in
@@ -229,6 +229,7 @@ inspect()
# Standard mode
mkdir -p $tmpdir/build
fi
+ export -f normalize_path dir_to_dir
# Redirect file descriptors
# 5 is used in verbose mode, 4 in non-verbose mode, and 2 for both (real errors)