quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] [PATCH] inspect-wrapper: Report failed look-ups


From: Jean Delvare
Subject: [Quilt-dev] [PATCH] inspect-wrapper: Report failed look-ups
Date: Sat, 14 Mar 2015 18:45:13 +0100

The inspect-wrapper script looks up files by md5sum. If that fails,
we should notify the user that something went wrong.
---
 quilt/scripts/inspect-wrapper.in |   45 ++++++++++++++++++++++-----------------
 quilt/setup.in                   |    2 +
 2 files changed, 28 insertions(+), 19 deletions(-)

--- a/quilt/scripts/inspect-wrapper.in
+++ b/quilt/scripts/inspect-wrapper.in
@@ -35,6 +35,8 @@ original_file()
                fi
        done < $tmpdir/more-md5sums
 
+       # Return md5sum and error if we can't match the file
+       echo $md5sum
        return 1
 }
 
@@ -239,28 +241,33 @@ else
        cat > $tmpdir/data
        unpackfile=$(original_file $tmpdir/data)
 fi
-
-if [ -n "$unpackfile" ]
+if [ $? -ne 0 ]
 then
-       case "${0##*/}" in
-       patch)
-               subdir=$(patch_opt_d "$@")
-               dir=$(pwd_to_dir $subdir)
-               echo "${0##*/} ${dir:-.} $unpackfile" \
-                    $(strip_option "$@") $(reverse_option "$@") >&3
-               ;;
-       tar)
-               subdir=$(tar_opt_C "$@")
-               dir=$(pwd_to_dir $subdir)
-               echo "${0##*/} ${dir:-.} $unpackfile" >&3
-               ;;
-       unzip)
-               dir=$(pwd_to_dir)
-               echo "${0##*/} ${dir:-.} $unpackfile" >&3
-               ;;
-       esac
+       # Report problem to the caller
+       echo -n "?" >&4
+       printf "Warning: no match for file with md5sum %s\n" \
+              $unpackfile >&2
+       unpackfile="#$unpackfile"
 fi
 
+case "${0##*/}" in
+patch)
+       subdir=$(patch_opt_d "$@")
+       dir=$(pwd_to_dir $subdir)
+       echo "${0##*/} ${dir:-.} $unpackfile" \
+            $(strip_option "$@") $(reverse_option "$@") >&3
+       ;;
+tar)
+       subdir=$(tar_opt_C "$@")
+       dir=$(pwd_to_dir $subdir)
+       echo "${0##*/} ${dir:-.} $unpackfile" >&3
+       ;;
+unzip)
+       dir=$(pwd_to_dir)
+       echo "${0##*/} ${dir:-.} $unpackfile" >&3
+       ;;
+esac
+
 # In fast mode, we don't actually apply patches
 [ -n "$QUILT_SETUP_FAST" ] && exit 0
 
--- a/quilt/setup.in
+++ b/quilt/setup.in
@@ -419,6 +419,8 @@ then
 
        while read tag dir arg1 arg2
        do
+               [ "${arg1:0:1}" != '#' ] || continue
+
                case "$tag" in
                tar)
                        tarball=$sourcedir$arg1

-- 
Jean Delvare
SUSE L3 Support




reply via email to

[Prev in Thread] Current Thread [Next in Thread]