summaryrefslogtreecommitdiffstats
path: root/scripts/inspect.in
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2005-05-22 16:19:47 +0000
committerAndreas Gruenbacher <agruen@suse.de>2005-05-22 16:19:47 +0000
commit7118177ee7f653e0639096cb4a81bc4cd00f82df (patch)
tree68e7ff1d6fa7db6e2bfca220661fb0bc17804e64 /scripts/inspect.in
parent918b0cb2cd701df85706d776cbc15b1375ba5f95 (diff)
downloadquilt-7118177ee7f653e0639096cb4a81bc4cd00f82df.tar.gz
- setup command: When a patch cannot be identified, scan all the
files in the build directory: the patch may have been created, unpacked from an archive, etc.
Diffstat (limited to 'scripts/inspect.in')
-rw-r--r--scripts/inspect.in33
1 files changed, 27 insertions, 6 deletions
diff --git a/scripts/inspect.in b/scripts/inspect.in
index f3fb648..14c4d81 100644
--- a/scripts/inspect.in
+++ b/scripts/inspect.in
@@ -81,7 +81,7 @@ do
echo "$1 $file"
;;
esac
-done > $tmpdir/md5sum
+done > $tmpdir/md5sums
echo >&4
shopt -u nullglob
@@ -113,17 +113,38 @@ cat <<-'EOF' > $tmpdir/bin/wrapper
# find original data file by md5sum
original_file() {
- local file=$1
+ local file=$1 md5sum
set -- $(md5sum < $file)
- while read md5sum file
+ md5sum=$1
+ while read md5sum_ file_
do
- if [ $1 = $md5sum ]
+ if [ $md5sum = $md5sum_ ]
then
- echo $file
+ echo $file_
return 0
fi
- done < $tmpdir/md5sum
+ done < $tmpdir/md5sums
+
+ # Try harder
+ if ! [ -e $tmpdir/more-md5sums ]
+ then
+ ( cd $RPM_BUILD_DIR
+ find -type f \
+ | sed -e 's:^.\/::' \
+ | xargs md5sum \
+ ) > $tmpdir/more-md5sums
+ fi
+
+ while read md5sum_ file_
+ do
+ if [ $md5sum = $md5sum_ ]
+ then
+ echo $file_
+ return 0
+ fi
+ done < $tmpdir/more-md5sums
+
return 1
}