From ff9e0e643037cbff6a625345935d8ed6fa021110 Mon Sep 17 00:00:00 2001 From: Jindrich Novy Date: Thu, 25 Sep 2008 17:06:00 +0000 Subject: [PATCH] - don't treat %patch numberless if -P parameter is present (#463942) --- rpm-4.5.90-patch-P.patch | 22 ++++++++++++++++++++++ rpm.spec | 7 ++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 rpm-4.5.90-patch-P.patch diff --git a/rpm-4.5.90-patch-P.patch b/rpm-4.5.90-patch-P.patch new file mode 100644 index 0000000..e5f2d30 --- /dev/null +++ b/rpm-4.5.90-patch-P.patch @@ -0,0 +1,22 @@ +commit c4fa73c573f63d2e2b53e75d25feafbf65ebf671 +Author: Jindrich Novy +Date: Wed Sep 24 18:39:43 2008 +0200 + + Don't treat %patch numberless if -P parameter is present + +diff --git a/build/parsePrep.c b/build/parsePrep.c +index 2be0693..bfef325 100644 +--- a/build/parsePrep.c ++++ b/build/parsePrep.c +@@ -431,7 +431,10 @@ static rpmRC doPatchMacro(rpmSpec spec, const char *line) + if (! strchr(" \t\n", line[6])) { + rasprintf(&buf, "%%patch -P %s", line + 6); + } else { +- rasprintf(&buf, "%%patch -P %d %s", INT_MAX, line + 6); /* INT_MAX denotes not numbered %patch */ ++ if (strstr(line+6, " -P") == NULL) ++ rasprintf(&buf, "%%patch -P %d %s", INT_MAX, line + 6); /* INT_MAX denotes not numbered %patch */ ++ else ++ buf = strdup(line); /* it is not numberless patch because -P is present */ + } + poptParseArgvString(buf, &argc, &argv); + free(buf); diff --git a/rpm.spec b/rpm.spec index d957d52..ad55df9 100644 --- a/rpm.spec +++ b/rpm.spec @@ -18,7 +18,7 @@ Summary: The RPM package management system Name: rpm Version: %{rpmver} -Release: 0.%{snapver}.7 +Release: 0.%{snapver}.8 Group: System Environment/Base Url: http://www.rpm.org/ Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2 @@ -42,6 +42,7 @@ Patch205: rpm-4.5.90-topdir.patch Patch206: rpm-4.5.90-rpmbuild-dirs.patch Patch207: rpm-4.5.90-cpio-hardlink.patch Patch208: rpm-4.5.90-macro-args.patch +Patch209: rpm-4.5.90-patch-P.patch # These are not yet upstream Patch300: rpm-4.5.90-posttrans.patch @@ -182,6 +183,7 @@ that will manipulate RPM packages and databases. %patch206 -p1 -b .rpmbuild-dirs %patch207 -p1 -b .cpio-hardlink %patch208 -p1 -b .macro-args +%patch209 -p1 -b .patch-P # needs a bit of upstream love first... #%patch300 -p1 -b .posttrans @@ -360,6 +362,9 @@ exit 0 %doc doc/librpm/html/* %changelog +* Thu Sep 25 2008 Jindrich Novy +- don't treat %patch numberless if -P parameter is present (#463942) + * Thu Sep 11 2008 Panu Matilainen - add hack to support extracting gstreamer plugin provides (#438225) - fix another macro argument handling regression (#461180)