diff options
Diffstat (limited to 'build')
-rwxr-xr-x[-rw-r--r--] | build/Makefile.am | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/Makefile.in | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/build.c | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/expression.c | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/files.c | 51 | ||||
-rwxr-xr-x[-rw-r--r--] | build/misc.c | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/pack.c | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/parseBuildInstallClean.c | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/parseChangelog.c | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/parseDescription.c | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/parseFiles.c | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | build/parsePolicies.c | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/parsePreamble.c | 22 | ||||
-rwxr-xr-x[-rw-r--r--] | build/parsePrep.c | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/parseReqs.c | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | build/parseScript.c | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/parseSpec.c | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/policies.c | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/reqprov.c | 10 | ||||
-rwxr-xr-x[-rw-r--r--] | build/rpmbuild.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/rpmbuild_internal.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/rpmbuild_misc.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/rpmfc.c | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | build/rpmfc.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/rpmspec.h | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | build/spec.c | 0 |
26 files changed, 107 insertions, 7 deletions
diff --git a/build/Makefile.am b/build/Makefile.am index 8e6ca8f..8e6ca8f 100644..100755 --- a/build/Makefile.am +++ b/build/Makefile.am diff --git a/build/Makefile.in b/build/Makefile.in index a2fd429..a2fd429 100644..100755 --- a/build/Makefile.in +++ b/build/Makefile.in diff --git a/build/build.c b/build/build.c index 5924ec6..5924ec6 100644..100755 --- a/build/build.c +++ b/build/build.c diff --git a/build/expression.c b/build/expression.c index 7217290..7217290 100644..100755 --- a/build/expression.c +++ b/build/expression.c diff --git a/build/files.c b/build/files.c index b4b893a..05530ca 100644..100755 --- a/build/files.c +++ b/build/files.c @@ -845,6 +845,7 @@ static rpmRC parseForSimple(rpmSpec spec, Package pkg, char * buf, char *s, *t; rpmRC res; char *specialDocBuf = NULL; + char *specialLicenseBuf = NULL; *fileName = NULL; res = RPMRC_OK; @@ -893,6 +894,8 @@ static rpmRC parseForSimple(rpmSpec spec, Package pkg, char * buf, if (*s != '/') { if (fl->currentFlags & RPMFILE_DOC) { rstrscat(&specialDocBuf, " ", s, NULL); + } else if (fl->currentFlags & RPMFILE_LICENSE) { + rstrscat(&specialLicenseBuf, " ", s, NULL); } else if (fl->currentFlags & RPMFILE_PUBKEY) { @@ -935,6 +938,34 @@ static rpmRC parseForSimple(rpmSpec spec, Package pkg, char * buf, } free(specialDocBuf); } + if (specialLicenseBuf) { + if (*fileName || (fl->currentFlags & ~(RPMFILE_LICENSE))) { + rpmlog(RPMLOG_ERR, + _("Can't mix special %%license with other forms: %s\n"), + (*fileName ? *fileName : "")); + res = RPMRC_FAIL; + } else { + /* XXX FIXME: this is easy to do as macro expansion */ + if (! fl->passedSpecialDoc) { + char *mkdocdir = rpmExpand("%{__mkdir_p} $DOCDIR", NULL); + pkg->specialDoc = newStringBuf(); + appendStringBuf(pkg->specialDoc, "DOCDIR=$RPM_BUILD_ROOT"); + appendLineStringBuf(pkg->specialDoc, pkg->specialDocDir); + appendLineStringBuf(pkg->specialDoc, "export DOCDIR"); + appendLineStringBuf(pkg->specialDoc, mkdocdir); + free(mkdocdir); + + *fileName = pkg->specialDocDir; + fl->passedSpecialDoc = 1; + fl->isSpecialDoc = 1; + } + + appendStringBuf(pkg->specialDoc, "cp -pr "); + appendStringBuf(pkg->specialDoc, specialLicenseBuf); + appendLineStringBuf(pkg->specialDoc, " $DOCDIR"); + } + free(specialLicenseBuf); + } if (res != RPMRC_OK) { fl->processingFailed = 1; @@ -1326,13 +1357,23 @@ static rpmRC recurseDir(FileList fl, const char * diskPath); static rpmRC addFile(FileList fl, const char * diskPath, struct stat * statp) { - const char *cpioPath = diskPath; + size_t plen = strlen(diskPath); + char buf[plen + 1]; + const char *cpioPath; struct stat statbuf; mode_t fileMode; uid_t fileUid; gid_t fileGid; const char *fileUname; const char *fileGname; + + /* Strip trailing slash. The special case of '/' path is handled below. */ + if (plen > 0 && diskPath[plen - 1] == '/') { + diskPath = strcpy(buf, diskPath); + buf[plen - 1] = '\0'; + } + cpioPath = diskPath; + /* Path may have prepended buildRoot, so locate the original filename. */ /* @@ -1394,8 +1435,8 @@ static rpmRC addFile(FileList fl, const char * diskPath, } } - if ((! fl->isDir) && S_ISDIR(statp->st_mode)) { -/* FIX: fl->buildRoot may be NULL */ + /* Don't recurse into explicit %dir, don't double-recurse from fts */ + if ((fl->isDir != 1) && (statp == &statbuf) && S_ISDIR(statp->st_mode)) { return recurseDir(fl, diskPath); } @@ -1529,8 +1570,6 @@ static rpmRC recurseDir(FileList fl, const char * diskPath) int myFtsOpts = (FTS_COMFOLLOW | FTS_NOCHDIR | FTS_PHYSICAL); rpmRC rc = RPMRC_FAIL; - fl->isDir = 1; /* Keep it from following myftw() again */ - ftsSet[0] = (char *) diskPath; ftsSet[1] = NULL; ftsp = Fts_open(ftsSet, myFtsOpts, NULL); @@ -1563,8 +1602,6 @@ static rpmRC recurseDir(FileList fl, const char * diskPath) } (void) Fts_close(ftsp); - fl->isDir = 0; - return rc; } diff --git a/build/misc.c b/build/misc.c index 06fd110..06fd110 100644..100755 --- a/build/misc.c +++ b/build/misc.c diff --git a/build/pack.c b/build/pack.c index 981a03e..981a03e 100644..100755 --- a/build/pack.c +++ b/build/pack.c diff --git a/build/parseBuildInstallClean.c b/build/parseBuildInstallClean.c index 6386c23..6386c23 100644..100755 --- a/build/parseBuildInstallClean.c +++ b/build/parseBuildInstallClean.c diff --git a/build/parseChangelog.c b/build/parseChangelog.c index d4681cb..d4681cb 100644..100755 --- a/build/parseChangelog.c +++ b/build/parseChangelog.c diff --git a/build/parseDescription.c b/build/parseDescription.c index f233d8d..f233d8d 100644..100755 --- a/build/parseDescription.c +++ b/build/parseDescription.c diff --git a/build/parseFiles.c b/build/parseFiles.c index 7c51c3a..5894074 100644..100755 --- a/build/parseFiles.c +++ b/build/parseFiles.c @@ -26,6 +26,9 @@ int parseFiles(rpmSpec spec) { 0, 0, 0, 0, 0, NULL, NULL} }; + /* XXX unmask %license while parsing %files */ + addMacro(spec->macros, "license", NULL, "%%license", RMIL_SPEC); + if ((rc = poptParseArgvString(spec->line, &argc, &argv))) { rpmlog(RPMLOG_ERR, _("line %d: Error parsing %%files: %s\n"), spec->lineNum, poptStrerror(rc)); diff --git a/build/parsePolicies.c b/build/parsePolicies.c index 2abc00c..2abc00c 100644..100755 --- a/build/parsePolicies.c +++ b/build/parsePolicies.c diff --git a/build/parsePreamble.c b/build/parsePreamble.c index e8e3133..9c5dabb 100644..100755 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -310,6 +310,8 @@ static struct tokenBits_s const installScriptBits[] = { { "verify", RPMSENSE_SCRIPT_VERIFY }, { "pretrans", RPMSENSE_PRETRANS }, { "posttrans", RPMSENSE_POSTTRANS }, + { "hint", RPMSENSE_MISSINGOK }, + { "strong", RPMSENSE_STRONG }, { NULL, 0 } }; @@ -786,6 +788,18 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag, if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags))) return rc; break; + case RPMTAG_SUGGESTSFLAGS: + case RPMTAG_ENHANCESFLAGS: + case RPMTAG_BUILDSUGGESTS: + case RPMTAG_BUILDENHANCES: + tagflags = RPMSENSE_MISSINGOK; + if (macro && (!strcmp(macro, "recommends") || !strcmp(macro, "buildrecommends"))) + tagflags |= RPMSENSE_STRONG; + if (macro && (!strcmp(macro, "supplements") || !strcmp(macro, "buildsupplements"))) + tagflags |= RPMSENSE_STRONG; + if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags))) + return rc; + break; case RPMTAG_EXCLUDEARCH: case RPMTAG_EXCLUSIVEARCH: case RPMTAG_EXCLUDEOS: @@ -891,6 +905,14 @@ static struct PreambleRec_s const preambleList[] = { {RPMTAG_BUGURL, 0, 0, LEN_AND_STR("bugurl")}, {RPMTAG_COLLECTIONS, 0, 0, LEN_AND_STR("collections")}, {RPMTAG_ORDERFLAGS, 2, 0, LEN_AND_STR("orderwithrequires")}, + {RPMTAG_SUGGESTSFLAGS, 0, 0, LEN_AND_STR("recommends")}, + {RPMTAG_SUGGESTSFLAGS, 0, 0, LEN_AND_STR("suggests")}, + {RPMTAG_ENHANCESFLAGS, 0, 0, LEN_AND_STR("supplements")}, + {RPMTAG_ENHANCESFLAGS, 0, 0, LEN_AND_STR("enhances")}, + {RPMTAG_BUILDSUGGESTS, 0, 0, LEN_AND_STR("buildrecommends")}, + {RPMTAG_BUILDSUGGESTS, 0, 0, LEN_AND_STR("buildsuggests")}, + {RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildsupplements")}, + {RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildenhances")}, {0, 0, 0, 0} }; diff --git a/build/parsePrep.c b/build/parsePrep.c index 3dab37f..3dab37f 100644..100755 --- a/build/parsePrep.c +++ b/build/parsePrep.c diff --git a/build/parseReqs.c b/build/parseReqs.c index de2680c..a8d5027 100644..100755 --- a/build/parseReqs.c +++ b/build/parseReqs.c @@ -95,6 +95,20 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTagVal tagN, nametag = RPMTAG_CONFLICTNAME; h = spec->buildRestrictions; break; + case RPMTAG_SUGGESTSFLAGS: + nametag = RPMTAG_SUGGESTSNAME; + break; + case RPMTAG_ENHANCESFLAGS: + nametag = RPMTAG_ENHANCESNAME; + break; + case RPMTAG_BUILDSUGGESTS: + nametag = RPMTAG_SUGGESTSNAME; + h = spec->buildRestrictions; + break; + case RPMTAG_BUILDENHANCES: + nametag = RPMTAG_ENHANCESNAME; + h = spec->buildRestrictions; + break; } for (r = field; *r != '\0'; r = re) { diff --git a/build/parseScript.c b/build/parseScript.c index 87b3d58..87b3d58 100644..100755 --- a/build/parseScript.c +++ b/build/parseScript.c diff --git a/build/parseSpec.c b/build/parseSpec.c index 01620bd..01620bd 100644..100755 --- a/build/parseSpec.c +++ b/build/parseSpec.c diff --git a/build/policies.c b/build/policies.c index f8bb0c4..f8bb0c4 100644..100755 --- a/build/policies.c +++ b/build/policies.c diff --git a/build/reqprov.c b/build/reqprov.c index f2cdb5c..bc2f7ea 100644..100755 --- a/build/reqprov.c +++ b/build/reqprov.c @@ -75,6 +75,16 @@ int addReqProv(Header h, rpmTagVal tagN, indextag = RPMTAG_TRIGGERINDEX; extra = Flags & RPMSENSE_TRIGGER; break; + case RPMTAG_SUGGESTSNAME: + versiontag = RPMTAG_SUGGESTSVERSION; + flagtag = RPMTAG_SUGGESTSFLAGS; + extra = Flags & _ALL_REQUIRES_MASK; + break; + case RPMTAG_ENHANCESNAME: + versiontag = RPMTAG_ENHANCESVERSION; + flagtag = RPMTAG_ENHANCESFLAGS; + extra = Flags & _ALL_REQUIRES_MASK; + break; case RPMTAG_REQUIRENAME: default: tagN = RPMTAG_REQUIRENAME; diff --git a/build/rpmbuild.h b/build/rpmbuild.h index 51a735d..51a735d 100644..100755 --- a/build/rpmbuild.h +++ b/build/rpmbuild.h diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h index 5f963a3..5f963a3 100644..100755 --- a/build/rpmbuild_internal.h +++ b/build/rpmbuild_internal.h diff --git a/build/rpmbuild_misc.h b/build/rpmbuild_misc.h index 9665c97..9665c97 100644..100755 --- a/build/rpmbuild_misc.h +++ b/build/rpmbuild_misc.h diff --git a/build/rpmfc.c b/build/rpmfc.c index a779b6a..5f41b8a 100644..100755 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -1102,6 +1102,12 @@ static struct DepMsg_s depMsgs[] = { { "Obsoletes", { "%{?__find_obsoletes}", NULL, NULL, NULL }, RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_OBSOLETEFLAGS, 0, -1 }, + { "Enhances", { "%{?__find_enhances}", NULL, NULL, NULL }, + RPMTAG_ENHANCESNAME, RPMTAG_ENHANCESVERSION, RPMTAG_ENHANCESFLAGS, + RPMSENSE_STRONG, RPMSENSE_STRONG }, + { "Supplements", { "%{?__find_supplements}", NULL, NULL, NULL }, + RPMTAG_ENHANCESNAME, RPMTAG_ENHANCESVERSION, RPMTAG_ENHANCESFLAGS, + RPMSENSE_STRONG, 0 }, { NULL, { NULL, NULL, NULL, NULL }, 0, 0, 0, 0, 0 } }; @@ -1187,6 +1193,14 @@ static rpmRC rpmfcGenerateDependsHelper(const rpmSpec spec, Package pkg, rpmfi f failnonzero = 0; tagflags = RPMSENSE_FIND_REQUIRES; break; + case RPMTAG_ENHANCESFLAGS: + if (!pkg->autoProv) + continue; + failnonzero = 0; + tagflags = RPMSENSE_FIND_REQUIRES | RPMSENSE_MISSINGOK; + if (strcmp(dm->msg, "Supplements") == 0) + tagflags |= RPMSENSE_STRONG; + break; default: continue; break; diff --git a/build/rpmfc.h b/build/rpmfc.h index f3d3e66..f3d3e66 100644..100755 --- a/build/rpmfc.h +++ b/build/rpmfc.h diff --git a/build/rpmspec.h b/build/rpmspec.h index 195fc72..195fc72 100644..100755 --- a/build/rpmspec.h +++ b/build/rpmspec.h diff --git a/build/spec.c b/build/spec.c index a4a321f..a4a321f 100644..100755 --- a/build/spec.c +++ b/build/spec.c |