[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] [PATCH 1/4] inspect-wrapper: Identify files passed as stdin
From: |
Jean Delvare |
Subject: |
[Quilt-dev] [PATCH 1/4] inspect-wrapper: Identify files passed as stdin |
Date: |
Tue, 16 Jun 2015 21:32:42 +0200 |
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