Sync with 2.5.2 branch patches.

cpio_gzip: dup the fd before doing gzdopen (Thanks Erik!)
 add --noLang to skip non-default languages.

CVS patchset: 2243
CVS date: 1998/08/11 18:24:48
This commit is contained in:
jbj 1998-08-11 18:24:48 +00:00
parent 8ff713d130
commit f612cb1bf3
18 changed files with 81 additions and 41 deletions

16
CHANGES
View File

@ -1,6 +1,7 @@
2.5.3 -> 2.9
- cpio_gzip: dup the fd before doing gzdopen (Thanks Erik!)
- add --noLang to skip non-default languages.
- writeRPM can now copy cpio archive from fd.
- add special case code for "/" in %files.
- preliminary macro environment as side effect of rpmrc parse.
- macro handling in rpmlib -- rework include: tag with macro expansion.
- first attempt at librpmbuild API.
@ -9,7 +10,6 @@
- aggregate system includes into system.h.
- rearrange functions to minimize exported routines in librpmbuild API.
- generalize cpio I/O to eliminate pipe to exec'd gzip on install.
- better query semantics with symlinks (Tim Mooney)
- finish planting /usr/lib/rpm (remove compatibility symlinks)
- build.c: fix incorrect check for successful open
- add new fully recursive macro.c
@ -17,7 +17,19 @@
- create /usr/lib/rpm directory and move rpmrc et al there
2.5.2 -> 2.5.3:
- rm .depend for multiple builds in same tree (Will Partain)
- add special case code for "/" in %files.
- better query semantics with symlinks (Tim Mooney)
- allow %define with leading whitespace
- use /usr/lib/rpm for rpmpopt, rpmrc, find-requires, find-provides
- added popt 'exec' functionality
- made --rebuilddb a bit more robust by checking data types
- added --freshen via popt exec stuff
- fixed spelling of expected
- updated de.po (Karl Eichwalder)
- do a better job of checking for a spec file in tarballs
(Pavel Roskin)
- fixed --triggers alias (Michael Andres)
2.5.1 -> 2.5.2:
- added -bs to build just a source package

View File

@ -32,7 +32,7 @@ ETCDIR=$(ROOT)/etc
SUBDIRS = popt @MISCDIR@ lib build tools @PO@
ALLSUBDIRS = popt misc lib build tools po
INSTSUBDIRS = lib @PO@
INSTSUBDIRS = lib scripts @PO@
OTHERSUBDIRS = docs autodeps
OBJS = rpm.o query.o install.o verify.o checksig.o ftp.o url.o build.o \
@GETTEXTSTUB@
@ -73,6 +73,7 @@ rpm.o: rpm.c query.h install.h lib/rpmlib.h Makefile
-DRPMNLSDIR=\"$(RPMNLSDIR)\" \
-DVERSION=\"$(VERSION)\" \
-DLIBRPMALIAS_FILENAME="\"$(LIBRPMALIAS_FILENAME)"\" \
-DRPMCONFIGDIR="\"$(RPMCONFIGDIR)"\" \
-c $(srcdir)/rpm.c
# these rules should be in here, but they drive me batty
@ -180,11 +181,13 @@ distclean:
.PHONY: depend
depend:
topdir_path=`( cd $(top_srcdir) && pwd )` ; \
/bin/rm -f .depend ; \
$(CPP) -MM $(CFLAGS) $(srcdir)/$(SOURCES) | \
sed s+$$topdir_path+$(top_srcdir)+g > .depend ; \
for d in $(ALLSUBDIRS); do \
(cd $$d; $(MAKE) $@) ;\
done
/bin/rm -f .depend-done
echo > .depend-done
.PHONY: noconfig

View File

@ -53,6 +53,7 @@ clean:
depend:
topdir_path=`( cd $(top_srcdir) && pwd )` ; \
/bin/rm -f .depend ; \
$(CPP) $(CFLAGS) -MM $(srcdir)/*.c | \
sed s+$$topdir_path+$(top_srcdir)+g > .depend

View File

@ -159,9 +159,9 @@ int writeRPM(Header header, char *fileName, int type,
Header sig;
struct rpmlead lead;
if (csa->cpioList != NULL) {
if (csa->cpioFdIn < 0) {
csa->cpioArchiveSize = 0;
/* Add the a bogus archive size to the Header */
/* Add a bogus archive size to the Header */
headerAddEntry(header, RPMTAG_ARCHIVESIZE, RPM_INT32_TYPE,
&csa->cpioArchiveSize, 1);
}
@ -197,7 +197,7 @@ int writeRPM(Header header, char *fileName, int type,
}
/* Now set the real archive size in the Header */
if (csa->cpioList != NULL) {
if (csa->cpioFdIn < 0) {
headerModifyEntry(header, RPMTAG_ARCHIVESIZE,
RPM_INT32_TYPE, &csa->cpioArchiveSize, 1);
}
@ -221,7 +221,7 @@ int writeRPM(Header header, char *fileName, int type,
headerGetEntry(header, RPMTAG_RELEASE, NULL, (void **)&release, NULL);
sprintf(buf, "%s-%s-%s", name, version, release);
if (csa->cpioList != NULL) {
if (csa->cpioFdIn < 0) {
rpmGetArchInfo(NULL, &arch);
rpmGetOsInfo(NULL, &os);
} else if (csa->lead != NULL) { /* XXX FIXME: exorcize lead/arch/os */
@ -310,7 +310,7 @@ static int cpio_gzip(int fdo, CSA_t *csa) {
char *failedFile;
cfd->cpioIoType = cpioIoTypeGzFd;
cfd->cpioGzFd = gzdopen(fdo, "w9");
cfd->cpioGzFd = gzdopen(dup(fdo), "w9");
rc = cpioBuildArchive(cfd, csa->cpioList, csa->cpioCount, NULL, NULL,
&csa->cpioArchiveSize, &failedFile);
gzclose(cfd->cpioGzFd);

View File

@ -4,6 +4,8 @@
#include "popt/popt.h"
extern int noLang; /* XXX FIXME: pass as arg */
/* These have to be global scope to make up for *stupid* compilers */
static char *name;
static char *lang;
@ -107,8 +109,10 @@ int parseDescription(Spec spec)
}
stripTrailingBlanksStringBuf(sb);
headerAddI18NString(pkg->header, RPMTAG_DESCRIPTION,
if (!(noLang && strcmp(lang, RPMBUILD_DEFAULT_LANG))) {
headerAddI18NString(pkg->header, RPMTAG_DESCRIPTION,
getStringBuf(sb), lang);
}
freeStringBuf(sb);

View File

@ -315,6 +315,8 @@ if (multiToken) { \
return RPMERR_BADSPEC; \
}
extern int noLang; /* XXX FIXME: pass as arg */
static int handlePreambleTag(Spec spec, Package pkg, int tag, char *macro,
char *lang)
{
@ -372,7 +374,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, char *macro,
case RPMTAG_PACKAGER:
if (! *lang) {
headerAddEntry(pkg->header, tag, RPM_STRING_TYPE, field, 1);
} else {
} else if (!(noLang && strcmp(lang, RPMBUILD_DEFAULT_LANG))) {
headerAddI18NString(pkg->header, tag, field, lang);
}
break;

View File

@ -244,6 +244,8 @@ void closeSpec(Spec spec)
spec->file = NULL;
}
int noLang = 0; /* XXX FIXME: pass as arg */
int parseSpec(Spec *specp, char *specFile, char *buildRoot,
int inBuildArch, char *passPhrase, char *cookie)
{

View File

@ -27,8 +27,7 @@ optflags: alpha -O2
optflags: sparc -O2
optflags: m68k -O2 -fomit-frame-pointer
optflags: ppc -O2 -fsigned-char
optflags: hppa1.0 -O2 -mpa-risc-1-0
optflags: hppa1.1 -O2 -mpa-risc-1-0
optflags: parisc -O2 -mpa-risc-1-0
optflags: mipseb -O2
optflags: mipsel -O2
optflags: arm3 -O2
@ -57,8 +56,6 @@ arch_canon: m68k: m68k 6
arch_canon: IP: sgi 7
arch_canon: rs6000: rs6000 8
arch_canon: 9000/712: hppa1.1 9
arch_canon: sun4u: usparc 10
arch_canon: mipsel: mipsel 11
@ -146,8 +143,7 @@ arch_compat: ppc: noarch
arch_compat: mipseb: noarch
arch_compat: mipsel: noarch
arch_compat: hppa1.1: hppa1.0
arch_compat: hppa1.0: noarch
arch_compat: parisc: noarch
arch_compat: arm4: arm3
arch_compat: arm3: noarch
@ -170,3 +166,4 @@ buildarch_compat: mipsel: noarch
buildarch_compat: mipseb: noarch
buildarch_compat: arm4: noarch
buildarch_compat: arm3: noarch
buildarch_compat: parisc: noarch

View File

@ -74,6 +74,7 @@ squeaky: clean
depend:
topdir_path=`( cd $(top_srcdir) && pwd )` ; \
/bin/rm -f .depend ; \
$(CPP) $(CFLAGS) -MM $(SOURCES) | \
sed s+$$topdir_path+$(top_srcdir)+g > .depend

View File

@ -925,6 +925,7 @@ int cpioBuildArchive(CFD_t *cfd, struct cpioFileMapping * mappings,
if ((rc = padoutfd(cfd, &totalsize, 4)))
return rc;
fprintf(stderr, "ARCHIVESIZE total: %d\n", totalsize);
if (archiveSize) *archiveSize = totalsize;
return 0;

View File

@ -431,6 +431,9 @@ Header headerLoad(void *pv)
entry->info.count = htonl(pe->count);
entry->info.offset = -1;
if (entry->info.type < RPM_MIN_TYPE ||
entry->info.type > RPM_MAX_TYPE) return NULL;
src = dataStart + htonl(pe->offset);
entry->length = dataLength(entry->info.type, src,
entry->info.count, 1);

View File

@ -160,6 +160,7 @@ void headerSort(Header h);
/* Entry Types */
#define RPM_MIN_TYPE 0
#define RPM_NULL_TYPE 0
#define RPM_CHAR_TYPE 1
#define RPM_INT8_TYPE 2
@ -170,6 +171,7 @@ void headerSort(Header h);
#define RPM_BIN_TYPE 7
#define RPM_STRING_ARRAY_TYPE 8
#define RPM_I18NSTRING_TYPE 9
#define RPM_MAX_TYPE 9
/* Tags -- general use tags should start at 1000 (RPM's tag space starts
there) */

View File

@ -49,28 +49,28 @@ int rpmdbRebuild(char * rootdir) {
recnum = rpmdbFirstRecNum(olddb);
while (recnum > 0) {
if (!(h = rpmdbGetRecord(olddb, recnum))) {
rpmError(RPMERR_INTERNAL, _("cannot read database record at %d"),
rpmError(RPMERR_INTERNAL,
_("record number %d in database is bad -- skipping it"),
recnum);
failed = 1;
break;
}
/* let's sanity check this record a bit, otherwise just skip it */
if (headerIsEntry(h, RPMTAG_NAME) &&
headerIsEntry(h, RPMTAG_VERSION) &&
headerIsEntry(h, RPMTAG_RELEASE) &&
headerIsEntry(h, RPMTAG_RELEASE) &&
headerIsEntry(h, RPMTAG_BUILDTIME)) {
if (rpmdbAdd(newdb, h)) {
rpmError(RPMERR_INTERNAL,
_("cannot add record originally at %d"), recnum);
failed = 1;
break;
}
} else {
rpmError(RPMERR_INTERNAL,
_("record number %d in database is bad -- skipping it"),
recnum);
/* let's sanity check this record a bit, otherwise just skip it */
if (headerIsEntry(h, RPMTAG_NAME) &&
headerIsEntry(h, RPMTAG_VERSION) &&
headerIsEntry(h, RPMTAG_RELEASE) &&
headerIsEntry(h, RPMTAG_RELEASE) &&
headerIsEntry(h, RPMTAG_BUILDTIME)) {
if (rpmdbAdd(newdb, h)) {
rpmError(RPMERR_INTERNAL,
_("cannot add record originally at %d"), recnum);
failed = 1;
break;
}
} else {
rpmError(RPMERR_INTERNAL,
_("record number %d in database is bad -- skipping it"),
recnum);
}
}
recnum = rpmdbNextRecNum(olddb, recnum);
}

View File

@ -867,6 +867,10 @@ static void defaultMachine(char ** arch, char ** os) {
# if defined(CPU_PA_RISC1_2)
if (cpu_version == CPU_PA_RISC1_2)
strcpy(un.machine, "parisc");
# endif
# if defined(CPU_PA_RISC2_0)
if (cpu_version == CPU_PA_RISC2_0)
strcpy(un.machine, "parisc");
# endif
}
# endif

View File

@ -29,6 +29,7 @@ distclean: clean
depend:
topdir_path=`( cd $(top_srcdir) && pwd )` ; \
/bin/rm -f .depend ; \
$(CPP) $(CFLAGS) -MM $(srcdir)/*.c | \
sed s+$$topdir_path+$(top_srcdir)+g > .depend

14
rpm.c
View File

@ -56,9 +56,10 @@ static int incldocs;
static int initdb;
static int justdb;
static int noDeps;
static int noOrder;
static int noFiles;
extern int noLang;
static int noMd5;
static int noOrder;
static int noPgp;
static int noScripts;
static int noTriggers;
@ -113,9 +114,10 @@ static struct poptOption optionsTable[] = {
{ "justdb", '\0', 0, &justdb, 0 },
{ "list", 'l', 0, 0, 'l' },
{ "nodeps", '\0', 0, &noDeps, 0 },
{ "noorder", '\0', 0, &noOrder, 0 },
{ "nofiles", '\0', 0, &noFiles, 0 },
{ "nolang", '\0', 0, &noLang, 0 },
{ "nomd5", '\0', 0, &noMd5, 0 },
{ "noorder", '\0', 0, &noOrder, 0 },
{ "nopgp", '\0', 0, &noPgp, 0 },
{ "noscripts", '\0', 0, &noScripts, 0 },
{ "notriggers", '\0', 0, &noTriggers, 0 },
@ -543,9 +545,10 @@ int main(int argc, char ** argv) {
initdb = 0;
justdb = 0;
noDeps = 0;
noOrder = 0;
noFiles = 0;
noLang = 0;
noMd5 = 0;
noOrder = 0;
noPgp = 0;
noScripts = 0;
noTriggers = 0;
@ -611,6 +614,7 @@ int main(int argc, char ** argv) {
optCon = poptGetContext("rpm", argc, argv, optionsTable, 0);
poptReadConfigFile(optCon, LIBRPMALIAS_FILENAME);
poptReadDefaultConfig(optCon, 1);
poptSetExecPath(optCon, RPMCONFIGDIR, 1);
while ((arg = poptGetNextOpt(optCon)) > 0) {
optArg = poptGetOptArg(optCon);
@ -1181,7 +1185,7 @@ int main(int argc, char ** argv) {
exit(1);
if (build(specFile, buildAmount, passPhrase, buildRootOverride,
0, test, cookie,rcfile,arch,os,buildplatforms)) {
0, test, cookie, rcfile, arch, os, buildplatforms)) {
exit(1);
}
free(cookie);
@ -1237,7 +1241,7 @@ int main(int argc, char ** argv) {
while ((pkg = poptGetArg(optCon)))
if (build(pkg, buildAmount, passPhrase, buildRootOverride,
bigMode == MODE_TARBUILD, test, NULL,
rcfile,arch,os,buildplatforms)) {
rcfile, arch, os, buildplatforms)) {
exit(1);
}
break;

View File

@ -53,9 +53,11 @@ rpm alias --changelog --qf '[* %{CHANGELOGTIME:day} %{CHANGELOGNAME}\n\n%{CHANGE
rpm alias --triggerscripts --qf '\
[trigger%{TRIGGERTYPE} script (through %{TRIGGERSCRIPTPROG}) -- %{TRIGGERCONDS}\n\
%{TRIGGERSCRIPTS}\n]'
apm alias --triggers --triggerscripts
rpm alias --triggers --triggerscripts
rpm alias --last --qf '%|INSTALLTIME?{%{INSTALLTIME}}:{000000000}| %{NAME}-%{VERSION}-%{RELEASE} %|INSTALLTIME?{%-27{INSTALLTIME:date}}:{(not installed)}|\n' \
--pipe "sort -r -n | sed 's,^..........,,' | awk '{printf(\"%-35s %-3s %-3s %2s %-8s %-4s\n\", $1, $2, $3, $4, $5, $6)}' "
rpm alias --filesbypkg --qf '[%-25{=NAME} %{FILENAMES}\n]'
rpm exec --freshen freshen.sh
rpm alias -F --freshen

View File

@ -21,6 +21,7 @@ distclean: clean
depend:
topdir_path=`( cd $(top_srcdir) && pwd )` ; \
/bin/rm -f .depend ; \
$(CPP) $(CFLAGS) -MM $(srcdir)/*.c | \
sed s+$$topdir_path+$(top_srcdir)+g > .depend