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(+)

--- 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}" = / ]

-- 
Jean Delvare
SUSE L3 Support


_______________________________________________
Quilt-dev mailing list
Quilt-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to