From 0fe113d764c90be7ce35d2c682a819c720b1eb94 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 20 Feb 1996 17:55:15 +0000 Subject: [PATCH] add wacky subpackage version/release stuff fix readlink non-null-termination problem CVS patchset: 357 CVS date: 1996/02/20 17:55:15 --- build/pack.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/build/pack.c b/build/pack.c index 7e17a94..7fbbf55 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 */ -- 2.7.4