diff options
-rw-r--r-- | quilt.changes | 6 | ||||
-rw-r--r-- | quilt/import.in | 8 | ||||
-rw-r--r-- | quilt/scripts/patchfns.in | 17 | ||||
-rw-r--r-- | test/import.test | 9 |
4 files changed, 33 insertions, 7 deletions
diff --git a/quilt.changes b/quilt.changes index 28a0151..6bad600 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Tue Jan 31 16:41:39 CET 2012 - jdelvare@suse.de + +- import.in, scripts/patchfns.in: Fix import of patches from a + subdirectory (bug #35244). + +------------------------------------------------------------------- Sat Jan 28 16:38:10 CET 2012 - jdelvare@suse.de - configure*: Bump version to 0.51. diff --git a/quilt/import.in b/quilt/import.in index efee4d1..cc9deed 100644 --- a/quilt/import.in +++ b/quilt/import.in @@ -152,16 +152,16 @@ then fi before=$(patch_after "$(top_patch)") -for patch_file in "$@" +for orig_patch_file in "$@" do if [ -n "$opt_patch" ] then patch=$opt_patch else - patch=${patch_file##*/} + patch=${orig_patch_file##*/} fi - patch_file=$(find_patch_file "$patch_file") || exit 1 + patch_file=$(find_patch_file "$orig_patch_file") || exit 1 merged_patch_file="$patch_file" if is_applied $patch @@ -199,7 +199,7 @@ do printf $"Importing patch %s\n" "$(print_patch $patch)" else printf $"Importing patch %s (stored as %s)\n" \ - "$patch_file" \ + "$orig_patch_file" \ "$(print_patch $patch)" mkdir -p "${dest%/*}" diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in index e1fc237..15b6b5c 100644 --- a/quilt/scripts/patchfns.in +++ b/quilt/scripts/patchfns.in @@ -641,10 +641,21 @@ find_patch_file() { local name="$1" - if [ -r "$name" ] + if [ ${name:0:1} = / ] then - echo "$name" - return + # Patch has absolute path + if [ -r "$name" ] + then + echo "$name" + return + fi + else + # Patch has a relative path + if [ -r "$SUBDIR$name" ] + then + echo "$SUBDIR$name" + return + fi fi local patch diff --git a/test/import.test b/test/import.test index 8eb40c7..6336854 100644 --- a/test/import.test +++ b/test/import.test @@ -246,3 +246,12 @@ $ cat patches/series > patch1.diff > patchR.diff + +# Also test importing when in a subdirectory + $ touch empty.patch + $ cd t + $ touch empty2.patch + $ quilt import ../empty.patch + > Importing patch ../empty.patch (stored as ../patches/empty.patch) + $ quilt import %{PWD}/empty2.patch + > Importing patch %{PWD}/empty2.patch (stored as ../patches/empty2.patch) |