} else {
strcpy(buf, fest->file);
}
- readlink(buf, buf, 1024);
+ buf[readlink(buf, buf, 1024)] = '\0';
fileLinktoList[c] = strdup(buf);
} else {
/* This is stupid */
char *release;
char *vendor;
char *dist;
+ char *packageVersion, *packageRelease;
int size;
int_8 os, arch;
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) {
strcpy(name, s->name);
}
strcat(name, "-");
- strcat(name, version);
+ strcat(name, packageVersion);
strcat(name, "-");
- strcat(name, release);
+ strcat(name, packageRelease);
/**** Generate the Header ****/
/**** 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 */