RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson
Root: /v/rpm/cvs Email: jbj@rpm5.org
Module: rpm Date: 20-Jul-2007 18:23:37
Branch: HEAD Handle: 2007072017233601
Modified files:
rpm CHANGES
rpm/build build.c files.c parsePreamble.c parsePrep.c
rpm/lib misc.c psm.c rpmfc.c rpminstall.c
rpm/rpmdb rpmdb.c
rpm/rpmio macro.c
Log:
- add %{?dir/file} as shorthand for %{?dir:%{dir}/file}.
Summary:
Revision Changes Path
1.1500 +1 -0 rpm/CHANGES
2.113 +1 -1 rpm/build/build.c
1.254 +1 -1 rpm/build/files.c
2.128 +1 -1 rpm/build/parsePreamble.c
2.84 +12 -12 rpm/build/parsePrep.c
2.141 +1 -1 rpm/lib/misc.c
2.211 +4 -4 rpm/lib/psm.c
1.11 +1 -1 rpm/lib/rpmfc.c
1.152 +1 -1 rpm/lib/rpminstall.c
1.136 +1 -1 rpm/rpmdb/rpmdb.c
2.126 +10 -2 rpm/rpmio/macro.c
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.1499 -r1.1500 CHANGES
--- rpm/CHANGES 20 Jul 2007 00:57:42 -0000 1.1499
+++ rpm/CHANGES 20 Jul 2007 16:23:36 -0000 1.1500
@@ -1,4 +1,5 @@
4.5 -> 5.0:
+ - jbj: add %{?dir/file} as shorthand for %{?dir:%{dir}/file}.
- jbj: fix a --import memory leak.
- rse: unbreak big-endian handling in memory and cryptography functions by Autoconf providing WORDS_BIGENDIAN and fixing usage
- rse: cleanup and fix the code to compile under *non*-GCC compilers (e.g. Sun Studio and Intel C/C++)
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/build.c
============================================================================
$ cvs diff -u -r2.112 -r2.113 build.c
--- rpm/build/build.c 24 Jun 2007 20:49:26 -0000 2.112
+++ rpm/build/build.c 20 Jul 2007 16:23:36 -0000 2.113
@@ -56,7 +56,7 @@
const char * rootURL = spec->rootURL;
const char * rootDir;
const char *scriptName = NULL;
- const char * buildDirURL = rpmGenPath(rootURL, "%{_builddir}", "");
+ const char * buildDirURL = rpmGenPath(rootURL, "%{?_builddir/}", "");
const char * buildScript;
const char * buildCmd = NULL;
const char * buildTemplate = NULL;
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/files.c
============================================================================
$ cvs diff -u -r1.253 -r1.254 files.c
--- rpm/build/files.c 17 Jul 2007 06:38:19 -0000 1.253
+++ rpm/build/files.c 20 Jul 2007 16:23:36 -0000 1.254
@@ -2172,7 +2172,7 @@
/* Init the file list structure */
memset(&fl, 0, sizeof(fl));
- fl.buildRootURL = rpmGenPath(spec->rootURL, "%{?buildroot}", NULL);
+ fl.buildRootURL = rpmGenPath(spec->rootURL, "%{?buildroot/}", NULL);
if (hge(pkg->header, RPMTAG_DEFAULTPREFIX, NULL, &fl.prefix, NULL))
fl.prefix = xstrdup(fl.prefix);
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/parsePreamble.c
============================================================================
$ cvs diff -u -r2.127 -r2.128 parsePreamble.c
--- rpm/build/parsePreamble.c 15 Jul 2007 16:32:16 -0000 2.127
+++ rpm/build/parsePreamble.c 20 Jul 2007 16:23:36 -0000 2.128
@@ -377,7 +377,7 @@
goto exit;
}
- Lurlfn = rpmGenPath(NULL, "%{_icondir}/", sp->source);
+ Lurlfn = rpmGenPath(NULL, "%{?_icondir/}", sp->source);
fn = NULL;
urltype = urlPath(Lurlfn, &fn);
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/parsePrep.c
============================================================================
$ cvs diff -u -r2.83 -r2.84 parsePrep.c
--- rpm/build/parsePrep.c 20 Jul 2007 13:02:46 -0000 2.83
+++ rpm/build/parsePrep.c 20 Jul 2007 16:23:36 -0000 2.84
@@ -90,7 +90,7 @@
taropts = ((rpmIsVerbose() && !quietly) ? "-xvvf" : "-xf");
/*@=internalglobs@*/
- Lurlfn = rpmGenPath(NULL, "%{_sourcedir}/", sp->source);
+ Lurlfn = rpmGenPath(NULL, "%{?_sourcedir/}", sp->source);
/* XXX On non-build parse's, file cannot be stat'd or read */
if (!spec->force && (isCompressed(Lurlfn, &compressed) || checkOwners(Lurlfn))) {
@@ -268,7 +268,7 @@
argv = _free(argv);
/* cd to the build dir */
- { const char * buildDirURL = rpmGenPath(spec->rootURL, "%{_builddir}", "");
+ { const char * buildDirURL = rpmGenPath(spec->rootURL, "%{?_builddir/}", "");
const char *buildDir;
(void) urlPath(buildDirURL, &buildDir);
@@ -357,7 +357,7 @@
/* XXX insure that %{_sourcedir} exists */
rpmrc = RPMRC_OK;
- Lurlfn = rpmGenPath(NULL, "%{?_sourcedir}", NULL);
+ Lurlfn = rpmGenPath(NULL, "%{?_sourcedir/}", NULL);
if (Lurlfn != NULL && *Lurlfn != '\0')
rpmrc = rpmMkdirPath(Lurlfn, "_sourcedir");
Lurlfn = _free(Lurlfn);
@@ -366,7 +366,7 @@
/* XXX insure that %{_patchdir} exists */
rpmrc = RPMRC_OK;
- Lurlfn = rpmGenPath(NULL, "%{?_patchdir}", NULL);
+ Lurlfn = rpmGenPath(NULL, "%{?_patchdir/}", NULL);
if (Lurlfn != NULL && *Lurlfn != '\0')
rpmrc = rpmMkdirPath(Lurlfn, "_patchdir");
Lurlfn = _free(Lurlfn);
@@ -375,7 +375,7 @@
/* XXX insure that %{_icondir} exists */
rpmrc = RPMRC_OK;
- Lurlfn = rpmGenPath(NULL, "%{?_icondir}", NULL);
+ Lurlfn = rpmGenPath(NULL, "%{?_icondir/}", NULL);
if (Lurlfn != NULL && *Lurlfn != '\0')
rpmrc = rpmMkdirPath(Lurlfn, "_icondir");
Lurlfn = _free(Lurlfn);
@@ -387,16 +387,16 @@
for (sp = spec->sources; sp != NULL; sp = sp->next) {
if (sp->flags & RPMFILE_SOURCE) {
- Rmacro = "%{?_Rsourcedir}/";
- Lmacro = "%{?_sourcedir}/";
+ Rmacro = "%{?_Rsourcedir/}";
+ Lmacro = "%{?_sourcedir/}";
} else
if (sp->flags & RPMFILE_PATCH) {
- Rmacro = "%{?_Rpatchdir}/";
- Lmacro = "%{?_patchdir}/";
+ Rmacro = "%{?_Rpatchdir/}";
+ Lmacro = "%{?_patchdir/}";
} else
if (sp->flags & RPMFILE_ICON) {
- Rmacro = "%{?_Ricondir}/";
- Lmacro = "%{?_icondir}/";
+ Rmacro = "%{?_Ricondir/}";
+ Lmacro = "%{?_icondir/}";
} else
continue;
@@ -413,7 +413,7 @@
}
Rurlfn = rpmGenPath(NULL, Rmacro, sp->source);
- if (Rurlfn == NULL || Rurlfn[0] == '\0' || !strcmp(Rurlfn, "/") || !strcmp(Lurlfn, Rurlfn)) {
+ if (Rurlfn == NULL || Rurlfn[0] == '\0' || !strcmp(Lurlfn, Rurlfn)) {
rpmError(RPMERR_BADFILENAME, _("file %s missing: %s\n"),
Lurlfn, strerror(errno));
ec++;
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/misc.c
============================================================================
$ cvs diff -u -r2.140 -r2.141 misc.c
--- rpm/lib/misc.c 16 Jul 2007 01:32:28 -0000 2.140
+++ rpm/lib/misc.c 20 Jul 2007 16:23:36 -0000 2.141
@@ -117,7 +117,7 @@
int makeTempFile(const char * prefix, const char ** fnptr, void * fdptr)
{
- const char * tpmacro = "%{?_tmppath:%{_tmppath}}%{!?_tmppath:/var/tmp}";
+ const char * tpmacro = "%{?_tmppath/}%{!?_tmppath:/var/tmp/}";
const char * tempfn = NULL;
const char * tfn = NULL;
static int _initialized = 0;
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/psm.c
============================================================================
$ cvs diff -u -r2.210 -r2.211 psm.c
--- rpm/lib/psm.c 19 Jul 2007 06:14:54 -0000 2.210
+++ rpm/lib/psm.c 20 Jul 2007 16:23:36 -0000 2.211
@@ -275,7 +275,7 @@
}
}
- _sourcedir = rpmGenPath(rpmtsRootDir(ts), "%{_sourcedir}", "");
+ _sourcedir = rpmGenPath(rpmtsRootDir(ts), "%{?_sourcedir/}", "");
rpmrc = rpmMkdirPath(_sourcedir, "sourcedir");
if (rpmrc) {
rpmrc = RPMRC_FAIL;
@@ -288,7 +288,7 @@
goto exit;
}
- _specdir = rpmGenPath(rpmtsRootDir(ts), "%{_specdir}", "");
+ _specdir = rpmGenPath(rpmtsRootDir(ts), "%{?_specdir/}", "");
rpmrc = rpmMkdirPath(_specdir, "specdir");
if (rpmrc) {
rpmrc = RPMRC_FAIL;
@@ -1691,8 +1691,8 @@
pkgbn = headerSprintf(fi->h, bfmt,
rpmTagTable, rpmHeaderFormats, NULL);
bfmt = _free(bfmt);
- psm->pkgURL = rpmGenPath("%{?_repackage_root}",
- "%{?_repackage_dir}",
+ psm->pkgURL = rpmGenPath("%{?_repackage_root/}",
+ "%{?_repackage_dir/}",
pkgbn);
pkgbn = _free(pkgbn);
(void) urlPath(psm->pkgURL, &psm->pkgfn);
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmfc.c
============================================================================
$ cvs diff -u -r1.10 -r1.11 rpmfc.c
--- rpm/lib/rpmfc.c 16 Jul 2007 01:32:28 -0000 1.10
+++ rpm/lib/rpmfc.c 20 Jul 2007 16:23:36 -0000 1.11
@@ -1511,7 +1511,7 @@
{ const char * buildRootURL;
const char * buildRoot;
- buildRootURL = rpmGenPath(spec->rootURL, "%{?buildroot}", NULL);
+ buildRootURL = rpmGenPath(spec->rootURL, "%{?buildroot/}", NULL);
(void) urlPath(buildRootURL, &buildRoot);
if (buildRoot && !strcmp(buildRoot, "/")) buildRoot = NULL;
fc->brlen = (buildRoot ? strlen(buildRoot) : 0);
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpminstall.c
============================================================================
$ cvs diff -u -r1.151 -r1.152 rpminstall.c
--- rpm/lib/rpminstall.c 17 Jul 2007 23:49:14 -0000 1.151
+++ rpm/lib/rpminstall.c 20 Jul 2007 16:23:36 -0000 1.152
@@ -442,7 +442,7 @@
#else
(void) mktemp(tfnbuf);
#endif
- tfn = rpmGenPath(rootDir, "%{_tmppath}/", tfnbuf);
+ tfn = rpmGenPath(rootDir, "%{?_tmpdir/}", tfnbuf);
}
/* XXX undefined %{name}/%{version}/%{release} here */
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/rpmdb.c
============================================================================
$ cvs diff -u -r1.135 -r1.136 rpmdb.c
--- rpm/rpmdb/rpmdb.c 15 Jul 2007 16:32:17 -0000 1.135
+++ rpm/rpmdb/rpmdb.c 20 Jul 2007 16:23:37 -0000 1.136
@@ -842,7 +842,7 @@
}
#define _DB_ROOT "/"
-#define _DB_HOME "%{?_dbpath}"
+#define _DB_HOME "%{?_dbpath/}"
#define _DB_FLAGS 0
#define _DB_MODE 0
#define _DB_PERMS 0644
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmio/macro.c
============================================================================
$ cvs diff -u -r2.125 -r2.126 macro.c
--- rpm/rpmio/macro.c 16 Jul 2007 00:33:11 -0000 2.125
+++ rpm/rpmio/macro.c 20 Jul 2007 16:23:37 -0000 2.126
@@ -1359,7 +1359,8 @@
/*@switchbreak@*/ break;
}
}
- for (fe = f; (c = *fe) && !strchr(" :}", c);)
+ /* Find end-of-expansion, handle %{foo:bar} expansions. */
+ for (fe = f; (c = *fe) && !strchr(":}", c);)
fe++;
switch (c) {
case ':':
@@ -1372,6 +1373,9 @@
default:
/*@innerbreak@*/ break;
}
+ /* Reset to end-of-macro-name span. */
+ for (fe = f; (c = *fe) && (xisalnum(c) || c == '_');)
+ fe++;
/*@switchbreak@*/ break;
}
@@ -1542,6 +1546,11 @@
if (me && me->body && *me->body) { /* Expand %{?f}/%{?f*} */
rc = expandT(mb, me->body, strlen(me->body));
}
+ /* Append %{?_foo/bar}. */
+ if (!g && se[-1] == '}' && *fe == '/') {
+ while ((c = *fe++) && fe < se)
+ SAVECHAR(mb, c);
+ }
s = se;
continue;
}
@@ -2509,7 +2518,6 @@
int x;
rpmInitMacros(NULL, rpmMacrofiles);
- rpmDumpMacroTable(NULL, NULL);
if ((fp = fopen(testfile, "r")) != NULL) {
while(rdcl(buf, sizeof(buf), fp)) {
@@ .
Received on Fri Jul 20 18:23:38 2007