forked from pool/quilt
- fix-relative-import.patch: Fix import of relative patches
(savannah#35244). OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/quilt?expand=0&rev=51
This commit is contained in:
parent
08912b45d9
commit
bfdef7a078
82
fix-relative-import.patch
Normal file
82
fix-relative-import.patch
Normal file
@ -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
|
@ -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
|
Sun Jan 29 20:22:18 CET 2012 - jdelvare@suse.de
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ AutoReqProv: off
|
|||||||
Source: %{name}-%{version}.tar.bz2
|
Source: %{name}-%{version}.tar.bz2
|
||||||
Source1: suse-start-quilt-mode.el
|
Source1: suse-start-quilt-mode.el
|
||||||
Patch1: expand.diff
|
Patch1: expand.diff
|
||||||
|
Patch2: fix-relative-import.patch
|
||||||
Patch3: patch-wrapper-rpm.diff
|
Patch3: patch-wrapper-rpm.diff
|
||||||
Patch4: grep-support-spaces.patch
|
Patch4: grep-support-spaces.patch
|
||||||
Patch5: suse-workaround-pseudo-release.patch
|
Patch5: suse-workaround-pseudo-release.patch
|
||||||
@ -59,6 +60,7 @@ Authors:
|
|||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
|
%patch2 -p1
|
||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
%patch4 -p1
|
%patch4 -p1
|
||||||
%patch5 -p1
|
%patch5 -p1
|
||||||
|
Loading…
Reference in New Issue
Block a user