diff options
author | ewt <devnull@localhost> | 1997-06-01 22:59:24 +0000 |
---|---|---|
committer | ewt <devnull@localhost> | 1997-06-01 22:59:24 +0000 |
commit | 9b92c41eac934f5e95e44c8c9e35a7eb1898a44d (patch) | |
tree | 5f5be8d9d507aace11aa22bf6f0f155a8064ddbe | |
parent | c5dcacd20144babd52181ea9bb34aa82f895b828 (diff) | |
download | librpm-tizen-9b92c41eac934f5e95e44c8c9e35a7eb1898a44d.tar.gz librpm-tizen-9b92c41eac934f5e95e44c8c9e35a7eb1898a44d.tar.bz2 librpm-tizen-9b92c41eac934f5e95e44c8c9e35a7eb1898a44d.zip |
Added rpmfilename tag to to rpmrc and made use of it during package builds
CVS patchset: 1675
CVS date: 1997/06/01 22:59:24
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | build/pack.c | 17 | ||||
-rw-r--r-- | lib-rpmrc.in | 1 | ||||
-rw-r--r-- | lib/rpmlib.h | 4 | ||||
-rw-r--r-- | lib/rpmrc.c | 1 | ||||
-rw-r--r-- | misc/miscfn.h | 2 |
6 files changed, 22 insertions, 5 deletions
@@ -2,6 +2,8 @@ - completely rewrote queryformat code - added fsnames, fssizes virtual query tags - added rpmdbFindByHeader() and rpmdbFindByTag() public functions + - added rpmfilename tag to rpmrc to define the filename format to + use for binary packages (note the rpmdir is prepended to it) 2.4 -> 2.4.1: - take advantage of lchown() if it's available diff --git a/build/pack.c b/build/pack.c index 607764be7..25791c167 100644 --- a/build/pack.c +++ b/build/pack.c @@ -383,6 +383,7 @@ int packageBinaries(Spec s, char *passPhrase, int doPackage) char *nametmp; char filename[1024]; char sourcerpm[1024]; + char * binrpm; char *icon; int iconFD; struct stat statbuf; @@ -398,6 +399,7 @@ int packageBinaries(Spec s, char *passPhrase, int doPackage) char *packager; char *packageVersion, *packageRelease; char *prefix, *prefixSave; + char * binformat, * errorString; int prefixLen; int size; StringBuf cpioFileList; @@ -419,7 +421,7 @@ int packageBinaries(Spec s, char *passPhrase, int doPackage) version = strdup(version); release = strdup(release); - sprintf(sourcerpm, "%s-%s-%s.%ssrc.rpm", s->name, version, release, + sprintf(sourcerpm, "%s-%s-%s.%sprc.rpm", s->name, version, release, (s->numNoPatch + s->numNoSource) ? "no" : ""); vendor = NULL; @@ -599,8 +601,17 @@ int packageBinaries(Spec s, char *passPhrase, int doPackage) /* Make the output RPM filename */ if (doPackage == PACK_PACKAGE) { - sprintf(filename, "%s/%s/%s.%s.rpm", rpmGetVar(RPMVAR_RPMDIR), - rpmGetArchName(), name, rpmGetArchName()); + binformat = rpmGetVar(RPMVAR_RPMFILENAME); + binrpm = headerSprintf(outHeader, binformat, rpmTagTable, + rpmHeaderFormats, &errorString); + + if (!binrpm) { + rpmError(RPMERR_BADFILENAME, "could not generate output " + "filename for package %s: %s\n", name, binrpm); + } + + sprintf(filename, "%s/%s", rpmGetVar(RPMVAR_RPMDIR), binrpm); + free(binrpm); if (generateRPM(name, filename, RPMLEAD_BINARY, outHeader, NULL, getStringBuf(cpioFileList), passPhrase, prefix)) { diff --git a/lib-rpmrc.in b/lib-rpmrc.in index 7cbe52052..f954ebd60 100644 --- a/lib-rpmrc.in +++ b/lib-rpmrc.in @@ -8,6 +8,7 @@ cpiobin: @CPIOBIN@ gzipbin: @GZIPBIN@ defaultdocdir: @prefix@/doc fixperms: @FIXPERMS@ +rpmfilename: %{ARCH}/%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm ############################################################# diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 9eb94e478..ccb952a80 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -190,7 +190,8 @@ extern const struct headerSprintfExtension rpmHeaderFormats[]; #define RPMVAR_DEFAULTDOCDIR 34 #define RPMVAR_FIXPERMS 35 #define RPMVAR_GZIPBIN 36 -#define RPMVAR_LASTVAR 37 /* IMPORTANT to keep right! */ +#define RPMVAR_RPMFILENAME 37 +#define RPMVAR_LASTVAR 38 /* IMPORTANT to keep right! */ char *rpmGetVar(int var); int rpmGetBooleanVar(int var); @@ -384,6 +385,7 @@ rpmErrorCallBackType rpmErrorSetCallback(rpmErrorCallBackType); #define RPMERR_GZIP -117 #define RPMERR_BADSPEC -118 #define RPMERR_LDD -119 /* couldn't understand ldd output */ +#define RPMERR_BADFILENAME -120 #define RPMERR_BADSIGTYPE -200 /* Unknown signature type */ #define RPMERR_SIGGEN -201 /* Error generating signature */ diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 85e768437..fb998b19b 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -93,6 +93,7 @@ struct rpmoption optionTable[] = { { "require_vendor", RPMVAR_REQUIREVENDOR, 0, 0 }, { "root", RPMVAR_ROOT, 0, 0 }, { "rpmdir", RPMVAR_RPMDIR, 0, 0 }, + { "rpmfilename", RPMVAR_RPMFILENAME, 0, 1 }, { "signature", RPMVAR_SIGTYPE, 0, 0 }, { "sourcedir", RPMVAR_SOURCEDIR, 0, 0 }, { "specdir", RPMVAR_SPECDIR, 0, 0 }, diff --git a/misc/miscfn.h b/misc/miscfn.h index d94a3345d..5e5e51b0d 100644 --- a/misc/miscfn.h +++ b/misc/miscfn.h @@ -67,7 +67,7 @@ extern void *myrealloc(void *, size_t); #define GETMNTENT_ONE 1 #define GETMNTENT_TWO 0 #define our_mntent struct mntent -#defeine our_mntdir mnt_dir +#define our_mntdir mnt_dir #elif HAVE_SYS_MNTTAB_H #include <stdio.h> #include <sys/mnttab.h> |