summaryrefslogtreecommitdiffstats
path: root/scripts/inspect.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/inspect.in')
-rw-r--r--scripts/inspect.in21
1 files changed, 17 insertions, 4 deletions
diff --git a/scripts/inspect.in b/scripts/inspect.in
index 83f2db3..5de5009 100644
--- a/scripts/inspect.in
+++ b/scripts/inspect.in
@@ -139,11 +139,20 @@ cat <<-'EOF' > $tmpdir/bin/wrapper
fi
}
- # put data into tmpfile
+ for file in "$@"; do
+ if [ -e "${file#-i}" ]; then
+ inputfile=${file#-i}
+ break
+ fi
+ done
tmpdir=${RPM_BUILD_DIR%/*}
- cat > $tmpdir/data
+ rm -f $tmpdir/data
+ if [ -z "$inputfile" ]; then
+ # put data from stdin into tmpfile
+ cat > $tmpdir/data
+ fi
- unpackfile="$(original_file $tmpdir/data)"
+ unpackfile="$(original_file ${inputfile:-$tmpdir/data})"
if [ -n "$unpackfile" ]
then
dir=${PWD/$RPM_BUILD_DIR}
@@ -163,7 +172,11 @@ cat <<-'EOF' > $tmpdir/bin/wrapper
fi
PATH=${PATH#*:}
- ${0##*/} "$@" < $tmpdir/data
+ if [ -n "$inputfile" ]; then
+ ${0##*/} "$@"
+ else
+ ${0##*/} "$@" < $tmpdir/data
+ fi
EOF
chmod 755 $tmpdir/bin/wrapper
ln -s wrapper $tmpdir/bin/patch