diff options
author | root <devnull@localhost> | 1996-02-20 17:55:15 +0000 |
---|---|---|
committer | root <devnull@localhost> | 1996-02-20 17:55:15 +0000 |
commit | 0fe113d764c90be7ce35d2c682a819c720b1eb94 (patch) | |
tree | cae9be1d435b6c30d99d2d1f8632f3db29d33168 /build/pack.c | |
parent | 3e7309560893527e27e6b3a6067f0f7b1cc607eb (diff) | |
download | rpm-0fe113d764c90be7ce35d2c682a819c720b1eb94.tar.gz rpm-0fe113d764c90be7ce35d2c682a819c720b1eb94.tar.bz2 rpm-0fe113d764c90be7ce35d2c682a819c720b1eb94.zip |
add wacky subpackage version/release stuff
fix readlink non-null-termination problem
CVS patchset: 357
CVS date: 1996/02/20 17:55:15
Diffstat (limited to 'build/pack.c')
-rw-r--r-- | build/pack.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/build/pack.c b/build/pack.c index 7e17a9468..7fbbf5569 100644 --- a/build/pack.c +++ b/build/pack.c @@ -789,7 +789,7 @@ static int process_filelist(Header header, StringBuf sb, int *size, } else { strcpy(buf, fest->file); } - readlink(buf, buf, 1024); + buf[readlink(buf, buf, 1024)] = '\0'; fileLinktoList[c] = strdup(buf); } else { /* This is stupid */ @@ -894,6 +894,7 @@ int packageBinaries(Spec s, char *passPhrase) char *release; char *vendor; char *dist; + char *packageVersion, *packageRelease; int size; int_8 os, arch; @@ -927,6 +928,16 @@ int packageBinaries(Spec s, char *passPhrase) pr = pr->next; continue; } + + /* Handle subpackage version/release overrides */ + if (!getEntry(pr->header, RPMTAG_VERSION, NULL, + (void *) &packageVersion, NULL)) { + packageVersion = version; + } + if (!getEntry(pr->header, RPMTAG_RELEASE, NULL, + (void *) &packageRelease, NULL)) { + packageRelease = release; + } /* Figure out the name of this package */ if (pr->subname) { @@ -939,9 +950,9 @@ int packageBinaries(Spec s, char *passPhrase) strcpy(name, s->name); } strcat(name, "-"); - strcat(name, version); + strcat(name, packageVersion); strcat(name, "-"); - strcat(name, release); + strcat(name, packageRelease); /**** Generate the Header ****/ @@ -1003,8 +1014,8 @@ int packageBinaries(Spec s, char *passPhrase) /**** Process the file list ****/ - if (process_filelist(outHeader, pr->filelist, &size, - s->name, version, release, RPMLEAD_BINARY)) { + if (process_filelist(outHeader, pr->filelist, &size, s->name, + packageVersion, packageRelease, RPMLEAD_BINARY)) { return 1; } /* And add the final Header entry */ |