RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Mark Hatle
Root: /v/rpm/cvs Email: [EMAIL PROTECTED]
Module: rpm Date: 13-Jul-2007 04:11:31
Branch: HEAD Handle: 2007071303113001
Modified files:
rpm CHANGES
rpm/rpmio macro.c
Log:
Transform %patchNN to %patch -P NN
Based on suggestions from jbj.
This should allow anyone to override the way the patch operations by
supplying %patch as a macro!
Summary:
Revision Changes Path
1.1457 +1 -0 rpm/CHANGES
2.122 +18 -0 rpm/rpmio/macro.c
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.1456 -r1.1457 CHANGES
--- rpm/CHANGES 12 Jul 2007 22:25:30 -0000 1.1456
+++ rpm/CHANGES 13 Jul 2007 02:11:31 -0000 1.1457
@@ -1,4 +1,5 @@
4.5 -> 5.0:
+ - mgh: transform %patchNN to %patch -P NN
- jbj: add mono automagic dependency extractors.
- jbj: insure that RPMFILE_EXISTS is set for %config files.
- jbj: revert the _GetPass() hack-a-round.
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmio/macro.c
============================================================================
$ cvs diff -u -r2.121 -r2.122 macro.c
--- rpm/rpmio/macro.c 12 Jul 2007 02:02:34 -0000 2.121
+++ rpm/rpmio/macro.c 13 Jul 2007 02:11:30 -0000 2.122
@@ -1212,6 +1212,11 @@
} else if (STREQ("F", f, fn)) {
b = buf + strlen(buf) + 1;
sprintf(b, "file%s.file", buf);
+ } else if (fn > 5 && STREQ("patch", f, fn >= 5 ? 5 : fn)) {
+ strncpy(buf, f, fn);
+ buf[fn]='\0';
+ b = buf + fn + 1;
+ sprintf(b, "%%patch -P %s", buf+5);
}
if (b) {
@@ -1494,6 +1499,19 @@
mep = findEntry(mb->mc, f, fn);
me = (mep ? *mep : NULL);
+ /* XXX necessary but clunky
+ * We have to do this after the findEntry because there may be a
+ * macro such as "%patchversion", if it evaluates ignore it!
+ */
+ if (me == NULL &&
+ (fn > 5 && STREQ("patch", f, fn >= 5 ? 5 : fn))) {
+ /[EMAIL PROTECTED]@*/ /* FIX: verbose may be set */
+ doFoo(mb, negate, f, fn, g, gn);
+ /[EMAIL PROTECTED]@*/
+ s = se;
+ continue;
+ }
+
/* XXX Special processing for flags */
if (*f == '-') {
if (me)
@@ .
______________________________________________________________________
RPM Package Manager http://rpm5.org
CVS Sources Repository [email protected]