OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 12-Feb-2004 17:52:04
Branch: HEAD Handle: 2004021216520300
Modified files:
openpkg-src/openpkg HISTORY rpm.patch.bugfix rpm.patch.feature
rpm.patch.porting rpm.patch.regen
Log:
Added support to RPM's %patch macro for passing through patch(1) "-d"
option. This way one can replace the nasty "(cd subdir; %patch ...) ||
exit $?" constructs with a simple "%patch -d subdir ...".
Dedicated to: Christoph Schug <[EMAIL PROTECTED]>
Summary:
Revision Changes Path
1.131 +1 -0 openpkg-src/openpkg/HISTORY
1.44 +3 -3 openpkg-src/openpkg/rpm.patch.bugfix
1.46 +96 -24 openpkg-src/openpkg/rpm.patch.feature
1.53 +1 -1 openpkg-src/openpkg/rpm.patch.porting
1.43 +1 -1 openpkg-src/openpkg/rpm.patch.regen
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg/HISTORY
============================================================================
$ cvs diff -u -r1.130 -r1.131 HISTORY
--- openpkg-src/openpkg/HISTORY 12 Feb 2004 16:16:08 -0000 1.130
+++ openpkg-src/openpkg/HISTORY 12 Feb 2004 16:52:03 -0000 1.131
@@ -2,6 +2,7 @@
2004
====
+20040212 added support to RPM's %patch macro for passing through patch(1) "-d"
option
20040212 upgraded to the latest GNU shtool 2.0b0 snapshot version
20040211 upgraded to OSSP uuid 0.9.6
20040210 use "<compat>" for "%l_tag_fmt" on upgrades to be more OpenPKG 1.3
compatible
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg/rpm.patch.bugfix
============================================================================
$ cvs diff -u -r1.43 -r1.44 rpm.patch.bugfix
--- openpkg-src/openpkg/rpm.patch.bugfix 6 Feb 2004 08:22:40 -0000 1.43
+++ openpkg-src/openpkg/rpm.patch.bugfix 12 Feb 2004 16:52:03 -0000 1.44
@@ -10,7 +10,7 @@
## 'patch' tool to upgrade those files. Each patch snippet is annotated
## with a short description.
##
-## Created on: 06-Feb-2004
+## Created on: 12-Feb-2004
##
## ATTENTION: THIS PATCH FILE WAS AUTO-GENERATED FROM AN OPENPKG
## RPM CVS REPOSITORY, HENCE DO NOT EDIT THIS FILE.
@@ -23,8 +23,8 @@
+---------------------------------------------------------------------------
Index: build/parsePrep.c
--- build/parsePrep.c 7 Aug 2002 14:20:45 -0000 1.1.1.10
-+++ build/parsePrep.c 22 Jan 2004 21:42:14 -0000 1.2
-@@ -584,12 +621,15 @@
++++ build/parsePrep.c 12 Feb 2004 16:29:32 -0000
+@@ -584,12 +635,15 @@
saveLines = splitString(getStringBuf(sb), strlen(getStringBuf(sb)), '\n');
/[EMAIL PROTECTED]@*/
for (lines = saveLines; *lines; lines++) {
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg/rpm.patch.feature
============================================================================
$ cvs diff -u -r1.45 -r1.46 rpm.patch.feature
--- openpkg-src/openpkg/rpm.patch.feature 6 Feb 2004 08:43:27 -0000 1.45
+++ openpkg-src/openpkg/rpm.patch.feature 12 Feb 2004 16:52:03 -0000 1.46
@@ -10,7 +10,7 @@
## 'patch' tool to upgrade those files. Each patch snippet is annotated
## with a short description.
##
-## Created on: 06-Feb-2004
+## Created on: 12-Feb-2004
##
## ATTENTION: THIS PATCH FILE WAS AUTO-GENERATED FROM AN OPENPKG
## RPM CVS REPOSITORY, HENCE DO NOT EDIT THIS FILE.
@@ -272,7 +272,7 @@
+---------------------------------------------------------------------------
Index: build/build.c
--- build/build.c 4 Mar 2003 15:27:33 -0000 1.1.1.20
-+++ build/build.c 6 Feb 2004 08:04:09 -0000
++++ build/build.c 6 Feb 2004 15:37:57 -0000 1.4
@@ -33,7 +33,15 @@
for (p = spec->sources; p != NULL; p = p->next) {
@@ -314,7 +314,7 @@
+---------------------------------------------------------------------------
Index: build/build.c
--- build/build.c 4 Mar 2003 15:27:33 -0000 1.1.1.20
-+++ build/build.c 6 Feb 2004 08:04:09 -0000
++++ build/build.c 6 Feb 2004 15:37:57 -0000 1.4
@@ -113,6 +129,14 @@
mTemplate = "%{__spec_clean_template}";
mPost = "%{__spec_clean_post}";
@@ -375,7 +375,7 @@
+---------------------------------------------------------------------------
Index: build/build.c
--- build/build.c 4 Mar 2003 15:27:33 -0000 1.1.1.20
-+++ build/build.c 6 Feb 2004 08:04:09 -0000
++++ build/build.c 6 Feb 2004 15:37:57 -0000 1.4
@@ -242,7 +273,9 @@
exit:
@@ -398,7 +398,7 @@
+---------------------------------------------------------------------------
Index: build/build.c
--- build/build.c 4 Mar 2003 15:27:33 -0000 1.1.1.20
-+++ build/build.c 6 Feb 2004 08:04:09 -0000
++++ build/build.c 6 Feb 2004 15:37:57 -0000 1.4
@@ -338,6 +377,21 @@
if (what & RPMBUILD_RMSPEC)
(void) Unlink(spec->specFile);
@@ -427,7 +427,7 @@
+---------------------------------------------------------------------------
Index: build/files.c
--- build/files.c 4 Mar 2003 17:04:13 -0000 1.1.1.20
-+++ build/files.c 29 Jan 2004 19:32:17 -0000
++++ build/files.c 6 Feb 2004 15:37:57 -0000 1.3
@@ -1971,6 +1971,7 @@
fl.defSpecdFlags = 0;
@@ -451,7 +451,7 @@
+---------------------------------------------------------------------------
Index: build/files.c
--- build/files.c 4 Mar 2003 17:04:13 -0000 1.1.1.20
-+++ build/files.c 29 Jan 2004 19:32:17 -0000
++++ build/files.c 6 Feb 2004 15:37:57 -0000 1.3
@@ -2183,6 +2185,12 @@
case RPMTAG_CHANGELOGTEXT:
case RPMTAG_URL:
@@ -473,7 +473,7 @@
+---------------------------------------------------------------------------
Index: build/files.c
--- build/files.c 4 Mar 2003 17:04:13 -0000 1.1.1.20
-+++ build/files.c 29 Jan 2004 19:32:17 -0000
++++ build/files.c 6 Feb 2004 15:37:57 -0000 1.3
@@ -2253,8 +2261,20 @@
}
@@ -524,7 +524,7 @@
+---------------------------------------------------------------------------
Index: build/parsePreamble.c
--- build/parsePreamble.c 3 Mar 2003 20:46:34 -0000 1.1.1.13
-+++ build/parsePreamble.c 29 Jan 2004 19:34:11 -0000
++++ build/parsePreamble.c 6 Feb 2004 15:37:58 -0000 1.3
@@ -366,7 +368,15 @@
size_t nb, iconsize;
@@ -548,6 +548,8 @@
| Instead we expand a variable to allow us to direct RPM to our tools.
| Additionally, pass option "-b" to patch(1) so it creates original
| files not only if a non-standard (not ".orig") suffix is used.
+| Finally, add support for the GNU patch "-d" option for convinient
+| changing into a subdirectory.
| Remove "unzip" support, because in OpenPKG there are less than
| a dozend packages requiring unpacking of .zip files. For these
| it is fully sufficient to explicitly require the "infozip"
@@ -556,7 +558,16 @@
+---------------------------------------------------------------------------
Index: build/parsePrep.c
--- build/parsePrep.c 7 Aug 2002 14:20:45 -0000 1.1.1.10
-+++ build/parsePrep.c 22 Jan 2004 21:42:14 -0000 1.2
++++ build/parsePrep.c 12 Feb 2004 16:29:32 -0000
+@@ -66,7 +66,7 @@
+ */
+ /[EMAIL PROTECTED]@*/
+ /[EMAIL PROTECTED]@*/ static char *doPatch(Spec spec, int c, int strip, const char
*db,
+- int reverse, int removeEmpties)
++ int reverse, int removeEmpties, const char *subdir)
+ /[EMAIL PROTECTED] rpmGlobalMacroContext, fileSystem, internalState @*/
+ /[EMAIL PROTECTED] rpmGlobalMacroContext, fileSystem, internalState @*/
+ {
@@ -76,6 +76,7 @@
struct Source *sp;
rpmCompressedMagic compressed = COMPRESSED_NOT;
@@ -565,7 +576,18 @@
for (sp = spec->sources; sp != NULL; sp = sp->next) {
if ((sp->flags & RPMBUILD_ISPATCH) && (sp->num == c)) {
-@@ -124,6 +133,10 @@
+@@ -97,6 +106,10 @@
+ strcat(args, "--suffix ");
+ strcat(args, db);
+ }
++ if (subdir) {
++ strcat(args, "-d ");
++ strcat(args, subdir);
++ }
+ if (reverse) {
+ strcat(args, " -R");
+ }
+@@ -124,6 +137,10 @@
/[EMAIL PROTECTED]@*/ break;
}
@@ -576,7 +598,7 @@
if (compressed) {
const char *zipper = rpmGetPath(
(compressed == COMPRESSED_BZIP2 ? "%{_bzip2bin}" : "%{_gzipbin}"),
-@@ -131,22 +144,23 @@
+@@ -131,22 +148,23 @@
sprintf(buf,
"echo \"Patch #%d (%s):\"\n"
@@ -604,7 +626,7 @@
urlfn = _free(urlfn);
return buf;
}
-@@ -171,6 +185,7 @@
+@@ -171,6 +189,7 @@
struct Source *sp;
rpmCompressedMagic compressed = COMPRESSED_NOT;
int urltype;
@@ -612,7 +634,7 @@
for (sp = spec->sources; sp != NULL; sp = sp->next) {
if ((sp->flags & RPMBUILD_ISSOURCE) && (sp->num == c)) {
-@@ -228,6 +251,10 @@
+@@ -228,6 +255,10 @@
/[EMAIL PROTECTED]@*/ break;
}
@@ -623,7 +645,7 @@
if (compressed != COMPRESSED_NOT) {
const char *zipper;
int needtar = 1;
-@@ -240,6 +267,7 @@
+@@ -240,6 +271,7 @@
case COMPRESSED_BZIP2:
t = "%{_bzip2bin} -dc";
break;
@@ -631,7 +653,7 @@
case COMPRESSED_ZIP:
if (rpmIsVerbose() && !quietly)
t = "%{_unzipbin}";
-@@ -247,6 +275,7 @@
+@@ -247,6 +279,7 @@
t = "%{_unzipbin} -qq";
needtar = 0;
break;
@@ -639,7 +661,7 @@
}
zipper = rpmGetPath(t, NULL);
buf[0] = '\0';
-@@ -254,8 +283,13 @@
+@@ -254,8 +287,13 @@
zipper = _free(zipper);
*t++ = ' ';
t = stpcpy(t, fn);
@@ -655,7 +677,7 @@
t = stpcpy(t,
"\n"
"STATUS=$?\n"
-@@ -264,11 +298,14 @@
+@@ -264,11 +302,14 @@
"fi");
} else {
buf[0] = '\0';
@@ -672,6 +694,56 @@
urlfn = _free(urlfn);
return buf;
}
+@@ -443,7 +484,7 @@
+ /[EMAIL PROTECTED] spec->prep, rpmGlobalMacroContext,
+ fileSystem, internalState @*/
+ {
+- char *opt_b;
++ char *opt_b, *opt_d;
+ int opt_P, opt_p, opt_R, opt_E;
+ char *s;
+ char buf[BUFSIZ], *bp;
+@@ -453,6 +494,7 @@
+ memset(patch_nums, 0, sizeof(patch_nums));
+ opt_P = opt_p = opt_R = opt_E = 0;
+ opt_b = NULL;
++ opt_d = NULL;
+ patch_index = 0;
+
+ if (! strchr(" \t\n", line[6])) {
+@@ -492,6 +534,15 @@
+ spec->lineNum, spec->line);
+ return RPMERR_BADSPEC;
+ }
++ } else if (!strcmp(s, "-d")) {
++ /* orig suffix */
++ opt_d = strtok(NULL, " \t\n");
++ if (! opt_d) {
++ rpmError(RPMERR_BADSPEC,
++ _("line %d: Need arg to %%patch -d: %s\n"),
++ spec->lineNum, spec->line);
++ return RPMERR_BADSPEC;
++ }
+ } else if (!strncmp(s, "-p", sizeof("-p")-1)) {
+ /* unfortunately, we must support -pX */
+ if (! strchr(" \t\n", s[2])) {
+@@ -530,14 +581,14 @@
+ /* All args processed */
+
+ if (! opt_P) {
+- s = doPatch(spec, 0, opt_p, opt_b, opt_R, opt_E);
++ s = doPatch(spec, 0, opt_p, opt_b, opt_R, opt_E, opt_d);
+ if (s == NULL)
+ return RPMERR_BADSPEC;
+ appendLineStringBuf(spec->prep, s);
+ }
+
+ for (x = 0; x < patch_index; x++) {
+- s = doPatch(spec, patch_nums[x], opt_p, opt_b, opt_R, opt_E);
++ s = doPatch(spec, patch_nums[x], opt_p, opt_b, opt_R, opt_E, opt_d);
+ if (s == NULL)
+ return RPMERR_BADSPEC;
+ appendLineStringBuf(spec->prep, s);
+---------------------------------------------------------------------------
| Add support for splitted source directories, i.e., source files
@@ -680,7 +752,7 @@
+---------------------------------------------------------------------------
Index: build/parsePrep.c
--- build/parsePrep.c 7 Aug 2002 14:20:45 -0000 1.1.1.10
-+++ build/parsePrep.c 22 Jan 2004 21:42:14 -0000 1.2
++++ build/parsePrep.c 12 Feb 2004 16:29:32 -0000
@@ -87,7 +88,15 @@
return NULL;
}
@@ -697,7 +769,7 @@
args[0] = '\0';
if (db) {
-@@ -182,7 +197,15 @@
+@@ -182,7 +201,15 @@
return NULL;
}
@@ -1103,8 +1175,8 @@
#/*! \page config_macros Default configuration: @RPMCONFIGDIR@/macros
# \verbatim
#
--# $Id: rpm.patch.feature,v 1.45 2004/02/06 08:43:27 rse Exp $
-+# $Id: rpm.patch.feature,v 1.45 2004/02/06 08:43:27 rse Exp $
+-# $Id: rpm.patch.feature,v 1.46 2004/02/12 16:52:03 rse Exp $
++# $Id: rpm.patch.feature,v 1.46 2004/02/12 16:52:03 rse Exp $
#
# This is a global RPM configuration file. All changes made here will
# be lost when the rpm package is upgraded. Any per-system configuration
@@ -1512,7 +1584,7 @@
+---------------------------------------------------------------------------
Index: rpmqv.c
--- rpmqv.c 4 Mar 2003 15:32:57 -0000 1.1.1.8
-+++ rpmqv.c 6 Feb 2004 08:32:07 -0000
++++ rpmqv.c 6 Feb 2004 15:37:56 -0000 1.4
@@ -682,6 +682,10 @@
case 'b':
ba->buildAmount |= RPMBUILD_PACKAGEBINARY;
@@ -1647,7 +1719,7 @@
+---------------------------------------------------------------------------
Index: rpmqv.c
--- rpmqv.c 4 Mar 2003 15:32:57 -0000 1.1.1.8
-+++ rpmqv.c 6 Feb 2004 08:32:07 -0000
++++ rpmqv.c 6 Feb 2004 15:37:56 -0000 1.4
@@ -126,7 +126,7 @@
/[EMAIL PROTECTED] rpmEVR, fileSystem @*/
/[EMAIL PROTECTED] *fp, fileSystem @*/
@@ -1666,7 +1738,7 @@
+---------------------------------------------------------------------------
Index: rpmqv.c
--- rpmqv.c 4 Mar 2003 15:32:57 -0000 1.1.1.8
-+++ rpmqv.c 6 Feb 2004 08:32:07 -0000
++++ rpmqv.c 6 Feb 2004 15:37:56 -0000 1.4
@@ -703,7 +707,19 @@
/[EMAIL PROTECTED]@*/ break;
case 's':
@@ -2020,7 +2092,7 @@
+---------------------------------------------------------------------------
Index: build/parsePreamble.c
--- build/parsePreamble.c 3 Mar 2003 20:46:34 -0000 1.1.1.13
-+++ build/parsePreamble.c 29 Jan 2004 19:34:11 -0000
++++ build/parsePreamble.c 6 Feb 2004 15:37:58 -0000 1.3
@@ -21,6 +21,7 @@
RPMTAG_LICENSE,
RPMTAG_PACKAGER,
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg/rpm.patch.porting
============================================================================
$ cvs diff -u -r1.52 -r1.53 rpm.patch.porting
--- openpkg-src/openpkg/rpm.patch.porting 6 Feb 2004 08:22:40 -0000 1.52
+++ openpkg-src/openpkg/rpm.patch.porting 12 Feb 2004 16:52:03 -0000 1.53
@@ -10,7 +10,7 @@
## 'patch' tool to upgrade those files. Each patch snippet is annotated
## with a short description.
##
-## Created on: 06-Feb-2004
+## Created on: 12-Feb-2004
##
## ATTENTION: THIS PATCH FILE WAS AUTO-GENERATED FROM AN OPENPKG
## RPM CVS REPOSITORY, HENCE DO NOT EDIT THIS FILE.
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg/rpm.patch.regen
============================================================================
$ cvs diff -u -r1.42 -r1.43 rpm.patch.regen
--- openpkg-src/openpkg/rpm.patch.regen 6 Feb 2004 08:22:40 -0000 1.42
+++ openpkg-src/openpkg/rpm.patch.regen 12 Feb 2004 16:52:03 -0000 1.43
@@ -10,7 +10,7 @@
## 'patch' tool to upgrade those files. Each patch snippet is annotated
## with a short description.
##
-## Created on: 06-Feb-2004
+## Created on: 12-Feb-2004
##
## ATTENTION: THIS PATCH FILE WAS AUTO-GENERATED FROM AN OPENPKG
## RPM CVS REPOSITORY, HENCE DO NOT EDIT THIS FILE.
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]