summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorroot <devnull@localhost>1996-07-14 16:38:57 +0000
committerroot <devnull@localhost>1996-07-14 16:38:57 +0000
commit6b5fe3f3fbcdfd9e114c77fe4b258721a8cf97dc (patch)
treeff5268d6933ef1d28b1376631dca3696c6a68de2 /build
parent8cc5a4021be703b916915c7341cef774459fab34 (diff)
downloadrpm-6b5fe3f3fbcdfd9e114c77fe4b258721a8cf97dc.tar.gz
rpm-6b5fe3f3fbcdfd9e114c77fe4b258721a8cf97dc.tar.bz2
rpm-6b5fe3f3fbcdfd9e114c77fe4b258721a8cf97dc.zip
allow Prefix: (DEFAULTPREFIX) for sub packages
CVS patchset: 824 CVS date: 1996/07/14 16:38:57
Diffstat (limited to 'build')
-rw-r--r--build/pack.c31
-rw-r--r--build/spec.c5
-rw-r--r--build/specP.h1
3 files changed, 16 insertions, 21 deletions
diff --git a/build/pack.c b/build/pack.c
index 16bbcdc59..c252db090 100644
--- a/build/pack.c
+++ b/build/pack.c
@@ -400,22 +400,6 @@ int packageBinaries(Spec s, char *passPhrase)
dist = getVar(RPMVAR_DISTRIBUTION);
}
- if (s->prefix) {
- prefix = s->prefix;
- while (*prefix && (*prefix == '/')) {
- prefix++;
- }
- if (! *prefix) {
- prefix = NULL;
- prefixLen = 0;
- } else {
- prefixLen = strlen(prefix);
- }
- } else {
- prefix = NULL;
- prefixLen = 0;
- }
-
/* Look through for each package */
pr = s->packages;
while (pr) {
@@ -502,6 +486,21 @@ int packageBinaries(Spec s, char *passPhrase)
/**** Process the file list ****/
+ prefix = NULL;
+ prefixLen = 0;
+ if (getEntry(outHeader, RPMTAG_DEFAULTPREFIX,
+ NULL, (void **)&prefix, NULL)) {
+ while (*prefix && (*prefix == '/')) {
+ prefix++;
+ }
+ if (! *prefix) {
+ prefix = NULL;
+ prefixLen = 0;
+ } else {
+ prefixLen = strlen(prefix);
+ }
+ }
+
if (process_filelist(outHeader, pr, pr->filelist, &size, nametmp,
packageVersion, packageRelease, RPMLEAD_BINARY,
prefix)) {
diff --git a/build/spec.c b/build/spec.c
index 22214e189..d2e96b23f 100644
--- a/build/spec.c
+++ b/build/spec.c
@@ -372,7 +372,6 @@ void freeSpec(Spec s)
FREE(s->specfile);
FREE(s->noSource);
FREE(s->noPatch);
- FREE(s->prefix);
FREE(s->buildroot);
freeSources(s);
freeStringBuf(s->prep);
@@ -801,7 +800,6 @@ Spec parseSpec(FILE *f, char *specfile, char *buildRootOverride)
spec->noPatch = NULL;
spec->numNoSource = 0;
spec->numNoPatch = 0;
- spec->prefix = NULL;
spec->buildroot = NULL;
sb = newStringBuf();
@@ -1008,7 +1006,6 @@ Spec parseSpec(FILE *f, char *specfile, char *buildRootOverride)
spec->buildroot = strdup(s);
break;
case RPMTAG_DEFAULTPREFIX:
- spec->prefix = strdup(s);
addEntry(cur_package->header, tag, STRING_TYPE, s, 1);
break;
case RPMTAG_SERIAL:
@@ -1129,7 +1126,7 @@ Spec parseSpec(FILE *f, char *specfile, char *buildRootOverride)
return NULL;
}
if (spec->buildroot) {
- /* This package can do build prefixes */
+ /* This package can do build roots */
if (buildRootOverride) {
setVar(RPMVAR_ROOT, buildRootOverride);
setVar(RPMVAR_BUILDROOT, buildRootOverride);
diff --git a/build/specP.h b/build/specP.h
index 94d2239ae..871e387e3 100644
--- a/build/specP.h
+++ b/build/specP.h
@@ -39,7 +39,6 @@ struct SpecRec {
StringBuf doc;
StringBuf clean;
- char *prefix;
char *buildroot;
struct PackageRec *packages;