summaryrefslogtreecommitdiff
path: root/build/pack.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1998-09-05 21:54:05 +0000
committerjbj <devnull@localhost>1998-09-05 21:54:05 +0000
commit5973a1a52d424f1e40e944560c1bbe86064a6f4a (patch)
treea2d639db1053e9569c5ff59e80d5e7f5a503a401 /build/pack.c
parent2e89e42535225624e56732a9a3c784bfa87e11cb (diff)
downloadlibrpm-tizen-5973a1a52d424f1e40e944560c1bbe86064a6f4a.tar.gz
librpm-tizen-5973a1a52d424f1e40e944560c1bbe86064a6f4a.tar.bz2
librpm-tizen-5973a1a52d424f1e40e944560c1bbe86064a6f4a.zip
More RPMVAR_* conversion to macros.
CVS patchset: 2281 CVS date: 1998/09/05 21:54:05
Diffstat (limited to 'build/pack.c')
-rw-r--r--build/pack.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/build/pack.c b/build/pack.c
index b471e6cba..04ee02d19 100644
--- a/build/pack.c
+++ b/build/pack.c
@@ -57,7 +57,11 @@ int packageSources(Spec spec)
RPM_INT32_TYPE, getBuildTime(), 1);
genSourceRpmName(spec);
- sprintf(fileName, "%s/%s", rpmGetVar(RPMVAR_SRPMDIR), spec->sourceRpmName);
+
+ /* XXX this should be %_srpmdir */
+ strcpy(fileName, "%{_srcrpmdir}/");
+ expandMacros(spec, spec->macros, fileName, sizeof(fileName));
+ strcat(fileName, spec->sourceRpmName);
/* Add the build restrictions */
iter = headerInitIterator(spec->buildRestrictions);
@@ -100,16 +104,13 @@ int packageBinaries(Spec spec)
char *name, fileName[BUFSIZ];
Package pkg;
- pkg = spec->packages;
- while (pkg) {
- if (!pkg->fileList) {
- pkg = pkg->next;
+ for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
+
+ if (!pkg->fileList)
continue;
- }
- if ((rc = processScriptFiles(spec, pkg))) {
+ if ((rc = processScriptFiles(spec, pkg)))
return rc;
- }
if (spec->cookie) {
headerAddEntry(pkg->header, RPMTAG_COOKIE,
@@ -133,14 +134,17 @@ int packageBinaries(Spec spec)
binFormat = rpmGetVar(RPMVAR_RPMFILENAME);
binRpm = headerSprintf(pkg->header, binFormat, rpmTagTable,
rpmHeaderFormats, &errorString);
- if (!binRpm) {
+ if (binRpm == NULL) {
headerGetEntry(pkg->header, RPMTAG_NAME, NULL,
(void **)&name, NULL);
rpmError(RPMERR_BADFILENAME, "Could not generate output "
"filename for package %s: %s\n", name, errorString);
return RPMERR_BADFILENAME;
}
- sprintf(fileName, "%s/%s", rpmGetVar(RPMVAR_RPMDIR), binRpm);
+ strcpy(fileName, "%{_rpmdir}/");
+ expandMacros(spec, spec->macros, fileName, sizeof(fileName));
+ strcat(fileName, binRpm);
+
FREE(binRpm);
memset(csa, 0, sizeof(*csa));
@@ -153,8 +157,6 @@ int packageBinaries(Spec spec)
csa, spec->passPhrase, NULL))) {
return rc;
}
-
- pkg = pkg->next;
}
return 0;