From ecfe1b53be0b06eec4e76bab3ce850dcbb3ca7e5 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 2 Jul 2015 11:51:23 +0200 Subject: inspect-wrapper: Identify files passed as stdin When the input file is passed through stdin, we can usually get its name from procfs. This avoids having to look up the file by md5sum. Not only this makes things faster, but this also helps if the patch file was modified by additional commands in the spec file before being applied (yes, I've seen this happen.) Speed gain from this change can reach 20 %. --- quilt/scripts/inspect-wrapper.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/quilt/scripts/inspect-wrapper.in b/quilt/scripts/inspect-wrapper.in index 2cccde3..9636a62 100644 --- a/quilt/scripts/inspect-wrapper.in +++ b/quilt/scripts/inspect-wrapper.in @@ -235,6 +235,13 @@ unzip) ;; esac +# If the file was not passed as a parameter, try to identify stdin +if [ -n "$QUILT_SETUP_FAST" -a -z "$inputfile" ] +then + inputfile=$(readlink /proc/self/fd/0) + [ "${inputfile:0:1}" = / -a -f "$inputfile" ] || inputfile= +fi + if [ -n "$inputfile" ] then if [ "${inputfile:0:1}" = / ] -- cgit