diff --git a/fix-relative-import.patch b/fix-relative-import.patch new file mode 100644 index 0000000..8646b59 --- /dev/null +++ b/fix-relative-import.patch @@ -0,0 +1,82 @@ +Fix import of relative patches. + +This closes bug #35244. +--- + quilt/import.in | 8 ++++---- + quilt/scripts/patchfns.in | 17 ++++++++++++++--- + test/import.test | 9 +++++++++ + 3 files changed, 27 insertions(+), 7 deletions(-) + +--- 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) +--- 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%/*}" +--- 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/quilt.changes b/quilt.changes index 4998b14..014a1e7 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 30 13:49:59 CET 2012 - jdelvare@suse.de + +- fix-relative-import.patch: Fix import of relative patches + (savannah#35244). + ------------------------------------------------------------------- Sun Jan 29 20:22:18 CET 2012 - jdelvare@suse.de diff --git a/quilt.spec b/quilt.spec index 4785181..512fc4c 100644 --- a/quilt.spec +++ b/quilt.spec @@ -36,6 +36,7 @@ AutoReqProv: off Source: %{name}-%{version}.tar.bz2 Source1: suse-start-quilt-mode.el Patch1: expand.diff +Patch2: fix-relative-import.patch Patch3: patch-wrapper-rpm.diff Patch4: grep-support-spaces.patch Patch5: suse-workaround-pseudo-release.patch @@ -59,6 +60,7 @@ Authors: %prep %setup -q %patch1 -p1 +%patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1