From c6bd3de937ce3d40daa228e237c52527b9cdb8e1 Mon Sep 17 00:00:00 2001 From: jbj Date: Tue, 19 Jun 2001 11:38:51 +0000 Subject: [PATCH] - preliminary abstraction to support per-header methods. CVS patchset: 4878 CVS date: 2001/06/19 11:38:51 --- CHANGES | 1 + Doxyfile.in | 3 + build/names.c | 4 +- build/parsePreamble.c | 2 +- build/rpmbuild.h | 2 +- configure.in | 2 +- doc/rpmbuild.8 | 245 +++++ lib/Makefile.am | 6 +- lib/hdrinline.c | 383 +++++++ lib/hdrinline.h | 353 +++++++ lib/hdrproto.h | 266 +++++ lib/header.c | 1235 +++++++++-------------- lib/header.h | 638 ++++++------ lib/header_internal.c | 29 +- lib/header_internal.h | 117 ++- lib/rpmlib.h | 2 +- lib/rpmvercmp.c | 2 +- po/POTFILES.in | 1 + po/rpm.pot | 2648 ++++++++++++++++++++++++------------------------- popt/po/popt.pot | 58 +- rpm.spec | 195 ++-- rpmdb/falloc.c | 2 +- rpmrc.in | 13 +- 23 files changed, 3592 insertions(+), 2615 deletions(-) create mode 100644 doc/rpmbuild.8 create mode 100644 lib/hdrinline.c create mode 100644 lib/hdrinline.h create mode 100644 lib/hdrproto.h diff --git a/CHANGES b/CHANGES index 31638cd..457bf1b 100644 --- a/CHANGES +++ b/CHANGES @@ -118,6 +118,7 @@ - fix: fsm reads/writes now return error on partial I/O. - fix: Ferror returned spurious error for gzdio/bzdio. - check for API/ABI creep, diddle up some compatibility. + - preliminary abstraction to support per-header methods. 4.0 -> 4.0.[12] - add doxygen and lclint annotations most everywhere. diff --git a/Doxyfile.in b/Doxyfile.in index 380ed09..1322653 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -359,6 +359,9 @@ INPUT = \ @top_srcdir@/lib/fs.c \ @top_srcdir@/lib/fsm.c \ @top_srcdir@/lib/fsm.h \ + @top_srcdir@/lib/hdrinline.c \ + @top_srcdir@/lib/hdrinline.h \ + @top_srcdir@/lib/hdrproto.h \ @top_srcdir@/lib/header.c \ @top_srcdir@/lib/header.h \ @top_srcdir@/lib/header_internal.c \ diff --git a/build/names.c b/build/names.c index 4b9e4ac..84470f7 100644 --- a/build/names.c +++ b/build/names.c @@ -112,9 +112,9 @@ const char *getGnameS(const char *gname) } /*@=nullderef@*/ -time_t *const getBuildTime(void) +int_32 *const getBuildTime(void) { - static time_t buildTime[1]; + static int_32 buildTime[1]; if (buildTime[0] == 0) buildTime[0] = time(NULL); diff --git a/build/parsePreamble.c b/build/parsePreamble.c index efb5a4f..161843e 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -253,7 +253,7 @@ static int checkForValidArchitectures(Spec spec) * @return 0 if OK */ static int checkForRequired(Header h, const char * NVR) - /*@*/ + /* LCL: parse error here with modifies */ { int res = 0; rpmTag * p; diff --git a/build/rpmbuild.h b/build/rpmbuild.h index 640180f..9b55c64 100644 --- a/build/rpmbuild.h +++ b/build/rpmbuild.h @@ -126,7 +126,7 @@ void freeNames(void) * Return build time stamp. * @return build time stamp */ -/*@observer@*/ time_t * const getBuildTime(void) /*@*/; +/*@observer@*/ int_32 * const getBuildTime(void) /*@*/; /** \ingroup rpmbuild * Read next line from spec file. diff --git a/configure.in b/configure.in index f5babb6..9f15f4e 100644 --- a/configure.in +++ b/configure.in @@ -1014,7 +1014,7 @@ mint) RPMCANONARCH=m68kmint ;; esac RPMCANONVENDOR="$build_vendor" case "${build_vendor}" in -unknown|pc|redhat|pld|mandrake|conectiva) +unknown|pc|ibm|redhat|pld|mandrake|conectiva) test -f /etc/redhat-release && RPMCANONVENDOR=redhat test -f /etc/pld-release && RPMCANONVENDOR=pld test -f /etc/mandrake-release && RPMCANONVENDOR=mandrake diff --git a/doc/rpmbuild.8 b/doc/rpmbuild.8 new file mode 100644 index 0000000..5553929 --- /dev/null +++ b/doc/rpmbuild.8 @@ -0,0 +1,245 @@ +.\" This manpage has been automatically generated by docbook2man +.\" from a DocBook document. This tool can be found at: +.\" +.\" Please send any bug reports, improvements, comments, patches, +.\" etc. to Steve Cheng . +.TH "RPMBUILD" "8" "06 June 2001" "Red Hat, Inc." "Red Hat Linux" +.SH NAME +rpmbuild \- Build RPM Package(s) +.SH SYNOPSIS +.SS "BUILDING PACKAGES:" +.PP + +\fBrpmbuild\fR {\fB-ba|-bb|-bp|-bc|-bi|-bl|-bs\fR} [\fBrpmbuild-options\fR] \fB\fISPECFILE\fB\fR\fI ...\fR + +\fBrpmbuild\fR {\fB-ta|-tb|-tp|-tc|-ti|-tl|-ts\fR} [\fBrpmbuild-options\fR] \fB\fITARBALL\fB\fR\fI ...\fR + +\fBrpmbuild\fR {\fB--rebuild|--recompile\fR} \fB\fISOURCEPKG\fB\fR\fI ...\fR + +\fBrpmbuild\fR \fB--tarbuild\fR \fB\fITARBALL\fB\fR\fI ...\fR +.SS "MISCELLANEOUS:" +.PP + +\fBrpmbuild\fR {\fB--showrc\fR} +.SS "RPMBUILD-OPTIONS" +.PP + +\fB[--buildroot \fIDIRECTORY\fB] [--clean] [--nobuild] [--rmsource] [--rmspec] +[--short-circuit] [--sign] [--target \fIPLATFORM\fB]\fR +.SH "DESCRIPTION" +.PP +\fBrpmbuild\fR is used to build both binary and source software packages. +A \fBpackage\fR consists of an archive of files and +meta-data used to install and erase the archive files. The meta-data +includes helper scripts, file attributes, and descriptive information +about the package. +\fBPackages\fR come in two varieties: binary packages, +used to encapsulate software to be installed, and source packages, +containing the source code and recipe necessary to produce binary +packages. +.PP +One of the following basic modes must be selected: +\fBBuild Package\fR, +\fBBuild Package from Tarball\fR, +\fBRecompile Package\fR, +\fBShow Configuration\fR. +.SS "GENERAL OPTIONS" +.PP +These options can be used in all the different modes. +.TP +\fB-?, --help\fR +Print a longer usage message then normal. +.TP +\fB--version\fR +Print a single line containing the version number of \fBrpm\fR +being used. +.TP +\fB--quiet\fR +Print as little as possible - normally only error messages will +be displayed. +.TP +\fB-v\fR +Print verbose information - normally routine progress messages will be +displayed. +.TP +\fB-vv\fR +Print lots of ugly debugging information. +.TP +\fB--rcfile \fIFILELIST\fB\fR +Each of the files in the colon separated +\fIFILELIST\fR +is read sequentially by \fBrpm\fR for configuration +information. +Only the first file in the list must exist, and tildes will be +expanded to the value of \fB$HOME\fR. +The default \fIFILELIST\fR is +\fI/usr/lib/rpm/rpmrc\fR:\fI/etc/rpmrc\fR:\fI~/.rpmrc\fR. +.TP +\fB--pipe \fICMD\fB\fR +Pipes the output of \fBrpm\fR to the command \fICMD\fR. +.TP +\fB--dbpath \fIDIRECTORY\fB\fR +Use the database in \fIDIRECTORY\fR rathen +than the default path \fI/var/lib/rpm\fR +.TP +\fB--root \fIDIRECTORY\fB\fR +Use the system rooted at \fIDIRECTORY\fR for all operations. +Note that this means the database will be read or modified under +\fIDIRECTORY\fR and any +\fB%pre\fR or +\fB%post\fR +scriptlet(s) are run after a chroot(2) to +\fIDIRECTORY\fR. +.SS "BUILD OPTIONS" +.PP +The general form of an rpm build command is +.PP +\fBrpmbuild\fR {\fB-b\fISTAGE\fB|-t\fISTAGE\fB\fR} [\fBrpmbuild-options\fR] \fB\fIFILE\fB\fR\fI ...\fR +.PP +The argument used is \fB-b\fR if a spec file is being +used to build the package and \fB-t\fR if \fBrpmbuild\fR +should look inside of a (possibly compressed) tar file for +the spec file to use. After the first argument, the next +character (\fISTAGE\fR) specifies the stages +of building and packaging to be done and is one of: +.TP +\fB-ba\fR +Build binary and source packages (after doing the %prep, %build, and +%install stages). +.TP +\fB-bb\fR +Build a binary package (after doing the %prep, %build, and %install +stages). +.TP +\fB-bp\fR +Executes the "%prep" stage from the spec file. Normally this +involves unpacking the sources and applying any patches. +.TP +\fB-bc\fR +Do the "%build" stage from the spec file (after doing the %prep stage). +This generally involves the equivalent of a "make". +.TP +\fB-bi\fR +Do the "%install" stage from the spec file (after doing the %prep and +%build stages). This generally involves the equivalent of a +"make install". +.TP +\fB-bl\fR +Do a "list check". The "%files" section from the spec file is +macro expanded, and checks are made to verify that each file +exists. +.TP +\fB-bs\fR +Build just the source package. +.PP +The following options may also be used: +.TP +\fB--buildroot \fIDIRECTORY\fB\fR +When building a package, override the BuildRoot tag with directory +\fIDIRECTORY\fR. +.TP +\fB--clean\fR +Remove the build tree after the packages are made. +.TP +\fB--nobuild\fR +Do not execute any build stages. Useful for testing out spec files. +.TP +\fB--rmsource\fR +Remove the sources after the build (may also be +used standalone, e.g. "\fBrpmbuild\fR \fB--rmsource foo.spec\fR"). +.TP +\fB--rmspec\fR +Remove the spec file after the build (may also be +used standalone, eg. "\fBrpmbuild\fR \fB--rmspec foo.spec\fR"). +.TP +\fB--short-circuit\fR +Skip straight to specified stage (i.e., skip all stages leading +up to the specified stage). Only valid with \fB-bc\fR +and \fB-bi\fR. +.TP +\fB--sign\fR +Embed a GPG signature in the package. This signature can be used +to verify the integrity and the origin of the package. See the +section on GPG SIGNATURES for configuration details. +.TP +\fB--target \fIPLATFORM\fB\fR +When building the package, interpret \fIPLATFORM\fR +as \fBarch-vendor-os\fR and set the macros +\fB%_target\fR, +\fB%_target_arch\fR, and +\fB%_target_os\fR +accordingly. +.SS "REBUILD AND RECOMPILE OPTIONS" +.PP +There are two other ways to invoke building with rpm: +.PP +\fBrpmbuild\fR {\fB--rebuild|--recompile\fR} \fB\fISOURCEPKG\fB\fR\fI ...\fR +.PP +When invoked this way, \fBrpmbuild\fR installs the named source +package, and does a prep, compile and install. In addition, +\fB--rebuild\fR builds a new binary package. When the build +has completed, the build directory is removed (as in +\fB--clean\fR) and the the sources and spec file for +the package are removed. +.SS "SHOWRC" +.PP +The command +.PP +\fBrpmbuild\fR \fB--showrc\fR +.PP +shows the values \fBrpmbuild\fR will use for all of the +options are currently set in +\fIrpmrc\fR and +\fImacros\fR +configuration file(s). +.SH "FILES" +.PP + +\fI/usr/lib/rpm/rpmrc\fR + +\fI/etc/rpmrc\fR + +\fI~/.rpmrc\fR + +\fI/usr/lib/rpm/macros\fR + +\fI/etc/rpm/macros\fR + +\fI~/.rpmmacros\fR + +\fI/var/lib/rpm/Conflictname\fR + +\fI/var/lib/rpm/Basenames\fR + +\fI/var/lib/rpm/Group\fR + +\fI/var/lib/rpm/Name\fR + +\fI/var/lib/rpm/Packages\fR + +\fI/var/lib/rpm/Providename\fR + +\fI/var/lib/rpm/Requirename\fR + +\fI/var/lib/rpm/Triggername\fR + +\fI/var/tmp/rpm*\fR +.SH "SEE ALSO" + +\fBpopt\fR(3), + +\fBrpm2cpio\fR(8), + +\fBgendiff\fR(1), + +\fBrpm\fR(8), + +\fB http://www.rpm.org/ +\fR +.SH "AUTHORS" + +Marc Ewing + +Jeff Johnson + +Erik Troan diff --git a/lib/Makefile.am b/lib/Makefile.am index 245883c..f1371b2 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -14,7 +14,8 @@ EXTRA_DIST = getdate.y pkgincdir = $(pkgincludedir) pkginc_HEADERS = \ - header.h misc.h rpmcli.h rpmlib.h stringbuf.h + header.h hdrinline.h hdrproto.h \ + misc.h rpmcli.h rpmlib.h stringbuf.h noinst_HEADERS = \ cpio.h depends.h fsm.h header_internal.h \ manifest.h md5.h psm.h \ @@ -32,7 +33,8 @@ LIBS = lib_LTLIBRARIES = librpm.la librpm_la_SOURCES = \ cpio.c depends.c formats.c fs.c fsm.c getdate.c \ - header.c header_internal.c manifest.c md5.c md5sum.c misc.c package.c \ + header.c hdrinline.c header_internal.c \ + manifest.c md5.c md5sum.c misc.c package.c \ problems.c poptBT.c poptI.c poptK.c poptQV.c psm.c query.c \ rpmchecksig.c rpminstall.c rpmlead.c rpmlibprov.c rpmrc.c rpmvercmp.c \ signature.c stringbuf.c tagName.c tagtable.c transaction.c \ diff --git a/lib/hdrinline.c b/lib/hdrinline.c new file mode 100644 index 0000000..ce9392e --- /dev/null +++ b/lib/hdrinline.c @@ -0,0 +1,383 @@ +/** \ingroup header + * \file lib/hdrinline.c + */ + +#include "system.h" + +#include + +#include "debug.h" + +int _hdrinline_debug = 0; + +/*@access Header @*/ +/*@access entryInfo @*/ +/*@access indexEntry @*/ + +/*@access extensionCache @*/ +/*@access sprintfTag @*/ +/*@access sprintfToken @*/ + +/** + * Wrapper to free(3), hides const compilation noise, permit NULL, return NULL. + * @param p memory to free + * @return NULL always + */ +/*@unused@*/ static inline /*@null@*/ void * +_free(/*@only@*/ /*@null@*/ const void * p) /*@modifies *p @*/ +{ + if (p != NULL) free((void *)p); + return NULL; +} + +Header headerNew() +{ + Header h = xcalloc(1, sizeof(*h)); + + /*@-assignexpose@*/ + h->hv = hv; /* structure assignment */ + /*@=assignexpose@*/ + h->indexAlloced = INDEX_MALLOC_SIZE; + h->indexUsed = 0; + h->region_allocated = 0; + h->sorted = 1; + h->legacy = 0; + h->nrefs = 1; + + h->index = (h->indexAlloced + ? xcalloc(h->indexAlloced, sizeof(*h->index)) + : NULL); + + /*@-globstate@*/ + return h; + /*@=globstate@*/ +} + +Header headerLoad(void * uh) +{ + int_32 * ei = (int_32 *) uh; + int_32 il = ntohl(ei[0]); /* index length */ + int_32 dl = ntohl(ei[1]); /* data length */ + int pvlen = sizeof(il) + sizeof(dl) + + (il * sizeof(struct entryInfo)) + dl; + void * pv = uh; + Header h = xcalloc(1, sizeof(*h)); + entryInfo pe; + char * dataStart; + indexEntry entry; + int rdlen; + int i; + + ei = (int_32 *) pv; + /*@-castexpose@*/ + pe = (entryInfo) &ei[2]; + /*@=castexpose@*/ + dataStart = (char *) (pe + il); + + /*@-assignexpose@*/ + h->hv = hv; /* structure assignment */ + /*@=assignexpose@*/ + h->indexAlloced = il + 1; + h->indexUsed = il; + h->index = xcalloc(h->indexAlloced, sizeof(*h->index)); + h->sorted = 1; + h->region_allocated = 0; + h->nrefs = 1; + + /* + * XXX XFree86-libs, ash, and pdksh from Red Hat 5.2 have bogus + * %verifyscript tag that needs to be diddled. + */ + if (ntohl(pe->tag) == 15 && + ntohl(pe->type) == RPM_STRING_TYPE && + ntohl(pe->count) == 1) + { + pe->tag = htonl(1079); + } + + entry = h->index; + i = 0; + if (!(htonl(pe->tag) < HEADER_I18NTABLE)) { + h->legacy = 1; + entry->info.type = REGION_TAG_TYPE; + entry->info.tag = HEADER_IMAGE; + entry->info.count = REGION_TAG_COUNT; + entry->info.offset = ((char *)pe - dataStart); /* negative offset */ + + /*@-assignexpose@*/ + entry->data = pe; + /*@=assignexpose@*/ + entry->length = pvlen - sizeof(il) - sizeof(dl); + rdlen = regionSwab(entry+1, il, 0, pe, dataStart, entry->info.offset); + if (rdlen != dl) goto errxit; + entry->rdlen = rdlen; + entry++; + h->indexUsed++; + } else { + int nb = ntohl(pe->count); + int_32 rdl; + int_32 ril; + + h->legacy = 0; + entry->info.type = htonl(pe->type); + if (entry->info.type < RPM_MIN_TYPE || entry->info.type > RPM_MAX_TYPE) + goto errxit; + entry->info.count = htonl(pe->count); + + { int off = ntohl(pe->offset); + if (off) { + int_32 * stei = memcpy(alloca(nb), dataStart + off, nb); + rdl = -ntohl(stei[2]); /* negative offset */ + ril = rdl/sizeof(*pe); + entry->info.tag = htonl(pe->tag); + } else { + ril = il; + rdl = (ril * sizeof(struct entryInfo)); + entry->info.tag = HEADER_IMAGE; + } + } + entry->info.offset = -rdl; /* negative offset */ + + /*@-assignexpose@*/ + entry->data = pe; + /*@=assignexpose@*/ + entry->length = pvlen - sizeof(il) - sizeof(dl); + rdlen = regionSwab(entry+1, ril-1, 0, pe+1, dataStart, entry->info.offset); + if (rdlen < 0) goto errxit; + entry->rdlen = rdlen; + + if (ril < h->indexUsed) { + indexEntry newEntry = entry + ril; + int ne = (h->indexUsed - ril); + int rid = entry->info.offset+1; + int rc; + + /* Load dribble entries from region. */ + rc = regionSwab(newEntry, ne, 0, pe+ril, dataStart, rid); + if (rc < 0) goto errxit; + rdlen += rc; + + { indexEntry firstEntry = newEntry; + int save = h->indexUsed; + int j; + + /* Dribble entries replace duplicate region entries. */ + h->indexUsed -= ne; + for (j = 0; j < ne; j++, newEntry++) { + (void) headerRemoveEntry(h, newEntry->info.tag); + if (newEntry->info.tag == HEADER_BASENAMES) + (void) headerRemoveEntry(h, HEADER_OLDFILENAMES); + } + + /* If any duplicate entries were replaced, move new entries down. */ + if (h->indexUsed < (save - ne)) { + memmove(h->index + h->indexUsed, firstEntry, + (ne * sizeof(*entry))); + } + h->indexUsed += ne; + } + } + } + + h->sorted = 0; + headerSort(h); + + /*@-globstate@*/ + return h; + /*@=globstate@*/ + +errxit: + /*@-usereleased@*/ + if (h) { + h->index = _free(h->index); + /*@-refcounttrans@*/ + h = _free(h); + /*@=refcounttrans@*/ + } + /*@=usereleased@*/ + /*@-refcounttrans -globstate@*/ + return h; + /*@=refcounttrans =globstate@*/ +} + +int headerWrite(FD_t fd, Header h, enum hMagic magicp) +{ + ssize_t nb; + int length; + const void * uh; + + if (h == NULL) + return 1; + uh = doHeaderUnload(h, &length); + if (uh == NULL) + return 1; + switch (magicp) { + case HEADER_MAGIC_YES: + nb = Fwrite(header_magic, sizeof(char), sizeof(header_magic), fd); + if (nb != sizeof(header_magic)) + goto exit; + break; + case HEADER_MAGIC_NO: + break; + } + + nb = Fwrite(uh, sizeof(char), length, fd); + +exit: + uh = _free(uh); + return (nb == length ? 0 : 1); +} + +Header headerCopyLoad(void * uh) +{ + int_32 * ei = (int_32 *) uh; + int_32 il = ntohl(ei[0]); /* index length */ + int_32 dl = ntohl(ei[1]); /* data length */ + int pvlen = sizeof(il) + sizeof(dl) + + (il * sizeof(struct entryInfo)) + dl; + void * nuh = memcpy(xmalloc(pvlen), uh, pvlen); + Header h; + + h = headerLoad(nuh); + if (h == NULL) { + nuh = _free(nuh); + return h; + } + h->region_allocated = 1; + return h; +} + +Header headerRead(FD_t fd, enum hMagic magicp) +{ + int_32 block[4]; + int_32 reserved; + int_32 * ei = NULL; + int_32 il; + int_32 dl; + int_32 magic; + Header h = NULL; + int len; + int i; + + memset(block, 0, sizeof(block)); + i = 2; + if (magicp == HEADER_MAGIC_YES) + i += 2; + + if (timedRead(fd, (char *)block, i*sizeof(*block)) != (i * sizeof(*block))) + goto exit; + + i = 0; + + if (magicp == HEADER_MAGIC_YES) { + magic = block[i++]; + if (memcmp(&magic, header_magic, sizeof(magic))) + goto exit; + reserved = block[i++]; + } + + il = ntohl(block[i++]); + dl = ntohl(block[i++]); + + len = sizeof(il) + sizeof(dl) + (il * sizeof(struct entryInfo)) + dl; + + /* + * XXX Limit total size of header to 32Mb (~16 times largest known size). + */ + if (len > (32*1024*1024)) + goto exit; + + ei = xmalloc(len); + ei[0] = htonl(il); + ei[1] = htonl(dl); + len -= sizeof(il) + sizeof(dl); + + if (timedRead(fd, (char *)&ei[2], len) != len) + goto exit; + + h = headerLoad(ei); + +exit: + if (h) { + if (h->region_allocated) + ei = _free(ei); + h->region_allocated = 1; + } else if (ei) + ei = _free(ei); + return h; +} + +void headerCopyTags(Header headerFrom, Header headerTo, hTAG_t tagstocopy) +{ + int * p; + + if (headerFrom == headerTo) + return; + + for (p = tagstocopy; *p != 0; p++) { + char *s; + int_32 type; + int_32 count; + if (headerIsEntry(headerTo, *p)) + continue; + if (!headerGetEntryMinMemory(headerFrom, *p, &type, + (hPTR_t *) &s, &count)) + continue; + (void) headerAddEntry(headerTo, *p, type, s, count); + s = headerFreeData(s, type); + } +} + +/** + * Header tag iterator data structure. + */ +struct headerIteratorS { +/*@unused@*/ Header h; /*!< Header being iterated. */ +/*@unused@*/ int next_index; /*!< Next tag index. */ +}; + +void headerFreeIterator(HeaderIterator hi) +{ + hi->h = headerFree(hi->h); + hi = _free(hi); +} + +HeaderIterator headerInitIterator(Header h) +{ + HeaderIterator hi = xmalloc(sizeof(struct headerIteratorS)); + + headerSort(h); + + hi->h = headerLink(h); + hi->next_index = 0; + return hi; +} + +int headerNextIterator(HeaderIterator hi, + hTAG_t tag, hTYP_t type, hPTR_t * p, hCNT_t c) +{ + Header h = hi->h; + int slot = hi->next_index; + indexEntry entry = NULL; + int rc; + + for (slot = hi->next_index; slot < h->indexUsed; slot++) { + entry = h->index + slot; + if (!ENTRY_IS_REGION(entry)) + break; + } + hi->next_index = slot; + if (entry == NULL || slot >= h->indexUsed) + return 0; + /*@-noeffect@*/ /* LCL: no clue */ + hi->next_index++; + /*@=noeffect@*/ + + if (tag) + *tag = entry->info.tag; + + rc = copyEntry(entry, type, p, c, 0); + + /* XXX 1 on success */ + return ((rc == 1) ? 1 : 0); +} diff --git a/lib/hdrinline.h b/lib/hdrinline.h new file mode 100644 index 0000000..dc17010 --- /dev/null +++ b/lib/hdrinline.h @@ -0,0 +1,353 @@ +#ifndef H_HDRINLINE +#define H_HDRINLINE + +/** \ingroup header + * \file lib/hdrinline.h + */ + +/*@-exportlocal@*/ +extern int _hdrinline_debug; +/*@=exportlocal@*/ + +#ifdef __cplusplus +extern "C" { +#endif +/*@+voidabstract -nullpass -abstract -mustmod -compdef -shadow -predboolothers @*/ + +#define HV(_h) ((HV_t *)(_h)) + +/** \ingroup header + * Dereference a header instance. + * @param h header + * @return NULL always + */ +/*@unused@*/ static inline +/*@null@*/ Header headerFree( /*@null@*/ /*@killref@*/ Header h) + /*@modifies h @*/ +{ + if (h == NULL) return NULL; + return (HV(h)->free) (h); +} + +/** \ingroup header + * Reference a header instance. + * @param h header + * @return referenced header instance + */ +/*@unused@*/ static inline +Header headerLink(Header h) + /*@modifies h @*/ +{ + return (HV(h)->link) (h); +} + +/*@-exportlocal@*/ +/** \ingroup header + * Sort tags in header. + * @param h header + */ +/*@unused@*/ static inline +void headerSort(Header h) + /*@modifies h @*/ +{ + return (HV(h)->sort) (h); +} + +/** \ingroup header + * Restore tags in header to original ordering. + * @param h header + */ +/*@unused@*/ static inline +void headerUnsort(Header h) + /*@modifies h @*/ +{ + return (HV(h)->unsort) (h); +} +/*@=exportlocal@*/ + +/** \ingroup header + * Return size of on-disk header representation in bytes. + * @param h header + * @param magicp include size of 8 bytes for (magic, 0)? + * @return size of on-disk header + */ +/*@unused@*/ static inline +unsigned int headerSizeof(/*@null@*/ Header h, enum hMagic magicp) + /*@modifies h @*/ +{ + if (h == NULL) return 0; + return (HV(h)->size) (h, magicp); +} + +/** \ingroup header + * Convert header to on-disk representation. + * @param h header (with pointers) + * @return on-disk header blob (i.e. with offsets) + */ +/*@unused@*/ static inline +/*@only@*/ /*@null@*/ void * headerUnload(Header h) + /*@modifies h @*/ +{ + return (HV(h)->unload) (h); +} + +/** \ingroup header + * Convert header to on-disk representation, and then reload. + * This is used to insure that all header data is in one chunk. + * @param h header (with pointers) + * @param tag region tag + * @return on-disk header (with offsets) + */ +/*@unused@*/ static inline +/*@null@*/ Header headerReload(/*@only@*/ Header h, int tag) + /*@modifies h @*/ +{ + return (HV(h)->reload) (h, tag); +} + +/** \ingroup header + * Duplicate a header. + * @param h header + * @return new header instance + */ +/*@unused@*/ static inline +/*@null@*/ Header headerCopy(Header h) + /*@modifies h @*/ +{ + return (HV(h)->copy) (h); +} + +/** \ingroup header + * Check if tag is in header. + * @param h header + * @param tag tag + * @return 1 on success, 0 on failure + */ +/*@unused@*/ static inline +int headerIsEntry(/*@null@*/Header h, int_32 tag) + /*@modifies h @*/ +{ + if (h == NULL) return 0; + return (HV(h)->isentry) (h, tag); +} + +/** \ingroup header + * Retrieve tag value. + * Will never return RPM_I18NSTRING_TYPE! RPM_STRING_TYPE elements with + * RPM_I18NSTRING_TYPE equivalent entries are translated (if HEADER_I18NTABLE + * entry is present). + * + * @param h header + * @param tag tag + * @retval type address of tag value data type (or NULL) + * @retval p address of pointer to tag value(s) (or NULL) + * @retval c address of number of values (or NULL) + * @return 1 on success, 0 on failure + */ +/*@unused@*/ static inline +int headerGetEntry(Header h, int_32 tag, + /*@null@*/ /*@out@*/ hTYP_t type, + /*@null@*/ /*@out@*/ void ** p, + /*@null@*/ /*@out@*/ hCNT_t c) + /*@modifies *type, *p, *c @*/ +{ + return (HV(h)->get) (h, tag, type, p, c); +} + +/** \ingroup header + * Retrieve tag value using header internal array. + * Get an entry using as little extra RAM as possible to return the tag value. + * This is only an issue for RPM_STRING_ARRAY_TYPE. + * + * @param h header + * @param tag tag + * @retval type address of tag value data type (or NULL) + * @retval p address of pointer to tag value(s) (or NULL) + * @retval c address of number of values (or NULL) + * @return 1 on success, 0 on failure + */ +/*@unused@*/ static inline +int headerGetEntryMinMemory(Header h, int_32 tag, + /*@null@*/ /*@out@*/ hTYP_t type, + /*@null@*/ /*@out@*/ hPTR_t * p, + /*@null@*/ /*@out@*/ hCNT_t c) + /*@modifies *type, *p, *c @*/ +{ + return (HV(h)->getmin) (h, tag, type, p, c); +} + +/** \ingroup header + * Retrieve tag value with type match. + * If *type is RPM_NULL_TYPE any type will match, otherwise only *type will + * match. + * + * @param h header + * @param tag tag + * @retval type address of tag value data type (or NULL) + * @retval p address of pointer to tag value(s) (or NULL) + * @retval c address of number of values (or NULL) + * @return 1 on success, 0 on failure + */ +/*@-exportlocal@*/ +/*@unused@*/ static inline +int headerGetRawEntry(Header h, int_32 tag, + /*@null@*/ /*@out@*/ hTYP_t type, + /*@null@*/ /*@out@*/ hPTR_t * p, + /*@null@*/ /*@out@*/ hCNT_t c) + /*@modifies *type, *p, *c @*/ +{ + return (HV(h)->getraw) (h, tag, type, p, c); +} +/*@=exportlocal@*/ + +/** \ingroup header + * Add tag to header. + * Duplicate tags are okay, but only defined for iteration (with the + * exceptions noted below). While you are allowed to add i18n string + * arrays through this function, you probably don't mean to. See + * headerAddI18NString() instead. + * + * @param h header + * @param tag tag + * @param type tag value data type + * @param p pointer to tag value(s) + * @param c number of values + * @return 1 on success, 0 on failure + */ +/*@mayexit@*/ +/*@unused@*/ static inline +int headerAddEntry(Header h, int_32 tag, int_32 type, const void * p, int_32 c) + /*@modifies h @*/ +{ + return (HV(h)->add) (h, tag, type, p, c); +} + +/** \ingroup header + * Append element to tag array in header. + * Appends item p to entry w/ tag and type as passed. Won't work on + * RPM_STRING_TYPE. Any pointers into header memory returned from + * headerGetEntryMinMemory() for this entry are invalid after this + * call has been made! + * + * @param h header + * @param tag tag + * @param type tag value data type + * @param p pointer to tag value(s) + * @param c number of values + * @return 1 on success, 0 on failure + */ +/*@unused@*/ static inline +int headerAppendEntry(Header h, int_32 tag, int_32 type, + const void * p, int_32 c) + /*@modifies h @*/ +{ + return (HV(h)->append) (h, tag, type, p, c); +} + +/** \ingroup header + * Add or append element to tag array in header. + * @todo Arg "p" should have const. + * @param h header + * @param tag tag + * @param type tag value data type + * @param p pointer to tag value(s) + * @param c number of values + * @return 1 on success, 0 on failure + */ +/*@unused@*/ static inline +int headerAddOrAppendEntry(Header h, int_32 tag, int_32 type, + const void * p, int_32 c) + /*@modifies h @*/ +{ + return (HV(h)->addorappend) (h, tag, type, p, c); +} + +/** \ingroup header + * Add locale specific tag to header. + * A NULL lang is interpreted as the C locale. Here are the rules: + * \verbatim + * - If the tag isn't in the header, it's added with the passed string + * as new value. + * - If the tag occurs multiple times in entry, which tag is affected + * by the operation is undefined. + * - If the tag is in the header w/ this language, the entry is + * *replaced* (like headerModifyEntry()). + * \endverbatim + * This function is intended to just "do the right thing". If you need + * more fine grained control use headerAddEntry() and headerModifyEntry(). + * + * @param h header + * @param tag tag + * @param string tag value + * @param lang locale + * @return 1 on success, 0 on failure + */ +/*@unused@*/ static inline +int headerAddI18NString(Header h, int_32 tag, const char * string, + const char * lang) + /*@modifies h @*/ +{ + return (HV(h)->addi18n) (h, tag, string, lang); +} + +/** \ingroup header + * Modify tag in header. + * If there are multiple entries with this tag, the first one gets replaced. + * @param h header + * @param tag tag + * @param type tag value data type + * @param p pointer to tag value(s) + * @param c number of values + * @return 1 on success, 0 on failure + */ +/*@unused@*/ static inline +int headerModifyEntry(Header h, int_32 tag, int_32 type, + const void * p, int_32 c) + /*@modifies h @*/ +{ + return (HV(h)->modify) (h, tag, type, p, c); +} + +/** \ingroup header + * Delete tag in header. + * Removes all entries of type tag from the header, returns 1 if none were + * found. + * + * @param h header + * @param tag tag + * @return 0 on success, 1 on failure (INCONSISTENT) + */ +/*@unused@*/ static inline +int headerRemoveEntry(Header h, int_32 tag) + /*@modifies h @*/ +{ + return (HV(h)->remove) (h, tag); +} + +/** \ingroup header + * Return formatted output string from header tags. + * The returned string must be free()d. + * + * @param h header + * @param fmt format to use + * @param tags array of tag name/value pairs + * @param extensions chained table of formatting extensions. + * @retval errmsg error message (if any) + * @return formatted output string (malloc'ed) + */ +/*@unused@*/ static inline +/*@only@*/ char * headerSprintf(Header h, const char * fmt, + const struct headerTagTableEntry * tags, + const struct headerSprintfExtension * extensions, + /*@null@*/ /*@out@*/ errmsg_t * errmsg) + /*@modifies *errmsg @*/ +{ + return (HV(h)->sprintf) (h, fmt, tags, extensions, errmsg); +} +/*@=voidabstract =nullpass =abstract =mustmod =compdef =shadow =predboolothers @*/ + +#ifdef __cplusplus +} +#endif + +#endif /* H_HDRINLINE */ diff --git a/lib/hdrproto.h b/lib/hdrproto.h new file mode 100644 index 0000000..96735ff --- /dev/null +++ b/lib/hdrproto.h @@ -0,0 +1,266 @@ +#ifndef H_HDRPROTO +#define H_HDRPROTO + +/** \ingroup header + * \file lib/hdrproto.h + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \ingroup header + * Dereference a header instance. + * @param h header + * @return NULL always + */ +/*@null@*/ Header headerFree( /*@null@*/ /*@killref@*/ Header h) + /*@modifies h @*/; + +/** \ingroup header + * Reference a header instance. + * @param h header + * @return referenced header instance + */ +Header headerLink(Header h) + /*@modifies h @*/; + +/*@-exportlocal@*/ +/** \ingroup header + * Sort tags in header. + * @param h header + */ +void headerSort(Header h) + /*@modifies h @*/; + +/** \ingroup header + * Restore tags in header to original ordering. + * @param h header + */ +void headerUnsort(Header h) + /*@modifies h @*/; +/*@=exportlocal@*/ + +/** \ingroup header + * Return size of on-disk header representation in bytes. + * @param h header + * @param magicp include size of 8 bytes for (magic, 0)? + * @return size of on-disk header + */ +unsigned int headerSizeof(/*@null@*/ Header h, enum hMagic magicp) + /*@modifies h @*/; + +/** \ingroup header + * Convert header to on-disk representation. + * @param h header (with pointers) + * @return on-disk header blob (i.e. with offsets) + */ +/*@only@*/ /*@null@*/ void * headerUnload(Header h) + /*@modifies h @*/; + +/** \ingroup header + * Convert header to on-disk representation, and then reload. + * This is used to insure that all header data is in one chunk. + * @param h header (with pointers) + * @param tag region tag + * @return on-disk header (with offsets) + */ +/*@null@*/ Header headerReload(/*@only@*/ Header h, int tag) + /*@modifies h @*/; + +/** \ingroup header + * Duplicate a header. + * @param h header + * @return new header instance + */ +/*@null@*/ Header headerCopy(Header h) + /*@modifies h @*/; + +/** \ingroup header + * Check if tag is in header. + * @param h header + * @param tag tag + * @return 1 on success, 0 on failure + */ +int headerIsEntry(/*@null@*/Header h, int_32 tag) + /*@*/; + +/** \ingroup header + * Retrieve tag value. + * Will never return RPM_I18NSTRING_TYPE! RPM_STRING_TYPE elements with + * RPM_I18NSTRING_TYPE equivalent entries are translated (if HEADER_I18NTABLE + * entry is present). + * + * @param h header + * @param tag tag + * @retval type address of tag value data type (or NULL) + * @retval p address of pointer to tag value(s) (or NULL) + * @retval c address of number of values (or NULL) + * @return 1 on success, 0 on failure + */ +int headerGetEntry(Header h, int_32 tag, + /*@null@*/ /*@out@*/ hTYP_t type, + /*@null@*/ /*@out@*/ void ** p, + /*@null@*/ /*@out@*/ hCNT_t c) + /*@modifies *type, *p, *c @*/; + +/** \ingroup header + * Retrieve tag value using header internal array. + * Get an entry using as little extra RAM as possible to return the tag value. + * This is only an issue for RPM_STRING_ARRAY_TYPE. + * + * @param h header + * @param tag tag + * @retval type address of tag value data type (or NULL) + * @retval p address of pointer to tag value(s) (or NULL) + * @retval c address of number of values (or NULL) + * @return 1 on success, 0 on failure + */ +int headerGetEntryMinMemory(Header h, int_32 tag, + /*@null@*/ /*@out@*/ hTYP_t type, + /*@null@*/ /*@out@*/ hPTR_t * p, + /*@null@*/ /*@out@*/ hCNT_t c) + /*@modifies *type, *p, *c @*/; + +/** \ingroup header + * Retrieve tag value with type match. + * If *type is RPM_NULL_TYPE any type will match, otherwise only *type will + * match. + * + * @param h header + * @param tag tag + * @retval type address of tag value data type (or NULL) + * @retval p address of pointer to tag value(s) (or NULL) + * @retval c address of number of values (or NULL) + * @return 1 on success, 0 on failure + */ +/*@-exportlocal@*/ +int headerGetRawEntry(Header h, int_32 tag, + /*@null@*/ /*@out@*/ hTYP_t type, + /*@null@*/ /*@out@*/ hPTR_t * p, + /*@null@*/ /*@out@*/ hCNT_t c) + /*@modifies *type, *p, *c @*/; +/*@=exportlocal@*/ + +/** \ingroup header + * Add tag to header. + * Duplicate tags are okay, but only defined for iteration (with the + * exceptions noted below). While you are allowed to add i18n string + * arrays through this function, you probably don't mean to. See + * headerAddI18NString() instead. + * + * @param h header + * @param tag tag + * @param type tag value data type + * @param p pointer to tag value(s) + * @param c number of values + * @return 1 on success, 0 on failure + */ +/*@mayexit@*/ +int headerAddEntry(Header h, int_32 tag, int_32 type, const void * p, int_32 c) + /*@modifies h @*/; + +/** \ingroup header + * Append element to tag array in header. + * Appends item p to entry w/ tag and type as passed. Won't work on + * RPM_STRING_TYPE. Any pointers into header memory returned from + * headerGetEntryMinMemory() for this entry are invalid after this + * call has been made! + * + * @param h header + * @param tag tag + * @param type tag value data type + * @param p pointer to tag value(s) + * @param c number of values + * @return 1 on success, 0 on failure + */ +int headerAppendEntry(Header h, int_32 tag, int_32 type, + const void * p, int_32 c) + /*@modifies h @*/; + +/** \ingroup header + * Add or append element to tag array in header. + * @todo Arg "p" should have const. + * @param h header + * @param tag tag + * @param type tag value data type + * @param p pointer to tag value(s) + * @param c number of values + * @return 1 on success, 0 on failure + */ +int headerAddOrAppendEntry(Header h, int_32 tag, int_32 type, + const void * p, int_32 c) + /*@modifies h @*/; + +/** \ingroup header + * Add locale specific tag to header. + * A NULL lang is interpreted as the C locale. Here are the rules: + * \verbatim + * - If the tag isn't in the header, it's added with the passed string + * as new value. + * - If the tag occurs multiple times in entry, which tag is affected + * by the operation is undefined. + * - If the tag is in the header w/ this language, the entry is + * *replaced* (like headerModifyEntry()). + * \endverbatim + * This function is intended to just "do the right thing". If you need + * more fine grained control use headerAddEntry() and headerModifyEntry(). + * + * @param h header + * @param tag tag + * @param string tag value + * @param lang locale + * @return 1 on success, 0 on failure + */ +int headerAddI18NString(Header h, int_32 tag, const char * string, + const char * lang) + /*@modifies h @*/; + +/** \ingroup header + * Modify tag in header. + * If there are multiple entries with this tag, the first one gets replaced. + * @param h header + * @param tag tag + * @param type tag value data type + * @param p pointer to tag value(s) + * @param c number of values + * @return 1 on success, 0 on failure + */ +int headerModifyEntry(Header h, int_32 tag, int_32 type, + const void * p, int_32 c) + /*@modifies h @*/; + +/** \ingroup header + * Delete tag in header. + * Removes all entries of type tag from the header, returns 1 if none were + * found. + * + * @param h header + * @param tag tag + * @return 0 on success, 1 on failure (INCONSISTENT) + */ +int headerRemoveEntry(Header h, int_32 tag) + /*@modifies h @*/; + +/** \ingroup header + * Return formatted output string from header tags. + * The returned string must be free()d. + * + * @param h header + * @param fmt format to use + * @param tags array of tag name/value pairs + * @param extensions chained table of formatting extensions. + * @retval errmsg error message (if any) + * @return formatted output string (malloc'ed) + */ +/*@only@*/ char * headerSprintf(Header h, const char * fmt, + const struct headerTagTableEntry * tags, + const struct headerSprintfExtension * extensions, + /*@null@*/ /*@out@*/ errmsg_t * errmsg) + /*@modifies *errmsg @*/; + +#ifdef __cplusplus +} +#endif + +#endif /* H_HDRPROTO */ diff --git a/lib/header.c b/lib/header.c index 3237a9d..65df111 100644 --- a/lib/header.c +++ b/lib/header.c @@ -2,10 +2,6 @@ * \file lib/header.c */ -#undef REMALLOC_HEADER_REGION -#define _DEBUG_SWAB 1 -#define _DEBUG_INDEX 1 - /* RPM - Copyright (C) 1995-2000 Red Hat Software */ /* Data written to file descriptors is in network byte order. */ @@ -14,6 +10,8 @@ #include "system.h" +#define __HEADER_PROTOTYPES__ + #include #include "debug.h" @@ -22,19 +20,18 @@ /*@observer@*/ const char *const tagName(int tag) /*@*/; /*@=redecl@*/ -/* - * Teach header.c about legacy tags. - */ -#define HEADER_OLDFILENAMES 1027 -#define HEADER_BASENAMES 1117 +/*@access entryInfo @*/ +/*@access indexEntry @*/ -#define INDEX_MALLOC_SIZE 8 +/*@access extensionCache @*/ +/*@access sprintfTag @*/ +/*@access sprintfToken @*/ #define PARSER_BEGIN 0 #define PARSER_IN_ARRAY 1 #define PARSER_IN_EXPR 2 -static unsigned char header_magic[8] = { +unsigned char header_magic[8] = { 0x8e, 0xad, 0xe8, 0x01, 0x00, 0x00, 0x00, 0x00 }; @@ -66,6 +63,131 @@ _free(/*@only@*/ /*@null@*/ const void * p) /*@modifies *p @*/ return NULL; } +Header headerFree(Header h) +{ + if (h == NULL || --h->nrefs > 0) + return NULL; /* XXX return previous header? */ + + if (h->index) { + indexEntry entry = h->index; + int i; + for (i = 0; i < h->indexUsed; i++, entry++) { + if (h->region_allocated && ENTRY_IS_REGION(entry)) { + if (entry->length > 0) { + int_32 * ei = entry->data; + ei -= 2; /* XXX HACK: adjust to beginning of header. */ + ei = _free(ei); + } + } else if (!ENTRY_IN_REGION(entry)) { + entry->data = _free(entry->data); + } + entry->data = NULL; + } + h->index = _free(h->index); + } + + /*@-refcounttrans@*/ h = _free(h); /*@=refcounttrans@*/ + return h; +} + +Header headerLink(Header h) +{ + h->nrefs++; + /*@-refcounttrans@*/ return h; /*@=refcounttrans@*/ +} + +/** + */ +static int indexCmp(const void * avp, const void * bvp) /*@*/ +{ + /*@-castexpose@*/ + indexEntry ap = (indexEntry) avp, bp = (indexEntry) bvp; + /*@=castexpose@*/ + return (ap->info.tag - bp->info.tag); +} + +void headerSort(Header h) +{ + if (!h->sorted) { + qsort(h->index, h->indexUsed, sizeof(*h->index), indexCmp); + h->sorted = 1; + } +} + +/** + */ +static int offsetCmp(const void * avp, const void * bvp) /*@*/ +{ + /*@-castexpose@*/ + indexEntry ap = (indexEntry) avp, bp = (indexEntry) bvp; + /*@=castexpose@*/ + int rc = (ap->info.offset - bp->info.offset); + + if (rc == 0) + rc = (ap->info.tag - bp->info.tag); + return rc; +} + +void headerUnsort(Header h) +{ + qsort(h->index, h->indexUsed, sizeof(*h->index), offsetCmp); +} + +unsigned int headerSizeof(Header h, enum hMagic magicp) +{ + indexEntry entry; + unsigned int size = 0; + unsigned int pad = 0; + int i; + + if (h == NULL) + return size; + + headerSort(h); + + switch (magicp) { + case HEADER_MAGIC_YES: + size += sizeof(header_magic); + break; + case HEADER_MAGIC_NO: + break; + } + + size += 2 * sizeof(int_32); /* count of index entries */ + + for (i = 0, entry = h->index; i < h->indexUsed; i++, entry++) { + unsigned diff; + int_32 type; + + /* Regions go in as is ... */ + if (ENTRY_IS_REGION(entry)) { + size += entry->length; + /* XXX Legacy regions do not include the region tag and data. */ + if (i == 0 && h->legacy) + size += sizeof(struct entryInfo) + entry->info.count; + continue; + } + + /* ... and region elements are skipped. */ + if (entry->info.offset < 0) + continue; + + /* Alignment */ + type = entry->info.type; + if (typeSizes[type] > 1) { + diff = typeSizes[type] - (size % typeSizes[type]); + if (diff != typeSizes[type]) { + size += diff; + pad += diff; + } + } + + size += sizeof(struct entryInfo) + entry->length; + } + + return size; +} + /** * Return length of entry data. * @param type entry data type @@ -75,7 +197,7 @@ _free(/*@only@*/ /*@null@*/ const void * p) /*@modifies *p @*/ * @return no. bytes in data */ /*@mayexit@*/ -static int dataLength(int_32 type, const void * p, int_32 count, int onDisk) +static int dataLength(int_32 type, hPTR_t p, int_32 count, int onDisk) /*@modifies fileSystem @*/ { int length = 0; @@ -130,33 +252,8 @@ static int dataLength(int_32 type, const void * p, int_32 count, int onDisk) return length; } -/** - * Swap int_32 and int_16 arrays within header region. - * - * This code is way more twisty than I would like. - * - * A bug with RPM_I18NSTRING_TYPE in rpm-2.5.x (fixed in August 1998) - * causes the offset and length of elements in a header region to disagree - * regarding the total length of the region data. - * - * The "fix" is to compute the size using both offset and length and - * return the larger of the two numbers as the size of the region. - * Kinda like computing left and right Riemann sums of the data elements - * to determine the size of a data structure, go figger :-). - * - * There's one other twist if a header region tag is in the set to be swabbed, - * as the data for a header region is located after all other tag data. - * - * @param entry header entry - * @param il no. of entries - * @param dl start no. bytes of data - * @param pe header physical entry pointer (swapped) - * @param dataStart header data - * @param regionid region offset - * @return no. bytes of data in region, -1 on error - */ -static int regionSwab(/*@null@*/ struct indexEntry * entry, int il, int dl, - const struct entryInfo * pe, char * dataStart, int regionid) +int regionSwab(/*@null@*/ indexEntry entry, int il, int dl, + entryInfo pe, char * dataStart, int regionid) /*@modifies *entry, *dataStart @*/ { char * tprev = NULL; @@ -224,369 +321,10 @@ static int regionSwab(/*@null@*/ struct indexEntry * entry, int il, int dl, return dl; } -/** - * Retrieve data from header entry. - * @todo Permit retrieval of regions other than HEADER_IMUTABLE. - * @param entry header entry - * @retval type address of type (or NULL) - * @retval p address of data (or NULL) - * @retval c address of count (or NULL) - * @param minMem string pointers refer to header memory? - * @return 1 on success, otherwise error. - */ -static int copyEntry(const struct indexEntry * entry, - /*@null@*/ /*@out@*/ int_32 * type, - /*@null@*/ /*@out@*/ const void ** p, - /*@null@*/ /*@out@*/ int_32 * c, - int minMem) - /*@modifies *type, *p, *c @*/ -{ - int_32 count = entry->info.count; - int rc = 1; /* XXX 1 on success. */ - - if (p) - switch (entry->info.type) { - case RPM_BIN_TYPE: - /* XXX this only works for HEADER_IMMUTABLE */ - if (ENTRY_IS_REGION(entry)) { - int_32 * ei = ((int_32 *)entry->data) - 2; - struct entryInfo * pe = (struct entryInfo *) (ei + 2); - char * dataStart = (char *) (pe + ntohl(ei[0])); - int_32 rdl = -entry->info.offset; /* negative offset */ - int_32 ril = rdl/sizeof(*pe); - - count = 2 * sizeof(*ei) + (ril * sizeof(*pe)) + - entry->rdlen + REGION_TAG_COUNT; - *p = xmalloc(count); - ei = (int_32 *) *p; - ei[0] = htonl(ril); - ei[1] = htonl(entry->rdlen + REGION_TAG_COUNT); - pe = (struct entryInfo *) memcpy(ei + 2, pe, (ril * sizeof(*pe))); - dataStart = (char *) memcpy(pe + ril, dataStart, - (entry->rdlen + REGION_TAG_COUNT)); - - rc = regionSwab(NULL, ril, 0, pe, dataStart, 0); - /* XXX 1 on success. */ - rc = (rc < 0) ? 0 : 1; - } else { - count = entry->length; - *p = (!minMem - ? memcpy(xmalloc(count), entry->data, count) - : entry->data); - } - break; - case RPM_STRING_TYPE: - if (count == 1) { - *p = entry->data; - break; - } - /*@fallthrough@*/ - case RPM_STRING_ARRAY_TYPE: - case RPM_I18NSTRING_TYPE: - { const char ** ptrEntry; - int tableSize = count * sizeof(char *); - char * t; - int i; - - /*@-mods@*/ - if (minMem) { - *p = xmalloc(tableSize); - ptrEntry = (const char **) *p; - t = entry->data; - } else { - t = xmalloc(tableSize + entry->length); - *p = (void *)t; - ptrEntry = (const char **) *p; - t += tableSize; - memcpy(t, entry->data, entry->length); - } - /*@=mods@*/ - for (i = 0; i < count; i++) { - *ptrEntry++ = t; - t = strchr(t, 0); - t++; - } - } break; - - default: - *p = entry->data; - break; - } - if (type) *type = entry->info.type; - if (c) *c = count; - return rc; -} - -/** - * Header tag iterator data structure. - */ -struct headerIteratorS { - Header h; /*!< Header being iterated. */ - int next_index; /*!< Next tag index. */ -}; - -HeaderIterator headerInitIterator(Header h) -{ - HeaderIterator hi = xmalloc(sizeof(struct headerIteratorS)); - - headerSort(h); - - hi->h = headerLink(h); - hi->next_index = 0; - return hi; -} - -void headerFreeIterator(HeaderIterator hi) -{ - hi->h = headerFree(hi->h); - hi = _free(hi); -} - -int headerNextIterator(HeaderIterator hi, - int_32 * tag, int_32 * type, const void ** p, int_32 * c) -{ - Header h = hi->h; - int slot = hi->next_index; - struct indexEntry * entry = NULL; - int rc; - - for (slot = hi->next_index; slot < h->indexUsed; slot++) { - entry = h->index + slot; - if (!ENTRY_IS_REGION(entry)) - break; - } - hi->next_index = slot; - if (entry == NULL || slot >= h->indexUsed) - return 0; - hi->next_index++; - - if (tag) - *tag = entry->info.tag; - - rc = copyEntry(entry, type, p, c, 0); - - /* XXX 1 on success */ - return ((rc == 1) ? 1 : 0); -} - -/** - */ -static int indexCmp(const void *avp, const void *bvp) /*@*/ -{ - const struct indexEntry * ap = avp, * bp = bvp; - return (ap->info.tag - bp->info.tag); -} - -void headerSort(Header h) -{ - if (!h->sorted) { - qsort(h->index, h->indexUsed, sizeof(*h->index), indexCmp); - h->sorted = 1; - } -} - -/** - */ -static int offsetCmp(const void *avp, const void *bvp) /*@*/ -{ - const struct indexEntry * ap = avp, * bp = bvp; - int rc = (ap->info.offset - bp->info.offset); - - if (rc == 0) - rc = (ap->info.tag - bp->info.tag); - return rc; -} - -void headerUnsort(Header h) -{ - qsort(h->index, h->indexUsed, sizeof(*h->index), offsetCmp); -} - -Header headerCopy(Header h) -{ - Header nh = headerNew(); - HeaderIterator hi; - int_32 tag, type, count; - const void *ptr; - - for (hi = headerInitIterator(h); - headerNextIterator(hi, &tag, &type, &ptr, &count); - ptr = headerFreeData((void *)ptr, type)) - { - if (ptr) (void) headerAddEntry(nh, tag, type, ptr, count); - } - headerFreeIterator(hi); - - return headerReload(nh, HEADER_IMAGE); -} - -Header headerLoad(void *uh) -{ - int_32 *ei = (int_32 *) uh; - int_32 il = ntohl(ei[0]); /* index length */ - int_32 dl = ntohl(ei[1]); /* data length */ - int pvlen = sizeof(il) + sizeof(dl) + - (il * sizeof(struct entryInfo)) + dl; -#ifdef REMALLOC_HEADER_REGION - void * pv = memcpy(xmalloc(pvlen), uh, pvlen); -#else - void * pv = uh; -#endif - Header h = xcalloc(1, sizeof(*h)); - struct entryInfo * pe; - char * dataStart; - struct indexEntry * entry; - int rdlen; - int i; - - ei = (int_32 *) pv; - pe = (struct entryInfo *) &ei[2]; - dataStart = (char *) (pe + il); - - h->indexAlloced = il + 1; - h->indexUsed = il; - h->index = xcalloc(h->indexAlloced, sizeof(*h->index)); - h->sorted = 1; -#ifdef REMALLOC_HEADER_REGION - h->region_allocated = 1; -#else - h->region_allocated = 0; -#endif - h->nrefs = 1; - - /* - * XXX XFree86-libs, ash, and pdksh from Red Hat 5.2 have bogus - * %verifyscript tag that needs to be diddled. - */ - if (ntohl(pe->tag) == 15 && - ntohl(pe->type) == RPM_STRING_TYPE && - ntohl(pe->count) == 1) - { - pe->tag = htonl(1079); - } - - entry = h->index; - i = 0; - if (!(htonl(pe->tag) < HEADER_I18NTABLE)) { - h->legacy = 1; - entry->info.type = REGION_TAG_TYPE; - entry->info.tag = HEADER_IMAGE; - entry->info.count = REGION_TAG_COUNT; - entry->info.offset = ((char *)pe - dataStart); /* negative offset */ - - entry->data = pe; - entry->length = pvlen - sizeof(il) - sizeof(dl); - rdlen = regionSwab(entry+1, il, 0, pe, dataStart, entry->info.offset); - if (rdlen != dl) goto errxit; - entry->rdlen = rdlen; - entry++; - h->indexUsed++; - } else { - int nb = ntohl(pe->count); - int_32 rdl; - int_32 ril; - - h->legacy = 0; - entry->info.type = htonl(pe->type); - if (entry->info.type < RPM_MIN_TYPE || entry->info.type > RPM_MAX_TYPE) - return NULL; - entry->info.count = htonl(pe->count); - - { int off = ntohl(pe->offset); - if (off) { - int_32 * stei = memcpy(alloca(nb), dataStart + off, nb); - rdl = -ntohl(stei[2]); /* negative offset */ - ril = rdl/sizeof(*pe); - entry->info.tag = htonl(pe->tag); - } else { - ril = il; - rdl = (ril * sizeof(struct entryInfo)); - entry->info.tag = HEADER_IMAGE; - } - } - entry->info.offset = -rdl; /* negative offset */ - - entry->data = pe; - entry->length = pvlen - sizeof(il) - sizeof(dl); - rdlen = regionSwab(entry+1, ril-1, 0, pe+1, dataStart, entry->info.offset); - if (rdlen < 0) goto errxit; - entry->rdlen = rdlen; - - if (ril < h->indexUsed) { - struct indexEntry * newEntry = entry + ril; - int ne = (h->indexUsed - ril); - int rid = entry->info.offset+1; - int rc; - - /* Load dribble entries from region. */ - rc = regionSwab(newEntry, ne, 0, pe+ril, dataStart, rid); - if (rc < 0) goto errxit; - rdlen += rc; - - { struct indexEntry * firstEntry = newEntry; - int save = h->indexUsed; - int j; - - /* Dribble entries replace duplicate region entries. */ - h->indexUsed -= ne; - for (j = 0; j < ne; j++, newEntry++) { - (void) headerRemoveEntry(h, newEntry->info.tag); - if (newEntry->info.tag == HEADER_BASENAMES) - (void) headerRemoveEntry(h, HEADER_OLDFILENAMES); - } - - /* If any duplicate entries were replaced, move new entries down. */ - if (h->indexUsed < (save - ne)) { - memmove(h->index + h->indexUsed, firstEntry, - (ne * sizeof(*entry))); - } - h->indexUsed += ne; - } - } - } - - h->sorted = 0; - headerSort(h); - - return h; - -errxit: - /*@-usereleased@*/ - if (h) { - h->index = _free(h->index); - /*@-refcounttrans@*/ - h = _free(h); - /*@=refcounttrans@*/ - } - /*@=usereleased@*/ - /*@-refcounttrans@*/ - return h; - /*@=refcounttrans@*/ -} - -Header headerCopyLoad(void *uh) -{ - int_32 *ei = (int_32 *) uh; - int_32 il = ntohl(ei[0]); /* index length */ - int_32 dl = ntohl(ei[1]); /* data length */ - int pvlen = sizeof(il) + sizeof(dl) + - (il * sizeof(struct entryInfo)) + dl; - void * nuh = memcpy(xmalloc(pvlen), uh, pvlen); - Header h; - - h = headerLoad(nuh); - if (h == NULL) { - nuh = _free(nuh); - return h; - } - h->region_allocated = 1; - return h; -} - #if 0 int headerDrips(const Header h) { - struct indexEntry * entry; + indexEntry entry; int i; for (i = 0, entry = h->index; i < h->indexUsed; i++, entry++) { @@ -610,21 +348,18 @@ int headerDrips(const Header h) } #endif -/** - */ -static /*@only@*/ /*@null@*/ void * doHeaderUnload(Header h, - /*@out@*/ int * lengthPtr) +/*@only@*/ /*@null@*/ void * doHeaderUnload(Header h, /*@out@*/ int * lengthPtr) /*@modifies h, *lengthPtr @*/ { int_32 * ei = NULL; - struct entryInfo * pe; + entryInfo pe; char * dataStart; char * te; unsigned pad; unsigned len; int_32 il = 0; int_32 dl = 0; - struct indexEntry * entry; + indexEntry entry; int_32 type; int i; int drlen, ndribbles; @@ -704,7 +439,7 @@ static /*@only@*/ /*@null@*/ void * doHeaderUnload(Header h, ei[0] = htonl(il); ei[1] = htonl(dl); - pe = (struct entryInfo *) &ei[2]; + pe = (entryInfo) &ei[2]; dataStart = te = (char *) (pe + il); pad = 0; @@ -757,7 +492,9 @@ t = te; memcpy(pe+1, src + sizeof(*pe), ((ril-1) * sizeof(*pe))); memcpy(te, src + (ril * sizeof(*pe)), rdlen+entry->info.count+drlen); te += rdlen; - { struct entryInfo * se = (struct entryInfo *)src; + { /*@-castexpose@*/ + entryInfo se = (entryInfo)src; + /*@=castexpose@*/ int off = ntohl(se->offset); pe->offset = (off) ? htonl(te - dataStart) : htonl(off); } @@ -878,92 +615,22 @@ Header headerReload(Header h, int tag) return nh; } -int headerWrite(FD_t fd, Header h, enum hMagic magicp) -{ - ssize_t nb; - int length; - const void * uh; - - if (h == NULL) - return 1; - uh = doHeaderUnload(h, &length); - if (uh == NULL) - return 1; - switch (magicp) { - case HEADER_MAGIC_YES: - nb = Fwrite(header_magic, sizeof(char), sizeof(header_magic), fd); - if (nb != sizeof(header_magic)) - goto exit; - break; - case HEADER_MAGIC_NO: - break; - } - - nb = Fwrite(uh, sizeof(char), length, fd); - -exit: - uh = _free(uh); - return (nb == length ? 0 : 1); -} - -Header headerRead(FD_t fd, enum hMagic magicp) +Header headerCopy(Header h) { - int_32 block[4]; - int_32 reserved; - int_32 * ei = NULL; - int_32 il; - int_32 dl; - int_32 magic; - Header h = NULL; - int len; - int i; - - memset(block, 0, sizeof(block)); - i = 2; - if (magicp == HEADER_MAGIC_YES) - i += 2; - - if (timedRead(fd, (char *)block, i*sizeof(*block)) != (i * sizeof(*block))) - goto exit; - - i = 0; - - if (magicp == HEADER_MAGIC_YES) { - magic = block[i++]; - if (memcmp(&magic, header_magic, sizeof(magic))) - goto exit; - reserved = block[i++]; + Header nh = headerNew(); + HeaderIterator hi; + int_32 tag, type, count; + hPTR_t ptr; + + for (hi = headerInitIterator(h); + headerNextIterator(hi, &tag, &type, &ptr, &count); + ptr = headerFreeData((void *)ptr, type)) + { + if (ptr) (void) headerAddEntry(nh, tag, type, ptr, count); } - - il = ntohl(block[i++]); - dl = ntohl(block[i++]); - - len = sizeof(il) + sizeof(dl) + (il * sizeof(struct entryInfo)) + dl; - - /* - * XXX Limit total size of header to 32Mb (~16 times largest known size). - */ - if (len > (32*1024*1024)) - goto exit; - - ei = xmalloc(len); - ei[0] = htonl(il); - ei[1] = htonl(dl); - len -= sizeof(il) + sizeof(dl); + headerFreeIterator(hi); - if (timedRead(fd, (char *)&ei[2], len) != len) - goto exit; - - h = headerLoad(ei); - -exit: - if (h) { - if (h->region_allocated) - ei = _free(ei); - h->region_allocated = 1; - } else if (ei) - ei = _free(ei); - return h; + return headerReload(nh, HEADER_IMAGE); } /** @@ -974,10 +641,10 @@ exit: * @return header entry */ static /*@null@*/ -struct indexEntry * findEntry(/*@null@*/ Header h, int_32 tag, int_32 type) +indexEntry findEntry(/*@null@*/ Header h, int_32 tag, int_32 type) /*@modifies h @*/ { - struct indexEntry * entry, * entry2, * last; + indexEntry entry, entry2, last; struct indexEntry key; if (h == NULL) return NULL; @@ -1017,28 +684,91 @@ int headerIsEntry(Header h, int_32 tag) /*@=mods@*/ } -int headerGetRawEntry(Header h, int_32 tag, int_32 * type, const void ** p, - int_32 *c) +int copyEntry(const indexEntry entry, + /*@null@*/ /*@out@*/ hTYP_t type, + /*@null@*/ /*@out@*/ hPTR_t * p, + /*@null@*/ /*@out@*/ hCNT_t c, + int minMem) + /*@modifies *type, *p, *c @*/ { - struct indexEntry * entry; - int rc; + int_32 count = entry->info.count; + int rc = 1; /* XXX 1 on success. */ - if (p == NULL) return headerIsEntry(h, tag); + if (p) + switch (entry->info.type) { + case RPM_BIN_TYPE: + /* XXX this only works for HEADER_IMMUTABLE */ + if (ENTRY_IS_REGION(entry)) { + int_32 * ei = ((int_32 *)entry->data) - 2; + /*@-castexpose@*/ + entryInfo pe = (entryInfo) (ei + 2); + /*@=castexpose@*/ + char * dataStart = (char *) (pe + ntohl(ei[0])); + int_32 rdl = -entry->info.offset; /* negative offset */ + int_32 ril = rdl/sizeof(*pe); + + count = 2 * sizeof(*ei) + (ril * sizeof(*pe)) + + entry->rdlen + REGION_TAG_COUNT; + *p = xmalloc(count); + ei = (int_32 *) *p; + ei[0] = htonl(ril); + ei[1] = htonl(entry->rdlen + REGION_TAG_COUNT); + /*@-castexpose@*/ + pe = (entryInfo) memcpy(ei + 2, pe, (ril * sizeof(*pe))); + /*@=castexpose@*/ + dataStart = (char *) memcpy(pe + ril, dataStart, + (entry->rdlen + REGION_TAG_COUNT)); - /* First find the tag */ - /*@-mods@*/ /*@ FIX: h modified by sort. */ - entry = findEntry(h, tag, RPM_NULL_TYPE); - /*@=mods@*/ - if (!entry) { - if (p) *p = NULL; - if (c) *c = 0; - return 0; - } + rc = regionSwab(NULL, ril, 0, pe, dataStart, 0); + /* XXX 1 on success. */ + rc = (rc < 0) ? 0 : 1; + } else { + count = entry->length; + *p = (!minMem + ? memcpy(xmalloc(count), entry->data, count) + : entry->data); + } + break; + case RPM_STRING_TYPE: + if (count == 1) { + *p = entry->data; + break; + } + /*@fallthrough@*/ + case RPM_STRING_ARRAY_TYPE: + case RPM_I18NSTRING_TYPE: + { const char ** ptrEntry; + int tableSize = count * sizeof(char *); + char * t; + int i; - rc = copyEntry(entry, type, p, c, 0); + /*@-mods@*/ + if (minMem) { + *p = xmalloc(tableSize); + ptrEntry = (const char **) *p; + t = entry->data; + } else { + t = xmalloc(tableSize + entry->length); + *p = (void *)t; + ptrEntry = (const char **) *p; + t += tableSize; + memcpy(t, entry->data, entry->length); + } + /*@=mods@*/ + for (i = 0; i < count; i++) { + *ptrEntry++ = t; + t = strchr(t, 0); + t++; + } + } break; - /* XXX 1 on success */ - return ((rc == 1) ? 1 : 0); + default: + *p = entry->data; + break; + } + if (type) *type = entry->info.type; + if (c) *c = count; + return rc; } /** @@ -1132,20 +862,24 @@ static int headerMatchLocale(const char *td, const char *l, const char *le) * @return matching i18n string (or 1st string if no match) */ /*@dependent@*/ static char * -headerFindI18NString(Header h, struct indexEntry *entry) +headerFindI18NString(Header h, indexEntry entry) { const char *lang, *l, *le; - struct indexEntry * table; + indexEntry table; /* XXX Drepper sez' this is the order. */ if ((lang = getenv("LANGUAGE")) == NULL && (lang = getenv("LC_ALL")) == NULL && (lang = getenv("LC_MESSAGES")) == NULL && (lang = getenv("LANG")) == NULL) - /*@-retalias@*/ return entry->data; /*@=retalias@*/ + /*@-retalias -retexpose@*/ + return entry->data; + /*@=retalias =retexpose@*/ if ((table = findEntry(h, HEADER_I18NTABLE, RPM_STRING_ARRAY_TYPE)) == NULL) - /*@-retalias@*/ return entry->data; /*@=retalias@*/ + /*@-retalias -retexpose@*/ + return entry->data; + /*@=retalias =retexpose@*/ for (l = lang; *l != '\0'; l = le) { const char *td; @@ -1170,7 +904,9 @@ headerFindI18NString(Header h, struct indexEntry *entry) } } - /*@-retalias@*/ return entry->data; /*@=retalias@*/ + /*@-retalias -retexpose@*/ + return entry->data; + /*@=retalias =retexpose@*/ } /** @@ -1183,13 +919,14 @@ headerFindI18NString(Header h, struct indexEntry *entry) * @param minMem string pointers reference header memory? * @return 1 on success, 0 on not found */ -static int intGetEntry(Header h, int_32 tag, /*@null@*/ /*@out@*/ int_32 * type, - /*@null@*/ /*@out@*/ const void ** p, - /*@null@*/ /*@out@*/ int_32 *c, - int minMem) - /*@modifies *type, *p, *c @*/ +static int intGetEntry(Header h, int_32 tag, + /*@null@*/ /*@out@*/ hTAG_t type, + /*@null@*/ /*@out@*/ hPTR_t * p, + /*@null@*/ /*@out@*/ hCNT_t c, + int minMem) + /*@modifies *type, *p, *c @*/ { - struct indexEntry * entry; + indexEntry entry; int rc; /* First find the tag */ @@ -1221,128 +958,46 @@ static int intGetEntry(Header h, int_32 tag, /*@null@*/ /*@out@*/ int_32 * type, return ((rc == 1) ? 1 : 0); } -int headerGetEntryMinMemory(Header h, int_32 tag, int_32 *type, const void **p, - int_32 *c) -{ - return intGetEntry(h, tag, type, p, c, 1); -} - -int headerGetEntry(Header h, int_32 tag, int_32 * type, void **p, int_32 * c) +int headerGetEntry(Header h, int_32 tag, hTYP_t type, void **p, hCNT_t c) { - return intGetEntry(h, tag, type, (const void **)p, c, 0); + return intGetEntry(h, tag, type, (hPTR_t *)p, c, 0); } -Header headerNew() +int headerGetEntryMinMemory(Header h, int_32 tag, hTYP_t type, hPTR_t * p, + hCNT_t c) { - Header h = xcalloc(1, sizeof(*h)); - - h->indexAlloced = INDEX_MALLOC_SIZE; - h->indexUsed = 0; - h->region_allocated = 0; - h->sorted = 1; - h->legacy = 0; - h->nrefs = 1; - - h->index = (h->indexAlloced - ? xcalloc(h->indexAlloced, sizeof(*h->index)) - : NULL); - - return h; -} - -Header headerFree(Header h) -{ - if (h == NULL || --h->nrefs > 0) - return NULL; /* XXX return previous header? */ - - if (h->index) { - struct indexEntry * entry = h->index; - int i; - for (i = 0; i < h->indexUsed; i++, entry++) { - if (h->region_allocated && ENTRY_IS_REGION(entry)) { - if (entry->length > 0) { - int_32 * ei = entry->data; - ei -= 2; /* XXX HACK: adjust to beginning of header. */ - ei = _free(ei); - } - } else if (!ENTRY_IN_REGION(entry)) { - entry->data = _free(entry->data); - } - entry->data = NULL; - } - h->index = _free(h->index); - } - - /*@-refcounttrans@*/ h = _free(h); /*@=refcounttrans@*/ - return h; -} - -Header headerLink(Header h) -{ - h->nrefs++; - /*@-refcounttrans@*/ return h; /*@=refcounttrans@*/ + return intGetEntry(h, tag, type, p, c, 1); } -unsigned int headerSizeof(Header h, enum hMagic magicp) +int headerGetRawEntry(Header h, int_32 tag, int_32 * type, hPTR_t * p, + int_32 * c) { - struct indexEntry * entry; - unsigned int size = 0; - unsigned int pad = 0; - int i; - - if (h == NULL) - return size; + indexEntry entry; + int rc; - headerSort(h); + if (p == NULL) return headerIsEntry(h, tag); - switch (magicp) { - case HEADER_MAGIC_YES: - size += sizeof(header_magic); - break; - case HEADER_MAGIC_NO: - break; + /* First find the tag */ + /*@-mods@*/ /*@ FIX: h modified by sort. */ + entry = findEntry(h, tag, RPM_NULL_TYPE); + /*@=mods@*/ + if (!entry) { + if (p) *p = NULL; + if (c) *c = 0; + return 0; } - size += 2 * sizeof(int_32); /* count of index entries */ - - for (i = 0, entry = h->index; i < h->indexUsed; i++, entry++) { - unsigned diff; - int_32 type; - - /* Regions go in as is ... */ - if (ENTRY_IS_REGION(entry)) { - size += entry->length; - /* XXX Legacy regions do not include the region tag and data. */ - if (i == 0 && h->legacy) - size += sizeof(struct entryInfo) + entry->info.count; - continue; - } - - /* ... and region elements are skipped. */ - if (entry->info.offset < 0) - continue; - - /* Alignment */ - type = entry->info.type; - if (typeSizes[type] > 1) { - diff = typeSizes[type] - (size % typeSizes[type]); - if (diff != typeSizes[type]) { - size += diff; - pad += diff; - } - } - - size += sizeof(struct entryInfo) + entry->length; - } + rc = copyEntry(entry, type, p, c, 0); - return size; + /* XXX 1 on success */ + return ((rc == 1) ? 1 : 0); } /** */ static void copyData(int_32 type, /*@out@*/ void * dstPtr, const void * srcPtr, - int_32 c, int dataLength) - /*@modifies *dstPtr @*/ + int_32 c, int dataLength) + /*@modifies *dstPtr @*/ { const char ** src; char * dst; @@ -1379,9 +1034,9 @@ static void copyData(int_32 type, /*@out@*/ void * dstPtr, const void * srcPtr, * @retval lengthPtr no. bytes in returned data * @return (malloc'ed) copy of entry data */ -static void * grabData(int_32 type, const void * p, int_32 c, - /*@out@*/ int * lengthPtr) - /*@modifies *lengthPtr @*/ +static void * grabData(int_32 type, hPTR_t p, int_32 c, + /*@out@*/ int * lengthPtr) + /*@modifies *lengthPtr @*/ { int length = dataLength(type, p, c, 0); void * data = xmalloc(length); @@ -1393,9 +1048,9 @@ static void * grabData(int_32 type, const void * p, int_32 c, return data; } -int headerAddEntry(Header h, int_32 tag, int_32 type, const void *p, int_32 c) +int headerAddEntry(Header h, int_32 tag, int_32 type, hPTR_t p, int_32 c) { - struct indexEntry *entry; + indexEntry entry; /* Count must always be >= 1 for headerAddEntry. */ if (c <= 0) @@ -1422,9 +1077,52 @@ int headerAddEntry(Header h, int_32 tag, int_32 type, const void *p, int_32 c) return 1; } +int headerAppendEntry(Header h, int_32 tag, int_32 type, + hPTR_t p, int_32 c) +{ + indexEntry entry; + int length; + + /* First find the tag */ + entry = findEntry(h, tag, type); + if (!entry) + return 0; + + if (type == RPM_STRING_TYPE || type == RPM_I18NSTRING_TYPE) { + /* we can't do this */ + return 0; + } + + length = dataLength(type, p, c, 0); + + if (ENTRY_IN_REGION(entry)) { + char * t = xmalloc(entry->length + length); + memcpy(t, entry->data, entry->length); + entry->data = t; + entry->info.offset = 0; + } else + entry->data = xrealloc(entry->data, entry->length + length); + + copyData(type, ((char *) entry->data) + entry->length, p, c, length); + + entry->length += length; + + entry->info.count += c; + + return 1; +} + +int headerAddOrAppendEntry(Header h, int_32 tag, int_32 type, + hPTR_t p, int_32 c) +{ + return (findEntry(h, tag, type) + ? headerAppendEntry(h, tag, type, p, c) + : headerAddEntry(h, tag, type, p, c)); +} + int headerAddI18NString(Header h, int_32 tag, const char * string, const char * lang) { - struct indexEntry * table, * entry; + indexEntry table, entry; const char ** strArray; int length; int ghosts; @@ -1550,10 +1248,9 @@ int headerAddI18NString(Header h, int_32 tag, const char * string, const char * return 0; } -int headerModifyEntry(Header h, int_32 tag, int_32 type, - const void * p, int_32 c) +int headerModifyEntry(Header h, int_32 tag, int_32 type, hPTR_t p, int_32 c) { - struct indexEntry *entry; + indexEntry entry; void * oldData; /* First find the tag */ @@ -1581,53 +1278,10 @@ int headerModifyEntry(Header h, int_32 tag, int_32 type, return 1; } -int headerAddOrAppendEntry(Header h, int_32 tag, int_32 type, - const void * p, int_32 c) -{ - return (findEntry(h, tag, type) - ? headerAppendEntry(h, tag, type, p, c) - : headerAddEntry(h, tag, type, p, c)); -} - -int headerAppendEntry(Header h, int_32 tag, int_32 type, - const void * p, int_32 c) -{ - struct indexEntry *entry; - int length; - - /* First find the tag */ - entry = findEntry(h, tag, type); - if (!entry) - return 0; - - if (type == RPM_STRING_TYPE || type == RPM_I18NSTRING_TYPE) { - /* we can't do this */ - return 0; - } - - length = dataLength(type, p, c, 0); - - if (ENTRY_IN_REGION(entry)) { - char * t = xmalloc(entry->length + length); - memcpy(t, entry->data, entry->length); - entry->data = t; - entry->info.offset = 0; - } else - entry->data = xrealloc(entry->data, entry->length + length); - - copyData(type, ((char *) entry->data) + entry->length, p, c, length); - - entry->length += length; - - entry->info.count += c; - - return 1; -} - int headerRemoveEntry(Header h, int_32 tag) { - struct indexEntry * last = h->index + h->indexUsed; - struct indexEntry * entry, * first; + indexEntry last = h->index + h->indexUsed; + indexEntry entry, first; int ne; entry = findEntry(h, tag, RPM_NULL_TYPE); @@ -1678,9 +1332,13 @@ static char escapedChar(const char ch) /*@*/ } /** + * Destroy headerSprintf format array. + * @param format sprintf format array + * @param num number of elements + * @return NULL always */ -static /*@null@*/ struct sprintfToken * -freeFormat( /*@only@*/ /*@null@*/ struct sprintfToken * format, int num) +static /*@null@*/ sprintfToken +freeFormat( /*@only@*/ /*@null@*/ sprintfToken format, int num) /*@modifies *format @*/ { int i; @@ -1714,14 +1372,14 @@ freeFormat( /*@only@*/ /*@null@*/ struct sprintfToken * format, int num) /** */ -static void findTag(char * name, const struct headerTagTableEntry * tags, - const struct headerSprintfExtension * extensions, - /*@out@*/const struct headerTagTableEntry ** tagMatch, - /*@out@*/const struct headerSprintfExtension ** extMatch) +static void findTag(char * name, const headerTagTableEntry tags, + const headerSprintfExtension extensions, + /*@out@*/ headerTagTableEntry * tagMatch, + /*@out@*/ headerSprintfExtension * extMatch) /*@modifies *tagMatch, *extMatch @*/ { - const struct headerTagTableEntry * entry; - const struct headerSprintfExtension * ext; + headerTagTableEntry entry; + headerSprintfExtension ext; const char * tagname; *tagMatch = NULL; @@ -1765,27 +1423,27 @@ static void findTag(char * name, const struct headerTagTableEntry * tags, } /* forward ref */ -static int parseExpression(struct sprintfToken * token, char * str, - const struct headerTagTableEntry * tags, - const struct headerSprintfExtension * extensions, - /*@out@*/char ** endPtr, /*@null@*/ /*@out@*/ errmsg_t * errmsg) - /*@modifies str, *str, *token, *endPtr, *errmsg @*/; +static int parseExpression(sprintfToken token, char * str, + const headerTagTableEntry tags, + const headerSprintfExtension extensions, + /*@out@*/char ** endPtr, /*@null@*/ /*@out@*/ errmsg_t * errmsg) + /*@modifies str, *str, *token, *endPtr, *errmsg @*/; /** */ -static int parseFormat(char * str, const struct headerTagTableEntry * tags, - const struct headerSprintfExtension * extensions, - /*@out@*/struct sprintfToken ** formatPtr, /*@out@*/int * numTokensPtr, - /*@null@*/ /*@out@*/char ** endPtr, int state, - /*@null@*/ /*@out@*/errmsg_t * errmsg) - /*@modifies str, *str, *formatPtr, *numTokensPtr, *endPtr, *errmsg @*/ +static int parseFormat(char * str, const headerTagTableEntry tags, + const headerSprintfExtension extensions, + /*@out@*/sprintfToken * formatPtr, /*@out@*/int * numTokensPtr, + /*@null@*/ /*@out@*/ char ** endPtr, int state, + /*@null@*/ /*@out@*/ errmsg_t * errmsg) + /*@modifies str, *str, *formatPtr, *numTokensPtr, *endPtr, *errmsg @*/ { char * chptr, * start, * next, * dst; - struct sprintfToken * format; + sprintfToken format; int numTokens; int currToken; - const struct headerTagTableEntry * tag; - const struct headerSprintfExtension * ext; + headerTagTableEntry tag; + headerSprintfExtension ext; int i; int done = 0; @@ -1809,9 +1467,9 @@ static int parseFormat(char * str, const struct headerTagTableEntry * tags, if (currToken < 0 || format[currToken].type != PTOK_STRING) { currToken++; format[currToken].type = PTOK_STRING; - /*@-temptrans@*/ + /*@-temptrans -assignexpose@*/ dst = format[currToken].u.string.string = start; - /*@=temptrans@*/ + /*@=temptrans =assignexpose@*/ } start++; @@ -1830,7 +1488,8 @@ static int parseFormat(char * str, const struct headerTagTableEntry * tags, start++; if (parseExpression(format + currToken, start, tags, - extensions, &newEnd, errmsg)) { + extensions, &newEnd, errmsg)) + { format = freeFormat(format, numTokens); return 1; } @@ -1838,7 +1497,9 @@ static int parseFormat(char * str, const struct headerTagTableEntry * tags, break; /* out of switch */ } + /*@-assignexpose@*/ format[currToken].u.tag.format = start; + /*@=assignexpose@*/ format[currToken].u.tag.pad = 0; format[currToken].u.tag.justOne = 0; format[currToken].u.tag.arrayCount = 0; @@ -1896,7 +1557,9 @@ static int parseFormat(char * str, const struct headerTagTableEntry * tags, format = freeFormat(format, numTokens); return 1; } + /*@-assignexpose@*/ format[currToken].u.tag.type = chptr; + /*@=assignexpose@*/ } else { format[currToken].u.tag.type = NULL; } @@ -1984,9 +1647,9 @@ static int parseFormat(char * str, const struct headerTagTableEntry * tags, if (currToken < 0 || format[currToken].type != PTOK_STRING) { currToken++; format[currToken].type = PTOK_STRING; - /*@-temptrans@*/ + /*@-temptrans -assignexpose@*/ dst = format[currToken].u.string.string = start; - /*@=temptrans@*/ + /*@=temptrans =assignexpose@*/ } if (*start == '\\') { @@ -2018,13 +1681,14 @@ static int parseFormat(char * str, const struct headerTagTableEntry * tags, /** */ -static int parseExpression(struct sprintfToken * token, char * str, - const struct headerTagTableEntry * tags, - const struct headerSprintfExtension * extensions, - /*@out@*/ char ** endPtr, /*@null@*/ /*@out@*/ errmsg_t * errmsg) +static int parseExpression(sprintfToken token, char * str, + const headerTagTableEntry tags, + const headerSprintfExtension extensions, + /*@out@*/ char ** endPtr, + /*@null@*/ /*@out@*/ errmsg_t * errmsg) { - const struct headerTagTableEntry * tag; - const struct headerSprintfExtension * ext; + headerTagTableEntry tag; + headerSprintfExtension ext; char * chptr; char * end; @@ -2141,11 +1805,14 @@ static int parseExpression(struct sprintfToken * token, char * str, } /** + * @return 0 on success, 1 on failure */ static int getExtension(Header h, headerTagTagFunction fn, - /*@out@*/ int_32 * typeptr, /*@out@*/ const void ** data, - /*@out@*/ int_32 * countptr, struct extensionCache * ext) - /*@modifies *typeptr, *data, *countptr, ext->avail @*/ + /*@out@*/ hTYP_t typeptr, + /*@out@*/ hPTR_t * data, + /*@out@*/ hCNT_t countptr, + extensionCache ext) + /*@modifies *typeptr, *data, *countptr, ext @*/ { if (!ext->avail) { if (fn(h, &ext->type, &ext->data, &ext->count, &ext->freeit)) @@ -2153,41 +1820,42 @@ static int getExtension(Header h, headerTagTagFunction fn, ext->avail = 1; } - *typeptr = ext->type; - *data = ext->data; - *countptr = ext->count; + if (typeptr) *typeptr = ext->type; + if (data) *data = ext->data; + if (countptr) *countptr = ext->count; return 0; } /** */ -static char * formatValue(struct sprintfTag * tag, Header h, - const struct headerSprintfExtension * extensions, - struct extensionCache * extCache, int element) - /*@modifies extCache->avail @*/ +static char * formatValue(sprintfTag tag, Header h, + const headerSprintfExtension extensions, + extensionCache extCache, int element) + /*@modifies extCache @*/ { int len; char buf[20]; int_32 count, type; - const void * data; + hPTR_t data; unsigned int intVal; char * val = NULL; const char ** strarray; int mayfree = 0; int countBuf; headerTagFormatFunction tagtype = NULL; - const struct headerSprintfExtension * ext; + headerSprintfExtension ext; if (tag->ext) { if (getExtension(h, tag->ext, &type, &data, &count, - extCache + tag->extNum)) { + extCache + tag->extNum)) + { count = 1; type = RPM_STRING_TYPE; data = "(none)"; /* XXX i18n? NO!, sez; gafton */ } } else { - if (!headerGetEntry(h, tag->tag, &type, (void **)&data, &count)){ + if (!headerGetEntry(h, tag->tag, &type, (void **)&data, &count)) { count = 1; type = RPM_STRING_TYPE; data = "(none)"; /* XXX i18n? NO!, sez; gafton */ @@ -2293,10 +1961,10 @@ static char * formatValue(struct sprintfTag * tag, Header h, /** */ -static const char * singleSprintf(Header h, struct sprintfToken * token, - const struct headerSprintfExtension * extensions, - struct extensionCache * extCache, int element) - /*@modifies h, extCache->avail @*/ +static const char * singleSprintf(Header h, sprintfToken token, + const headerSprintfExtension extensions, + extensionCache extCache, int element) + /*@modifies h, extCache @*/ { char * val; const char * thisItem; @@ -2305,7 +1973,7 @@ static const char * singleSprintf(Header h, struct sprintfToken * token, int i, j; int numElements; int type; - struct sprintfToken * condFormat; + sprintfToken condFormat; int condNumFormats; /* we assume the token and header have been validated already! */ @@ -2410,11 +2078,11 @@ static const char * singleSprintf(Header h, struct sprintfToken * token, /** */ -static struct extensionCache * allocateExtensionCache( - const struct headerSprintfExtension * extensions) - /*@*/ +static /*@only@*/ extensionCache +allocateExtensionCache(const headerSprintfExtension extensions) + /*@*/ { - const struct headerSprintfExtension * ext = extensions; + headerSprintfExtension ext = extensions; int i = 0; while (ext->type != HEADER_EXT_LAST) { @@ -2429,11 +2097,14 @@ static struct extensionCache * allocateExtensionCache( } /** + * @return NULL always */ -static void freeExtensionCache(const struct headerSprintfExtension * extensions, - /*@only@*/struct extensionCache * cache) +static /*@null@*/ extensionCache +freeExtensionCache(const headerSprintfExtension extensions, + /*@only@*/ extensionCache cache) + /*@*/ { - const struct headerSprintfExtension * ext = extensions; + headerSprintfExtension ext = extensions; int i = 0; while (ext->type != HEADER_EXT_LAST) { @@ -2447,32 +2118,37 @@ static void freeExtensionCache(const struct headerSprintfExtension * extensions, } cache = _free(cache); + return NULL; } char * headerSprintf(Header h, const char * fmt, - const struct headerTagTableEntry * tags, - const struct headerSprintfExtension * extensions, - errmsg_t * errmsg) + const struct headerTagTableEntry * tabletags, + const struct headerSprintfExtension * extensions, + errmsg_t * errmsg) { + /*@-castexpose@*/ /* FIX: legacy API shouldn't change. */ + headerSprintfExtension exts = (headerSprintfExtension) extensions; + headerTagTableEntry tags = (headerTagTableEntry) tabletags; + /*@=castexpose@*/ char * fmtString; - struct sprintfToken * format; + sprintfToken format; int numTokens; char * answer; int answerLength; int answerAlloced; int i; - struct extensionCache * extCache; + extensionCache extCache; /*fmtString = escapeString(fmt);*/ fmtString = xstrdup(fmt); - if (parseFormat(fmtString, tags, extensions, &format, &numTokens, + if (parseFormat(fmtString, tags, exts, &format, &numTokens, NULL, PARSER_BEGIN, errmsg)) { fmtString = _free(fmtString); return NULL; } - extCache = allocateExtensionCache(extensions); + extCache = allocateExtensionCache(exts); answerAlloced = 1024; answerLength = 0; @@ -2484,7 +2160,7 @@ char * headerSprintf(Header h, const char * fmt, int pieceLength; /*@-mods@*/ - piece = singleSprintf(h, format + i, extensions, extCache, 0); + piece = singleSprintf(h, format + i, exts, extCache, 0); /*@=mods@*/ if (piece) { pieceLength = strlen(piece); @@ -2501,7 +2177,7 @@ char * headerSprintf(Header h, const char * fmt, } fmtString = _free(fmtString); - freeExtensionCache(extensions, extCache); + extCache = freeExtensionCache(exts, extCache); format = _free(format); return answer; @@ -2509,9 +2185,9 @@ char * headerSprintf(Header h, const char * fmt, /** */ -static char * octalFormat(int_32 type, const void * data, +static char * octalFormat(int_32 type, hPTR_t data, char * formatPrefix, int padding, /*@unused@*/int element) - /*@modifies formatPrefix @*/ + /*@modifies formatPrefix @*/ { char * val; @@ -2528,9 +2204,9 @@ static char * octalFormat(int_32 type, const void * data, /** */ -static char * hexFormat(int_32 type, const void * data, +static char * hexFormat(int_32 type, hPTR_t data, char * formatPrefix, int padding, /*@unused@*/int element) - /*@modifies formatPrefix @*/ + /*@modifies formatPrefix @*/ { char * val; @@ -2547,10 +2223,10 @@ static char * hexFormat(int_32 type, const void * data, /** */ -static char * realDateFormat(int_32 type, const void * data, +static char * realDateFormat(int_32 type, hPTR_t data, char * formatPrefix, int padding, /*@unused@*/int element, const char * strftimeFormat) - /*@modifies formatPrefix @*/ + /*@modifies formatPrefix @*/ { char * val; @@ -2578,18 +2254,18 @@ static char * realDateFormat(int_32 type, const void * data, /** */ -static char * dateFormat(int_32 type, const void * data, +static char * dateFormat(int_32 type, hPTR_t data, char * formatPrefix, int padding, int element) - /*@modifies formatPrefix @*/ + /*@modifies formatPrefix @*/ { return realDateFormat(type, data, formatPrefix, padding, element, "%c"); } /** */ -static char * dayFormat(int_32 type, const void * data, +static char * dayFormat(int_32 type, hPTR_t data, char * formatPrefix, int padding, int element) - /*@modifies formatPrefix @*/ + /*@modifies formatPrefix @*/ { return realDateFormat(type, data, formatPrefix, padding, element, "%a %b %d %Y"); @@ -2597,9 +2273,9 @@ static char * dayFormat(int_32 type, const void * data, /** */ -static char * shescapeFormat(int_32 type, const void * data, +static char * shescapeFormat(int_32 type, hPTR_t data, char * formatPrefix, int padding, /*@unused@*/int element) - /*@modifies formatPrefix @*/ + /*@modifies formatPrefix @*/ { char * result, * dst, * src, * buf; @@ -2641,23 +2317,24 @@ const struct headerSprintfExtension headerDefaultFormats[] = { { HEADER_EXT_LAST, NULL, { NULL } } }; -void headerCopyTags(Header headerFrom, Header headerTo, int_32 * tagstocopy) -{ - int * p; - - if (headerFrom == headerTo) - return; - - for (p = tagstocopy; *p != 0; p++) { - char *s; - int_32 type; - int_32 count; - if (headerIsEntry(headerTo, *p)) - continue; - if (!headerGetEntryMinMemory(headerFrom, *p, &type, - (const void **) &s, &count)) - continue; - (void) headerAddEntry(headerTo, *p, type, s, count); - s = headerFreeData(s, type); - } -} +HV_t hv = { + headerFree, + headerLink, + headerSort, + headerUnsort, + headerSizeof, + headerUnload, + headerReload, + headerCopy, + headerIsEntry, + headerGetEntry, + headerGetEntryMinMemory, + headerGetRawEntry, + headerAddEntry, + headerAppendEntry, + headerAddOrAppendEntry, + headerAddI18NString, + headerModifyEntry, + headerRemoveEntry, + headerSprintf, +}; diff --git a/lib/header.h b/lib/header.h index 1bb5b3c..2dedb0e 100644 --- a/lib/header.h +++ b/lib/header.h @@ -17,16 +17,16 @@ * - Support for version 1 headers was removed in rpm-4.0. * * - version 2 - * - (Before my time, sorry.) + * - @todo Document version2 headers. * * - version 3 (added in rpm-3.0) - * - added RPM_I18NSTRING_TYPE as an associative array reference + * - Added RPM_I18NSTRING_TYPE as an associative array reference * for i18n locale dependent single element tags (i.e Group). - * - added an 8 byte magic string to headers in packages on-disk. The + * - Added an 8 byte magic string to headers in packages on-disk. The * magic string was not added to headers in the database. * * - version 4 (added in rpm-4.0) - * - represent file names as a (dirname/basename/dirindex) triple + * - Represent file names as a (dirname/basename/dirindex) triple * rather than as an absolute path name. Legacy package headers are * converted when the header is read. Legacy database headers are * converted when the database is rebuilt. @@ -35,7 +35,17 @@ * on package provides. Legacy package headers are converted * when the header is read. Legacy database headers are * converted when the database is rebuilt. - * + * - (rpm-4.0.2) The original package header (and all original + * metadata) is preserved in what's called an "immutable header region". + * The original header can be retrieved as an RPM_BIN_TYPE, just + * like any other tag, and the original header reconstituted using + * headerLoad(). + * - (rpm-4.0.2) The signature tags are added (and renumbered to avoid + * tag value collisions) to the package header during package + * installation. + * - (rpm-4.0.3) A SHA1 digest of the original header is appended + * (i.e. detached digest) to the immutable header region to verify + * changes to the original header. * . * * \par Development Issues @@ -43,27 +53,26 @@ * Here's a brief description of future features/incompatibilities that * will be added to headers. * - * - Signature tags - * - Signatures are stored in A header, but not THE header - * of a package. That means that signatures are discarded - * when a package is installed, preventing verification - * of header contents after install. All signature tags - * will be added to THE package header so that they are - * saved in the rpm database for later retrieval and verification. - * Adding signatures to THE header will also permit signatures to - * be accessed by Red Hat Network, i.e. retrieval by existing - * Python bindings. - * - Signature tag values collide with existing rpm tags, and will - * have to be renumbered. Part of this renumbering was accomplished - * in rpm-4.0, but more remains to be done. - * - Signatures, because they involve MD5 and other 1-way hashes on - * immutable data, will cause the header to be reconstituted as a - * immutable section and a mutable section. - */ - -/* RPM - Copyright (C) 1995-2000 Red Hat Software */ - -/* WARNING: 1 means success, 0 means failure (yes, this is backwards) */ + * - Private header methods. + * - Private methods (e.g. headerLoad(), headerUnload(), etc.) to + * permit header data to be manipulated opaquely. Initially + * the transaction element file info TFI_t will be used as + * proof-of-concept, binary XML will probably be implemented + * soon thereafter. + * - DSA signature for header metadata. + * - The manner in which rpm packages are signed is going to change. + * The SHA1 digest in the header will be signed, equivalent to a DSA + * digital signature on the original header metadata. As the original + * header will contain "trusted" (i.e. because the header is signed + * with DSA) file MD5 digests, there will be little or no reason + * to sign the payload, but that may happen as well. Note that cpio + * headers in the payload are not used to install package metadata, + * only the name field in the cpio header is used to associate an + * archive file member with the corresponding entry for the file + * in header metadata. + */ + +/* RPM - Copyright (C) 1995-2001 Red Hat Software */ #include #include @@ -94,17 +103,30 @@ typedef unsigned int uint_32; typedef unsigned short uint_16; #endif +/*@-redef@*/ /* LCL: no clue */ +/** \ingroup header + */ +typedef const char * errmsg_t; + /** \ingroup header */ -typedef /*@abstract@*/ /*@refcounted@*/ struct headerToken *Header; +typedef int_32 * hTAG_t; +typedef int_32 * hTYP_t; +typedef const void * hPTR_t; +typedef int_32 * hCNT_t; /** \ingroup header */ -typedef /*@abstract@*/ struct headerIteratorS *HeaderIterator; +typedef /*@abstract@*/ /*@refcounted@*/ struct headerToken * Header; + +/** \ingroup header + */ +typedef /*@abstract@*/ struct headerIteratorS * HeaderIterator; /** \ingroup header * Associate tag names with numeric values. */ +typedef /*@abstract@*/ struct headerTagTableEntry * headerTagTableEntry; struct headerTagTableEntry { /*@observer@*/ /*@null@*/ const char * name; /*!< Tag name. */ int val; /*!< Tag numeric value. */ @@ -146,14 +168,15 @@ typedef /*only@*/ char * (*headerTagFormatFunction)(int_32 type, * @return 0 on success */ typedef int (*headerTagTagFunction) (Header h, - /*@null@*/ /*@out@*/ int_32 * type, - /*@null@*/ /*@out@*/ const void ** data, - /*@null@*/ /*@out@*/ int_32 * count, + /*@null@*/ /*@out@*/ hTYP_t type, + /*@null@*/ /*@out@*/ hPTR_t * data, + /*@null@*/ /*@out@*/ hCNT_t count, /*@null@*/ /*@out@*/ int * freeData); /** \ingroup header * Define header tag output formats. */ +typedef /*@abstract@*/ struct headerSprintfExtension * headerSprintfExtension; struct headerSprintfExtension { enum headerSprintfExtenstionType type; /*!< Type of extension. */ /*@observer@*/ /*@null@*/ const char * name; /*!< Name of extension. */ @@ -180,341 +203,145 @@ enum hMagic { HEADER_MAGIC_YES = 1 }; -/** \ingroup header - * Read (and load) header from file handle. - * @param fd file handle - * @param magicp read (and verify) 8 bytes of (magic, 0)? - * @return header (or NULL on error) - */ -/*@null@*/ Header headerRead(FD_t fd, enum hMagic magicp) - /*@modifies fd, fileSystem @*/; - -/** \ingroup header - * Write (with unload) header to file handle. - * @param fd file handle - * @param h header - * @param magicp prefix write with 8 bytes of (magic, 0)? - * @return 0 on success, 1 on error - */ -int headerWrite(FD_t fd, /*@null@*/ Header h, enum hMagic magicp) - /*@modifies fd, h, fileSystem @*/; - -/** \ingroup header - * Return size of on-disk header representation in bytes. - * @param h header - * @param magicp include size of 8 bytes for (magic, 0)? - * @return size of on-disk header - */ -unsigned int headerSizeof(/*@null@*/ Header h, enum hMagic magicp) - /*@modifies h @*/; - -/** \ingroup header - * Convert header to in-memory representation. - * @param uh on-disk header blob (i.e. with offsets) - * @return header - */ -/*@-exportlocal@*/ -/*@null@*/ Header headerLoad(/*@kept@*/ void * uh) - /*@modifies uh @*/; -/*@=exportlocal@*/ - -/** \ingroup header - * Make a copy and convert header to in-memory representation. - * @param uh on-disk header blob (i.e. with offsets) - * @return header - */ -/*@null@*/ Header headerCopyLoad(void * uh) - /*@modifies uh @*/; - -/** \ingroup header - * Convert header to on-disk representation. - * @param h header (with pointers) - * @return on-disk header blob (i.e. with offsets) - */ -/*@only@*/ /*@null@*/ void * headerUnload(Header h) - /*@modifies h @*/; - -/** \ingroup header - * Convert header to on-disk representation, and then reload. - * This is used to insure that all header data is in one chunk. - * @param h header (with pointers) - * @param tag region tag - * @return on-disk header (with offsets) +/** */ -/*@null@*/ Header headerReload(/*@only@*/ Header h, int tag) - /*@modifies h @*/; +/*@-typeuse -fielduse@*/ +typedef union hRET_s { + const void * ptr; + const char ** argv; + const char * str; + uint_32 * ui32p; + uint_16 * ui16p; + int_32 * i32p; + int_16 * i16p; + int_8 * i8p; +} * hRET_t; +/*@=typeuse =fielduse@*/ -/** \ingroup header - * Create new (empty) header instance. - * @return header +/** */ -Header headerNew(void) /*@*/; +/*@-typeuse -fielduse@*/ +typedef struct HE_s { + int_32 tag; +/*@null@*/ hTYP_t typ; + union { +/*@null@*/ hPTR_t * ptr; +/*@null@*/ hRET_t * ret; + } u; +/*@null@*/ hCNT_t cnt; +} * HE_t; +/*@=typeuse =fielduse@*/ -/** \ingroup header - * Reference a header instance. - * @param h header - * @return referenced header instance - */ -Header headerLink(Header h) - /*@modifies h @*/; +typedef +/*@null@*/ Header (*HVfree) (/*@null@*/ /*@killref@*/ Header h) + /*@modifies h @*/; -/** \ingroup header - * Dereference a header instance. - * @param h header - * @return NULL always - */ -/*@null@*/ Header headerFree( /*@null@*/ /*@killref@*/ Header h) - /*@modifies h @*/; +typedef +Header (*HVlink) (Header h) + /*@modifies h @*/; -/*@-redef@*/ /* LCL: no clue */ -typedef const char * errmsg_t; -/*@=redef@*/ +typedef +void (*HVsort) (Header h) + /*@modifies h @*/; -/** \ingroup header - * Return formatted output string from header tags. - * The returned string must be free()d. - * - * @param h header - * @param fmt format to use - * @param tags array of tag name/value pairs - * @param extensions chained table of formatting extensions. - * @retval errmsg error message (if any) - * @return formatted output string (malloc'ed) - */ -/*@only@*/ char * headerSprintf(Header h, const char * fmt, - const struct headerTagTableEntry * tags, - const struct headerSprintfExtension * extensions, - /*@null@*/ /*@out@*/ errmsg_t * errmsg) - /*@modifies *errmsg @*/; +typedef +void (*HVunsort) (Header h) + /*@modifies h @*/; -/** \ingroup header - * Add tag to header. - * Duplicate tags are okay, but only defined for iteration (with the - * exceptions noted below). While you are allowed to add i18n string - * arrays through this function, you probably don't mean to. See - * headerAddI18NString() instead. - * - * @param h header - * @param tag tag - * @param type tag value data type - * @param p pointer to tag value(s) - * @param c number of values - * @return 1 on success, 0 on failure - */ -/*@mayexit@*/ -int headerAddEntry(Header h, int_32 tag, int_32 type, const void *p, int_32 c) - /*@modifies h @*/; +typedef +unsigned int (*HVsize) (/*@null@*/ Header h, enum hMagic magicp) + /*@modifies h @*/; -/** \ingroup header - * Modify tag in header. - * If there are multiple entries with this tag, the first one gets replaced. - * @param h header - * @param tag tag - * @param type tag value data type - * @param p pointer to tag value(s) - * @param c number of values - * @return 1 on success, 0 on failure - */ -int headerModifyEntry(Header h, int_32 tag, int_32 type, - const void * p, int_32 c) - /*@modifies h @*/; +typedef +/*@only@*/ /*@null@*/ void * (*HVunload) (Header h) + /*@modifies h @*/; -/** \ingroup header - * Add locale specific tag to header. - * A NULL lang is interpreted as the C locale. Here are the rules: - * \verbatim - * - If the tag isn't in the header, it's added with the passed string - * as new value. - * - If the tag occurs multiple times in entry, which tag is affected - * by the operation is undefined. - * - If the tag is in the header w/ this language, the entry is - * *replaced* (like headerModifyEntry()). - * \endverbatim - * This function is intended to just "do the right thing". If you need - * more fine grained control use headerAddEntry() and headerModifyEntry(). - * - * @param h header - * @param tag tag - * @param string tag value - * @param lang locale - * @return 1 on success, 0 on failure - */ -int headerAddI18NString(Header h, int_32 tag, const char * string, - const char * lang) - /*@modifies h @*/; +typedef +/*@null@*/ Header (*HVreload) (/*@only@*/ Header h, int tag) + /*@modifies h @*/; -/** \ingroup header - * Append element to tag array in header. - * Appends item p to entry w/ tag and type as passed. Won't work on - * RPM_STRING_TYPE. Any pointers into header memory returned from - * headerGetEntryMinMemory() for this entry are invalid after this - * call has been made! - * - * @param h header - * @param tag tag - * @param type tag value data type - * @param p pointer to tag value(s) - * @param c number of values - * @return 1 on success, 0 on failure - */ -int headerAppendEntry(Header h, int_32 tag, int_32 type, - const void * p, int_32 c) - /*@modifies h @*/; +typedef +Header (*HVcopy) (Header h) + /*@modifies h @*/; -/** \ingroup header - * Add or append element to tag array in header. - * @todo Arg "p" should have const. - * @param h header - * @param tag tag - * @param type tag value data type - * @param p pointer to tag value(s) - * @param c number of values - * @return 1 on success, 0 on failure - */ -int headerAddOrAppendEntry(Header h, int_32 tag, int_32 type, - const void * p, int_32 c) - /*@modifies h @*/; +typedef +int (*HVisentry) (/*@null@*/Header h, int_32 tag) + /*@*/; -/** \ingroup header - * Retrieve tag value. - * Will never return RPM_I18NSTRING_TYPE! RPM_STRING_TYPE elements with - * RPM_I18NSTRING_TYPE equivalent entries are translated (if HEADER_I18NTABLE - * entry is present). - * - * @param h header - * @param tag tag - * @retval type address of tag value data type (or NULL) - * @retval p address of pointer to tag value(s) (or NULL) - * @retval c address of number of values (or NULL) - * @return 1 on success, 0 on failure - */ -int headerGetEntry(Header h, int_32 tag, - /*@null@*/ /*@out@*/ int_32 * type, +typedef +int (*HVget) (Header h, int_32 tag, + /*@null@*/ /*@out@*/ hTYP_t type, /*@null@*/ /*@out@*/ void ** p, - /*@null@*/ /*@out@*/int_32 *c) + /*@null@*/ /*@out@*/ hCNT_t c) /*@modifies *type, *p, *c @*/; -/** \ingroup header - * Retrieve tag value using header internal array. - * Get an entry using as little extra RAM as possible to return the tag value. - * This is only an issue for RPM_STRING_ARRAY_TYPE. - * - * @param h header - * @param tag tag - * @retval type address of tag value data type (or NULL) - * @retval p address of pointer to tag value(s) (or NULL) - * @retval c address of number of values (or NULL) - * @return 1 on success, 0 on failure - */ -int headerGetEntryMinMemory(Header h, int_32 tag, - /*@null@*/ /*@out@*/ int_32 * type, - /*@null@*/ /*@out@*/ const void ** p, - /*@null@*/ /*@out@*/ int_32 * c) +typedef +int (*HVgetmin) (Header h, int_32 tag, + /*@null@*/ /*@out@*/ hTYP_t type, + /*@null@*/ /*@out@*/ hPTR_t * p, + /*@null@*/ /*@out@*/ hCNT_t c) /*@modifies *type, *p, *c @*/; -/** \ingroup header - * Retrieve tag value with type match. - * If *type is RPM_NULL_TYPE any type will match, otherwise only *type will - * match. - * - * @param h header - * @param tag tag - * @retval type address of tag value data type (or NULL) - * @retval p address of pointer to tag value(s) (or NULL) - * @retval c address of number of values (or NULL) - * @return 1 on success, 0 on failure - */ -/*@-exportlocal@*/ -int headerGetRawEntry(Header h, int_32 tag, - /*@null@*/ /*@out@*/ int_32 * type, - /*@null@*/ /*@out@*/ const void ** p, - /*@null@*/ /*@out@*/ int_32 * c) +typedef +int (*HVgetraw) (Header h, int_32 tag, + /*@null@*/ /*@out@*/ hTYP_t type, + /*@null@*/ /*@out@*/ hPTR_t * p, + /*@null@*/ /*@out@*/ hCNT_t c) /*@modifies *type, *p, *c @*/; -/*@=exportlocal@*/ -/** \ingroup header - * Check if tag is in header. - * @param h header - * @param tag tag - * @return 1 on success, 0 on failure - */ -int headerIsEntry(/*@null@*/Header h, int_32 tag) /*@*/; +typedef +int (*HVadd) (Header h, int_32 tag, int_32 type, const void * p, int_32 c) + /*@modifies h @*/; -/** \ingroup header - * Delete tag in header. - * Removes all entries of type tag from the header, returns 1 if none were - * found. - * - * @param h header - * @param tag tag - * @return 0 on success, 1 on failure (INCONSISTENT) - */ -int headerRemoveEntry(Header h, int_32 tag) - /*@modifies h @*/; +typedef +int (*HVappend) (Header h, int_32 tag, int_32 type, const void * p, int_32 c) + /*@modifies h @*/; -/** \ingroup header - * Create header tag iterator. - * @param h header - * @return header tag iterator - */ -HeaderIterator headerInitIterator(Header h) - /*@modifies h */; - -/** \ingroup header - * Return next tag from header. - * @param hi header tag iterator - * @retval tag address of tag - * @retval type address of tag value data type - * @retval p address of pointer to tag value(s) - * @retval c address of number of values - * @return 1 on success, 0 on failure - */ -int headerNextIterator(HeaderIterator hi, - /*@null@*/ /*@out@*/ int_32 * tag, - /*@null@*/ /*@out@*/ int_32 * type, - /*@null@*/ /*@out@*/ const void ** p, - /*@null@*/ /*@out@*/ int_32 * c) - /*@modifies hi, *tag, *type, *p, *c @*/; +typedef +int (*HVaddorappend) (Header h, int_32 tag, int_32 type, const void * p, int_32 c) + /*@modifies h @*/; -/** \ingroup header - * Destroy header tag iterator. - * @param hi header tag iterator - */ -void headerFreeIterator(/*@only@*/ HeaderIterator hi) - /*@modifies hi @*/; +typedef +int (*HVaddi18n) (Header h, int_32 tag, const char * string, + const char * lang) + /*@modifies h @*/; -/** \ingroup header - * Duplicate a header. - * @param h header - * @return new header instance - */ -/*@null@*/ Header headerCopy(Header h) - /*@modifies h @*/; +typedef +int (*HVmodify) (Header h, int_32 tag, int_32 type, const void * p, int_32 c) + /*@modifies h @*/; -/** \ingroup header - * Sort tags in header. - * @param h header - */ -/*@-exportlocal@*/ -void headerSort(Header h) - /*@modifies h @*/; +typedef +int (*HVremove) (Header h, int_32 tag) + /*@modifies h @*/; -/** \ingroup header - * Restore tags in header to original ordering. - * @param h header - */ -void headerUnsort(Header h) - /*@modifies h @*/; -/*@=exportlocal@*/ +typedef +/*@only@*/ char * (*HVsprintf) (Header h, const char * fmt, + const struct headerTagTableEntry * tags, + const struct headerSprintfExtension * extensions, + /*@null@*/ /*@out@*/ errmsg_t * errmsg) + /*@modifies *errmsg @*/; -/** \ingroup header - * Duplicate tag values from one header into another. - * @param headerFrom source header - * @param headerTo destination header - * @param tagstocopy array of tags that are copied - */ -void headerCopyTags(Header headerFrom, Header headerTo, int_32 * tagstocopy) - /*@modifies headerFrom, headerTo @*/; +typedef struct HV_s { + HVfree free; + HVlink link; + HVsort sort; + HVunsort unsort; + HVsize size; + HVunload unload; + HVreload reload; + HVcopy copy; + HVisentry isentry; + HVget get; + HVgetmin getmin; + HVgetraw getraw; + HVadd add; + HVappend append; + HVaddorappend addorappend; + HVaddi18n addi18n; + HVmodify modify; + HVremove remove; + HVsprintf sprintf; +} HV_t; /** \ingroup header * The basic types of data in tags from headers. @@ -535,28 +362,6 @@ typedef enum rpmTagType_e { } rpmTagType; /** \ingroup header - * Free data allocated when retrieved from header. - * @param data address of data (or NULL) - * @param type type of data (or -1 to force free) - * @return NULL always - */ -/*@unused@*/ static inline /*@null@*/ -void * headerFreeData( /*@only@*/ /*@null@*/ const void * data, rpmTagType type) - /*@modifies data @*/ -{ - if (data) { - /*@-branchstate@*/ - if (type == -1 || - type == RPM_STRING_ARRAY_TYPE || - type == RPM_I18NSTRING_TYPE || - type == RPM_BIN_TYPE) - free((void *)data); - /*@=branchstate@*/ - } - return NULL; -} - -/** \ingroup header * New rpm data types under consideration/development. * These data types may (or may not) be added to rpm at some point. In order * to avoid incompatibility with legacy versions of rpm, these data (sub-)types @@ -588,6 +393,117 @@ typedef enum rpmSubTagType_e { #define HEADER_SIGBASE 256 #define HEADER_TAGBASE 1000 +/** \ingroup header + * Free data allocated when retrieved from header. + * @param data address of data (or NULL) + * @param type type of data (or -1 to force free) + * @return NULL always + */ +/*@unused@*/ static inline /*@null@*/ +void * headerFreeData( /*@only@*/ /*@null@*/ const void * data, rpmTagType type) + /*@modifies data @*/ +{ + if (data) { + /*@-branchstate@*/ + if (type == -1 || + type == RPM_STRING_ARRAY_TYPE || + type == RPM_I18NSTRING_TYPE || + type == RPM_BIN_TYPE) + free((void *)data); + /*@=branchstate@*/ + } + return NULL; +} + +/** \ingroup header + * Create new (empty) header instance. + * @return header + */ +Header headerNew(void) /*@*/; + +/** \ingroup header + * Convert header to in-memory representation. + * @param uh on-disk header blob (i.e. with offsets) + * @return header + */ +/*@-exportlocal@*/ +/*@null@*/ Header headerLoad(/*@kept@*/ void * uh) + /*@modifies uh @*/; +/*@=exportlocal@*/ + +/** \ingroup header + * Write (with unload) header to file handle. + * @param fd file handle + * @param h header + * @param magicp prefix write with 8 bytes of (magic, 0)? + * @return 0 on success, 1 on error + */ +int headerWrite(FD_t fd, /*@null@*/ Header h, enum hMagic magicp) + /*@modifies fd, h, fileSystem @*/; + +/** \ingroup header + * Make a copy and convert header to in-memory representation. + * @param uh on-disk header blob (i.e. with offsets) + * @return header + */ +/*@null@*/ Header headerCopyLoad(void * uh) + /*@modifies uh @*/; + +/** \ingroup header + * Read (and load) header from file handle. + * @param fd file handle + * @param magicp read (and verify) 8 bytes of (magic, 0)? + * @return header (or NULL on error) + */ +/*@null@*/ Header headerRead(FD_t fd, enum hMagic magicp) + /*@modifies fd, fileSystem @*/; + +/** \ingroup header + * Duplicate tag values from one header into another. + * @param headerFrom source header + * @param headerTo destination header + * @param tagstocopy array of tags that are copied + */ +void headerCopyTags(Header headerFrom, Header headerTo, hTAG_t tagstocopy) + /*@modifies headerFrom, headerTo @*/; + +/** \ingroup header + * Destroy header tag iterator. + * @param hi header tag iterator + */ +void headerFreeIterator(/*@only@*/ HeaderIterator hi) + /*@modifies hi @*/; + +/** \ingroup header + * Create header tag iterator. + * @param h header + * @return header tag iterator + */ +HeaderIterator headerInitIterator(Header h) + /*@modifies h */; + +/** \ingroup header + * Return next tag from header. + * @param hi header tag iterator + * @retval tag address of tag + * @retval type address of tag value data type + * @retval p address of pointer to tag value(s) + * @retval c address of number of values + * @return 1 on success, 0 on failure + */ +int headerNextIterator(HeaderIterator hi, + /*@null@*/ /*@out@*/ hTAG_t tag, + /*@null@*/ /*@out@*/ hTYP_t type, + /*@null@*/ /*@out@*/ hPTR_t * p, + /*@null@*/ /*@out@*/ hCNT_t c) + /*@modifies hi, *tag, *type, *p, *c @*/; + +#if defined(__HEADER_PROTOTYPES__) +#include +#else +#include +#endif + #ifdef __cplusplus } #endif diff --git a/lib/header_internal.c b/lib/header_internal.c index 3e77222..6ecfce3 100644 --- a/lib/header_internal.c +++ b/lib/header_internal.c @@ -8,14 +8,33 @@ #include "debug.h" -void headerDump(Header h, FILE *f, int flags, - const struct headerTagTableEntry * tags) +char ** headerGetLangs(Header h) +{ + char **s, *e, **table; + int i, type, count; + + if (!headerGetRawEntry(h, HEADER_I18NTABLE, &type, (const void **)&s, &count)) + return NULL; + + /* XXX xcalloc never returns NULL. */ + if ((table = (char **)xcalloc((count+1), sizeof(char *))) == NULL) + return NULL; + + for (i = 0, e = *s; i < count > 0; i++, e += strlen(e)+1) + table[i] = e; + table[count] = NULL; + + /*@-nullret@*/ return table; /*@=nullret@*/ /* LCL: double indirection? */ +} + +void headerDump(Header h, FILE *f, int flags, + const struct headerTagTableEntry * tags) { int i; - struct indexEntry *p; + indexEntry p; const struct headerTagTableEntry * tage; - const char *tag; - char *type; + const char * tag; + char * type; /* First write out the length of the index (count of index entries) */ fprintf(f, "Entry count: %d\n", h->indexUsed); diff --git a/lib/header_internal.h b/lib/header_internal.h index db87fdb..1087214 100644 --- a/lib/header_internal.h +++ b/lib/header_internal.h @@ -11,10 +11,18 @@ #include #endif /* __LCLINT__ */ +#define INDEX_MALLOC_SIZE 8 -/** +/* + * Teach header.c about legacy tags. + */ +#define HEADER_OLDFILENAMES 1027 +#define HEADER_BASENAMES 1117 + +/** \ingroup header * Description of tag data. */ +typedef /*@abstract@*/ struct entryInfo * entryInfo; struct entryInfo { int_32 tag; /*!< Tag identifier. */ int_32 type; /*!< Tag data type. */ @@ -28,9 +36,10 @@ struct entryInfo { #define ENTRY_IS_REGION(_e) ((_e)->info.tag < HEADER_I18NTABLE) #define ENTRY_IN_REGION(_e) ((_e)->info.offset < 0) -/** +/** \ingroup header * A single tag from a Header. */ +typedef /*@abstract@*/ struct indexEntry * indexEntry; struct indexEntry { struct entryInfo info; /*!< Description of tag data. */ /*@owned@*/ void * data; /*!< Location of tag data. */ @@ -38,11 +47,12 @@ struct indexEntry { int rdlen; /*!< No. bytes of data in region. */ }; -/** +/** \ingroup header * The Header data structure. */ struct headerToken { -/*@owned@*/ struct indexEntry * index; /*!< Array of tags. */ +/*@unused@*/ HV_t hv; /*!< Header public methods. */ +/*@owned@*/ indexEntry index; /*!< Array of tags. */ int indexUsed; /*!< Current size of tag array. */ int indexAlloced; /*!< Allocated size of tag array. */ int region_allocated; /*!< Is 1st header region allocated? */ @@ -51,8 +61,9 @@ struct headerToken { /*@refs@*/ int nrefs; /*!< Reference count. */ }; -/** +/** \ingroup header */ +typedef /*@abstract@*/ struct sprintfTag * sprintfTag; struct sprintfTag { /*@null@*/ headerTagTagFunction ext; /*!< if NULL tag element is invalid */ int extNum; @@ -64,8 +75,9 @@ struct sprintfTag { int pad; }; -/** +/** \ingroup header */ +typedef /*@abstract@*/ struct extensionCache * extensionCache; struct extensionCache { int_32 type; int_32 count; @@ -74,8 +86,10 @@ struct extensionCache { /*@owned@*/ const void * data; }; -/** +/** \ingroup header */ +/*@-fielduse@*/ +typedef /*@abstract@*/ struct sprintfToken * sprintfToken; struct sprintfToken { enum { PTOK_NONE = 0, @@ -86,28 +100,106 @@ struct sprintfToken { } type; union { struct { - /*@only@*/ struct sprintfToken * format; + /*@only@*/ sprintfToken format; int numTokens; } array; struct sprintfTag tag; struct { - /*@dependent@*/ char * string; + /*@dependent@*/ char * string; int len; } string; struct { - /*@only@*/ /*@null@*/ struct sprintfToken * ifFormat; + /*@only@*/ /*@null@*/ sprintfToken ifFormat; int numIfTokens; - /*@only@*/ /*@null@*/ struct sprintfToken * elseFormat; + /*@only@*/ /*@null@*/ sprintfToken elseFormat; int numElseTokens; struct sprintfTag tag; } cond; } u; }; +/*@=fielduse@*/ #ifdef __cplusplus extern "C" { #endif +/** \ingroup header + */ +extern unsigned char header_magic[8]; + +/** \ingroup header + */ +extern HV_t hv; + +/** \ingroup header + * Swap int_32 and int_16 arrays within header region. + * + * This code is way more twisty than I would like. + * + * A bug with RPM_I18NSTRING_TYPE in rpm-2.5.x (fixed in August 1998) + * causes the offset and length of elements in a header region to disagree + * regarding the total length of the region data. + * + * The "fix" is to compute the size using both offset and length and + * return the larger of the two numbers as the size of the region. + * Kinda like computing left and right Riemann sums of the data elements + * to determine the size of a data structure, go figger :-). + * + * There's one other twist if a header region tag is in the set to be swabbed, + * as the data for a header region is located after all other tag data. + * + * @param entry header entry + * @param il no. of entries + * @param dl start no. bytes of data + * @param pe header physical entry pointer (swapped) + * @param dataStart header data + * @param regionid region offset + * @return no. bytes of data in region, -1 on error + */ +int regionSwab(/*@null@*/ indexEntry entry, int il, int dl, + entryInfo pe, char * dataStart, int regionid) + /*@modifies entry, *dataStart @*/; + +/** \ingroup header + */ +/*@only@*/ /*@null@*/ void * doHeaderUnload(Header h, /*@out@*/ int * lengthPtr) + /*@modifies h, *lengthPtr @*/; + +/** \ingroup header + * Retrieve data from header entry. + * @todo Permit retrieval of regions other than HEADER_IMUTABLE. + * @param entry header entry + * @retval type address of type (or NULL) + * @retval p address of data (or NULL) + * @retval c address of count (or NULL) + * @param minMem string pointers refer to header memory? + * @return 1 on success, otherwise error. + */ +int copyEntry(const indexEntry entry, + /*@null@*/ /*@out@*/ hTYP_t type, + /*@null@*/ /*@out@*/ hPTR_t * p, + /*@null@*/ /*@out@*/ hCNT_t c, + int minMem) + /*@modifies *type, *p, *c @*/; + +/** \ingroup header + * Return array of locales found in header. + * The array is terminated with a NULL sentinel. + * @param h header + * @return array of locales (or NULL on error) + */ +/*@unused@*/ +/*@only@*/ /*@null@*/ char ** headerGetLangs(Header h) + /*@*/; + +/** \ingroup header + * Return header reference count. + * @param h header + * @return no. of references + */ +/*@unused@*/ static inline int headerUsageCount(Header h) /*@*/ { + return h->nrefs; +} /** \ingroup header * Dump a header in human readable format (for debugging). @@ -117,7 +209,8 @@ extern "C" { */ /*@unused@*/ void headerDump(Header h, FILE *f, int flags, - const struct headerTagTableEntry * tags); + const struct headerTagTableEntry * tags) + /*@modifies f, fileSystem @*/; #define HEADER_DUMP_INLINE 1 #ifdef __cplusplus diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 1c82d78..e7700fd 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -154,7 +154,7 @@ int rpmHeaderGetEntry(Header h, int_32 tag, /*@out@*/ int_32 *type, /*@unused@*/ int rpmPackageGetEntry(void *leadp, Header sigs, Header h, int_32 tag, int_32 *type, void **p, int_32 *c) - /*@modifies *type, *p, *c @*/; + /*@modifies h, *type, *p, *c @*/; /** * Automatically generated table of tag name/value pairs. diff --git a/lib/rpmvercmp.c b/lib/rpmvercmp.c index ec09447..8819558 100644 --- a/lib/rpmvercmp.c +++ b/lib/rpmvercmp.c @@ -4,7 +4,7 @@ #include "system.h" -#include +#include #include "debug.h" diff --git a/po/POTFILES.in b/po/POTFILES.in index e0d9ce8..8af440d 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -29,6 +29,7 @@ lib/depends.c lib/formats.c lib/fs.c lib/fsm.c +lib/hdrinline.c lib/header.c lib/header_internal.c lib/manifest.c diff --git a/po/rpm.pot b/po/rpm.pot index a3116cf..2c9703e 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,1088 +6,1091 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-05-07 15:57-0400\n" +"POT-Creation-Date: 2001-06-19 07:31-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: ENCODING\n" +"Content-Transfer-Encoding: 8bit\n" -#: build.c:35 +#: build.c:36 #, c-format msgid "cannot open rpm database in %s\n" msgstr "" -#: build.c:45 +#: build.c:46 msgid "failed build dependencies:\n" msgstr "" -#: build.c:76 +#: build.c:78 #, c-format msgid "Unable to open spec file %s: %s\n" msgstr "" -#: build.c:147 build.c:159 +#: build.c:151 build.c:163 #, c-format msgid "Failed to open tar pipe: %m\n" msgstr "" #. Give up -#: build.c:166 +#: build.c:170 #, c-format msgid "Failed to read spec file from %s\n" msgstr "" -#: build.c:194 +#: build.c:198 #, c-format msgid "Failed to rename %s to %s: %m\n" msgstr "" -#: build.c:233 +#: build.c:237 #, c-format msgid "failed to stat %s: %m\n" msgstr "" -#: build.c:238 +#: build.c:242 #, c-format msgid "File %s is not a regular file.\n" msgstr "" -#: build.c:247 +#: build.c:251 #, c-format msgid "File %s does not appear to be a specfile.\n" msgstr "" #. parse up the build operators -#: build.c:303 +#: build.c:307 #, c-format msgid "Building target platforms: %s\n" msgstr "" -#: build.c:318 +#: build.c:322 #, c-format msgid "Building for target %s\n" msgstr "" -#: rpm.c:224 rpmqv.c:394 +#: rpm.c:227 #, c-format msgid "rpm: %s\n" msgstr "" -#: rpm.c:235 rpmqv.c:399 +#: rpm.c:238 rpmqv.c:215 #, c-format msgid "RPM version %s\n" msgstr "" -#: rpm.c:239 rpmqv.c:403 +#: rpm.c:242 rpmqv.c:221 msgid "Copyright (C) 1998-2000 - Red Hat, Inc." msgstr "" -#: rpm.c:240 rpmqv.c:404 +#: rpm.c:243 rpmqv.c:222 msgid "This program may be freely redistributed under the terms of the GNU GPL" msgstr "" -#: rpm.c:248 +#: rpm.c:251 msgid "Usage: rpm {--help}" msgstr "" -#: rpm.c:249 +#: rpm.c:252 msgid " rpm {--version}" msgstr "" -#: rpm.c:250 +#: rpm.c:253 msgid " rpm {--initdb} [--dbpath ]" msgstr "" -#: rpm.c:251 +#: rpm.c:254 msgid "" " rpm {--install -i} [-v] [--hash -h] [--percent] [--force] [--test]" msgstr "" -#: rpm.c:252 +#: rpm.c:255 msgid " [--replacepkgs] [--replacefiles] [--root ]" msgstr "" -#: rpm.c:253 +#: rpm.c:256 msgid " [--excludedocs] [--includedocs] [--noscripts]" msgstr "" -#: rpm.c:254 +#: rpm.c:257 msgid "" " [--rcfile ] [--ignorearch] [--dbpath ]" msgstr "" -#: rpm.c:255 +#: rpm.c:258 msgid "" " [--prefix ] [--ignoreos] [--nodeps] [--allfiles]" msgstr "" -#: rpm.c:256 rpm.c:265 rpm.c:275 +#: rpm.c:259 rpm.c:268 rpm.c:278 msgid " [--ftpproxy ] [--ftpport ]" msgstr "" -#: rpm.c:257 rpm.c:276 +#: rpm.c:260 rpm.c:279 msgid " [--httpproxy ] [--httpport ]" msgstr "" -#: rpm.c:258 +#: rpm.c:261 msgid "" " [--justdb] [--noorder] [--relocate oldpath=newpath]" msgstr "" -#: rpm.c:259 +#: rpm.c:262 msgid "" " [--badreloc] [--notriggers] [--excludepath ]" msgstr "" -#: rpm.c:260 +#: rpm.c:263 msgid " [--ignoresize] file1.rpm ... fileN.rpm" msgstr "" -#: rpm.c:261 +#: rpm.c:264 msgid "" " rpm {--upgrade -U} [-v] [--hash -h] [--percent] [--force] [--test]" msgstr "" -#: rpm.c:262 +#: rpm.c:265 msgid " [--oldpackage] [--root ] [--noscripts]" msgstr "" -#: rpm.c:263 +#: rpm.c:266 msgid "" " [--excludedocs] [--includedocs] [--rcfile ]" msgstr "" -#: rpm.c:264 +#: rpm.c:267 msgid "" " [--ignorearch] [--dbpath ] [--prefix ] " msgstr "" -#: rpm.c:266 +#: rpm.c:269 msgid " [--httpproxy ] [--httpport ] " msgstr "" -#: rpm.c:267 +#: rpm.c:270 msgid " [--ignoreos] [--nodeps] [--allfiles] [--justdb]" msgstr "" -#: rpm.c:268 +#: rpm.c:271 msgid " [--noorder] [--relocate oldpath=newpath]" msgstr "" -#: rpm.c:269 +#: rpm.c:272 msgid "" " [--badreloc] [--excludepath ] [--ignoresize]" msgstr "" -#: rpm.c:270 +#: rpm.c:273 msgid " file1.rpm ... fileN.rpm" msgstr "" -#: rpm.c:271 +#: rpm.c:274 msgid " rpm {--query -q} [-afpg] [-i] [-l] [-s] [-d] [-c] [-v] [-R]" msgstr "" -#: rpm.c:272 +#: rpm.c:275 msgid " [--scripts] [--root ] [--rcfile ]" msgstr "" -#: rpm.c:273 +#: rpm.c:276 msgid " [--whatprovides] [--whatrequires] [--requires]" msgstr "" -#: rpm.c:274 +#: rpm.c:277 msgid " [--triggeredby]" msgstr "" -#: rpm.c:277 +#: rpm.c:280 msgid " [--provides] [--triggers] [--dump]" msgstr "" -#: rpm.c:278 +#: rpm.c:281 msgid " [--changelog] [--dbpath ] [targets]" msgstr "" -#: rpm.c:279 +#: rpm.c:282 msgid " rpm {--verify -V -y} [-afpg] [--root ] [--rcfile ]" msgstr "" -#: rpm.c:280 +#: rpm.c:283 msgid "" " [--dbpath ] [--nodeps] [--nofiles] [--noscripts]" msgstr "" -#: rpm.c:281 +#: rpm.c:284 msgid " [--nomd5] [targets]" msgstr "" -#: rpm.c:282 +#: rpm.c:285 msgid " rpm {--setperms} [-afpg] [target]" msgstr "" -#: rpm.c:283 +#: rpm.c:286 msgid " rpm {--setugids} [-afpg] [target]" msgstr "" -#: rpm.c:284 +#: rpm.c:287 msgid " rpm {--freshen -F} file1.rpm ... fileN.rpm" msgstr "" -#: rpm.c:285 +#: rpm.c:288 msgid " rpm {--erase -e} [--root ] [--noscripts] [--rcfile ]" msgstr "" -#: rpm.c:286 +#: rpm.c:289 msgid " [--dbpath ] [--nodeps] [--allmatches]" msgstr "" -#: rpm.c:287 +#: rpm.c:290 msgid " [--justdb] [--notriggers] package1 ... packageN" msgstr "" -#: rpm.c:288 +#: rpm.c:291 msgid " rpm {--resign} [--rcfile ] package1 package2 ... packageN" msgstr "" -#: rpm.c:289 +#: rpm.c:292 msgid " rpm {--addsign} [--rcfile ] package1 package2 ... packageN" msgstr "" -#: rpm.c:290 +#: rpm.c:293 msgid "" " rpm {--checksig -K} [--nopgp] [--nogpg] [--nomd5] [--rcfile ]" msgstr "" -#: rpm.c:291 +#: rpm.c:294 msgid " package1 ... packageN" msgstr "" -#: rpm.c:292 +#: rpm.c:295 msgid " rpm {--rebuilddb} [--rcfile ] [--dbpath ]" msgstr "" -#: rpm.c:293 +#: rpm.c:296 +msgid " rpm {--verifydb} [--rcfile ] [--dbpath ]" +msgstr "" + +#: rpm.c:297 msgid " rpm {--querytags}" msgstr "" -#: rpm.c:327 rpmqv.c:479 +#: rpm.c:331 msgid "Usage:" msgstr "" -#: rpm.c:329 rpmqv.c:481 +#: rpm.c:333 msgid "print this message" msgstr "" -#: rpm.c:331 rpmqv.c:130 rpmqv.c:483 +#: rpm.c:335 rpmqv.c:100 msgid "print the version of rpm being used" msgstr "" -#: rpm.c:334 +#: rpm.c:338 msgid " All modes support the following arguments:" msgstr "" -#: rpm.c:335 +#: rpm.c:339 msgid " --define ' '" msgstr "" -#: rpm.c:336 rpmqv.c:137 rpmqv.c:488 +#: rpm.c:340 rpmqv.c:107 msgid "define macro with value " msgstr "" -#: rpm.c:337 +#: rpm.c:341 msgid " --eval '+' " msgstr "" -#: rpm.c:338 +#: rpm.c:342 msgid "print the expansion of macro to stdout" msgstr "" -#: rpm.c:339 +#: rpm.c:343 msgid " --pipe " msgstr "" -#: rpm.c:340 rpmqv.c:143 rpmqv.c:492 +#: rpm.c:344 rpmqv.c:113 msgid "send stdout to " msgstr "" -#: rpm.c:341 +#: rpm.c:345 msgid " --rcfile " msgstr "" -#: rpm.c:342 +#: rpm.c:346 msgid "use instead of /etc/rpmrc and $HOME/.rpmrc" msgstr "" -#: rpm.c:344 rpmqv.c:161 rpmqv.c:496 +#: rpm.c:348 rpmqv.c:131 msgid "display final rpmrc and macro configuration" msgstr "" -#: rpm.c:346 rpmqv.c:504 +#: rpm.c:350 msgid "be a little more verbose" msgstr "" -#: rpm.c:348 rpmqv.c:506 +#: rpm.c:352 msgid "be incredibly verbose (for debugging)" msgstr "" -#: rpm.c:351 +#: rpm.c:355 msgid " Install, upgrade and query (with -p) allow URL's to be used in place" msgstr "" -#: rpm.c:352 +#: rpm.c:356 msgid " of file names as well as the following options:" msgstr "" -#: rpm.c:353 +#: rpm.c:357 msgid " --ftpproxy " msgstr "" -#: rpm.c:354 rpmqv.c:513 +#: rpm.c:358 msgid "hostname or IP of ftp proxy" msgstr "" -#: rpm.c:355 +#: rpm.c:359 msgid " --ftpport " msgstr "" -#: rpm.c:356 rpmqv.c:515 +#: rpm.c:360 msgid "port number of ftp server (or proxy)" msgstr "" -#: rpm.c:357 +#: rpm.c:361 msgid " --httpproxy " msgstr "" -#: rpm.c:358 rpmqv.c:517 +#: rpm.c:362 msgid "hostname or IP of http proxy" msgstr "" -#: rpm.c:359 +#: rpm.c:363 msgid " --httpport " msgstr "" -#: rpm.c:360 rpmqv.c:519 +#: rpm.c:364 msgid "port number of http server (or proxy)" msgstr "" -#: rpm.c:364 rpmqv.c:539 +#: rpm.c:368 msgid "query mode" msgstr "" -#: rpm.c:365 rpm.c:411 rpm.c:436 rpm.c:488 rpm.c:560 +#: rpm.c:369 rpm.c:415 rpm.c:440 rpm.c:492 rpm.c:566 msgid " --dbpath " msgstr "" -#: rpm.c:366 rpm.c:412 rpm.c:437 rpm.c:489 rpm.c:561 rpmqv.c:499 +#: rpm.c:370 rpm.c:416 rpm.c:441 rpm.c:493 rpm.c:567 msgid "use as the directory for the database" msgstr "" -#: rpm.c:367 +#: rpm.c:371 msgid " --queryformat " msgstr "" -#: rpm.c:368 rpmqv.c:541 +#: rpm.c:372 msgid "use as the header format (implies --info)" msgstr "" -#: rpm.c:369 rpm.c:413 rpm.c:471 rpm.c:500 +#: rpm.c:373 rpm.c:417 rpm.c:475 rpm.c:504 msgid " --root " msgstr "" -#: rpm.c:370 rpm.c:414 rpm.c:472 rpm.c:501 rpm.c:563 rpmqv.c:146 rpmqv.c:501 +#: rpm.c:374 rpm.c:418 rpm.c:476 rpm.c:505 rpm.c:569 rpmqv.c:116 msgid "use as the top level directory" msgstr "" -#: rpm.c:371 +#: rpm.c:375 msgid " Package specification options:" msgstr "" -#: rpm.c:373 +#: rpm.c:377 msgid "query all packages" msgstr "" -#: rpm.c:374 +#: rpm.c:378 msgid " -f + " msgstr "" -#: rpm.c:375 +#: rpm.c:379 msgid "query package owning " msgstr "" -#: rpm.c:376 +#: rpm.c:380 msgid " -p + " msgstr "" -#: rpm.c:377 +#: rpm.c:381 msgid "query (uninstalled) package " msgstr "" -#: rpm.c:378 +#: rpm.c:382 msgid " --triggeredby " msgstr "" -#: rpm.c:379 +#: rpm.c:383 msgid "query packages triggered by " msgstr "" -#: rpm.c:380 +#: rpm.c:384 msgid " --whatprovides " msgstr "" -#: rpm.c:381 +#: rpm.c:385 msgid "query packages which provide capability" msgstr "" -#: rpm.c:382 +#: rpm.c:386 msgid " --whatrequires " msgstr "" -#: rpm.c:383 +#: rpm.c:387 msgid "query packages which require capability" msgstr "" -#: rpm.c:384 +#: rpm.c:388 msgid " Information selection options:" msgstr "" -#: rpm.c:386 rpmqv.c:545 +#: rpm.c:390 msgid "display package information" msgstr "" -#: rpm.c:388 rpmqv.c:547 +#: rpm.c:392 msgid "display the package's change log" msgstr "" -#: rpm.c:390 rpmqv.c:549 +#: rpm.c:394 msgid "display package file list" msgstr "" -#: rpm.c:392 rpmqv.c:551 +#: rpm.c:396 msgid "show file states (implies -l)" msgstr "" -#: rpm.c:394 rpmqv.c:553 +#: rpm.c:398 msgid "list only documentation files (implies -l)" msgstr "" -#: rpm.c:396 rpmqv.c:555 +#: rpm.c:400 msgid "list only configuration files (implies -l)" msgstr "" -#: rpm.c:398 rpmqv.c:557 +#: rpm.c:402 msgid "" -"show all verifiable information for each file (must be used with -l, -c, or " -"-d)" +"show all verifiable information for each file (must be used with -l, -c, or -" +"d)" msgstr "" -#: rpm.c:400 +#: rpm.c:404 msgid "list capabilities package provides" msgstr "" -#: rpm.c:402 +#: rpm.c:406 msgid "list package dependencies" msgstr "" -#: rpm.c:404 +#: rpm.c:408 msgid "print the various [un]install scripts" msgstr "" -#: rpm.c:406 +#: rpm.c:410 msgid "show the trigger scripts contained in the package" msgstr "" -#: rpm.c:410 rpmqv.c:568 +#: rpm.c:414 msgid "" "verify a package installation using the same same package specification " "options as -q" msgstr "" -#: lib/poptBT.c:187 lib/verify.c:60 rpm.c:416 rpm.c:458 rpm.c:493 rpmqv.c:270 -#: rpmqv.c:570 rpmqv.c:618 rpmqv.c:652 +#: lib/poptBT.c:189 lib/poptI.c:128 rpm.c:420 rpm.c:462 rpm.c:497 msgid "do not verify package dependencies" msgstr "" -#: lib/verify.c:66 rpm.c:418 rpmqv.c:210 rpmqv.c:574 +#: lib/poptK.c:67 rpm.c:422 msgid "do not verify file md5 checksums" msgstr "" -#: rpm.c:420 rpmqv.c:572 +#: rpm.c:424 msgid "do not verify file attributes" msgstr "" -#: rpm.c:422 rpmqv.c:579 +#: rpm.c:426 msgid "list the tags that can be used in a query format" msgstr "" -#: rpm.c:425 +#: rpm.c:429 msgid " --install " msgstr "" -#: rpm.c:426 +#: rpm.c:430 msgid " -i " msgstr "" -#: rpm.c:427 rpmqv.c:266 rpmqv.c:593 +#: lib/poptI.c:124 rpm.c:431 msgid "install package" msgstr "" -#: rpm.c:428 +#: rpm.c:432 msgid " --excludepath " msgstr "" -#: rpm.c:429 +#: rpm.c:433 msgid "skip files in path " msgstr "" -#: rpm.c:430 +#: rpm.c:434 msgid " --relocate =" msgstr "" -#: rpm.c:431 rpmqv.c:630 +#: rpm.c:435 msgid "relocate files from to " msgstr "" -#: rpm.c:433 rpmqv.c:238 rpmqv.c:598 +#: lib/poptI.c:90 rpm.c:437 msgid "relocate files in non-relocateable package" msgstr "" -#: rpm.c:434 +#: rpm.c:438 msgid " --prefix " msgstr "" -#: rpm.c:435 rpmqv.c:313 rpmqv.c:628 +#: lib/poptI.c:174 rpm.c:439 msgid "relocate the package to , if relocatable" msgstr "" -#: rpm.c:439 rpmqv.c:244 rpmqv.c:600 +#: lib/poptI.c:98 rpm.c:443 msgid "do not install documentation" msgstr "" -#: rpm.c:441 rpmqv.c:249 rpmqv.c:604 +#: lib/poptI.c:104 rpm.c:445 msgid "short hand for --replacepkgs --replacefiles" msgstr "" -#: rpm.c:443 rpmqv.c:255 rpmqv.c:606 +#: lib/poptI.c:110 rpm.c:447 msgid "print hash marks as package installs (good with -v)" msgstr "" -#: rpm.c:445 rpmqv.c:226 rpmqv.c:595 +#: lib/poptI.c:76 rpm.c:449 msgid "install all files, even configurations which might otherwise be skipped" msgstr "" -#: rpm.c:448 rpmqv.c:257 rpmqv.c:608 +#: lib/poptI.c:113 rpm.c:452 msgid "don't verify package architecture" msgstr "" -#: rpm.c:450 rpmqv.c:262 rpmqv.c:610 +#: lib/poptI.c:119 rpm.c:454 msgid "don't check disk space before installing" msgstr "" -#: rpm.c:452 rpmqv.c:259 rpmqv.c:612 +#: lib/poptI.c:116 rpm.c:456 msgid "don't verify package operating system" msgstr "" -#: rpm.c:454 rpmqv.c:264 rpmqv.c:614 +#: lib/poptI.c:121 rpm.c:458 msgid "install documentation" msgstr "" -#: rpm.c:456 rpm.c:491 rpmqv.c:268 rpmqv.c:616 rpmqv.c:650 +#: lib/poptI.c:126 rpm.c:460 rpm.c:495 msgid "update the database, but do not modify the filesystem" msgstr "" -#: rpm.c:460 rpm.c:495 rpmqv.c:272 rpmqv.c:620 rpmqv.c:654 +#: lib/poptI.c:131 rpm.c:464 rpm.c:499 msgid "do not reorder package installation to satisfy dependencies" msgstr "" -#: rpm.c:462 +#: rpm.c:466 msgid "don't execute any installation scripts" msgstr "" -#: rpm.c:464 rpm.c:499 rpmqv.c:658 +#: rpm.c:468 rpm.c:503 msgid "don't execute any scripts triggered by this package" msgstr "" -#: rpm.c:466 rpmqv.c:311 rpmqv.c:626 +#: lib/poptI.c:172 rpm.c:470 msgid "print percentages as package installs" msgstr "" -#: rpm.c:468 rpmqv.c:322 rpmqv.c:632 +#: lib/poptI.c:184 rpm.c:472 msgid "install even if the package replaces installed files" msgstr "" -#: rpm.c:470 rpmqv.c:324 rpmqv.c:634 +#: lib/poptI.c:187 rpm.c:474 msgid "reinstall if the package is already present" msgstr "" -#: rpm.c:474 rpmqv.c:326 rpmqv.c:636 +#: lib/poptI.c:189 rpm.c:478 msgid "don't install, but tell if it would work or not" msgstr "" -#: rpm.c:477 +#: rpm.c:481 msgid " --upgrade " msgstr "" -#: rpm.c:478 +#: rpm.c:482 msgid " -U " msgstr "" -#: rpm.c:479 rpmqv.c:640 +#: rpm.c:483 msgid "upgrade package (same options as --install, plus)" msgstr "" -#: rpm.c:481 rpmqv.c:308 rpmqv.c:642 +#: lib/poptI.c:168 rpm.c:485 msgid "" "upgrade to an old version of the package (--force on upgrades does this " "automatically)" msgstr "" -#: rpm.c:483 +#: rpm.c:487 msgid " --erase " msgstr "" -#: rpm.c:484 +#: rpm.c:488 msgid " -e " msgstr "" -#: rpm.c:485 rpmqv.c:242 rpmqv.c:646 +#: lib/poptI.c:95 rpm.c:489 msgid "erase (uninstall) package" msgstr "" -#: rpm.c:487 rpmqv.c:229 rpmqv.c:648 +#: lib/poptI.c:80 rpm.c:491 msgid "" "remove all packages which match (normally an error is generated if " " specified multiple packages)" msgstr "" -#: rpm.c:497 rpmqv.c:656 +#: rpm.c:501 msgid "do not execute any package specific scripts" msgstr "" -#: rpm.c:503 +#: rpm.c:507 msgid " -b " msgstr "" -#: rpm.c:504 +#: rpm.c:508 msgid " -t " msgstr "" -#: rpm.c:505 +#: rpm.c:509 msgid "build package, where is one of:" msgstr "" -#: rpm.c:507 +#: rpm.c:511 msgid "prep (unpack sources and apply patches)" msgstr "" -#: rpm.c:509 +#: rpm.c:513 #, c-format msgid "list check (do some cursory checks on %files)" msgstr "" -#: rpm.c:511 +#: rpm.c:515 msgid "compile (prep and compile)" msgstr "" -#: rpm.c:513 +#: rpm.c:517 msgid "install (prep, compile, install)" msgstr "" -#: rpm.c:515 +#: rpm.c:519 msgid "binary package (prep, compile, install, package)" msgstr "" -#: rpm.c:517 +#: rpm.c:521 msgid "bin/src package (prep, compile, install, package)" msgstr "" -#: lib/poptBT.c:198 rpm.c:519 +#: lib/poptBT.c:200 rpm.c:523 msgid "skip straight to specified stage (only for c,i)" msgstr "" -#: lib/poptBT.c:177 rpm.c:521 +#: lib/poptBT.c:179 rpm.c:525 msgid "remove build tree when done" msgstr "" -#: lib/poptBT.c:194 rpm.c:523 +#: lib/poptBT.c:196 rpm.c:527 msgid "remove sources when done" msgstr "" -#: rpm.c:525 +#: rpm.c:529 msgid "remove spec file when done" msgstr "" -#: lib/poptBT.c:200 rpm.c:527 rpmqv.c:202 +#: lib/poptBT.c:202 rpm.c:531 msgid "generate PGP/GPG signature" msgstr "" -#: rpm.c:528 +#: rpm.c:532 msgid " --buildroot " msgstr "" -#: rpm.c:529 +#: rpm.c:533 msgid "use as the build root" msgstr "" -#: rpm.c:530 +#: rpm.c:534 msgid " --target=+" msgstr "" -#: rpm.c:531 +#: rpm.c:535 msgid "build the packages for the build targets platform1...platformN." msgstr "" -#: rpm.c:533 +#: rpm.c:537 msgid "do not execute any stages" msgstr "" -#: rpm.c:535 +#: rpm.c:539 msgid " --rebuild " msgstr "" -#: rpm.c:536 +#: rpm.c:540 msgid "" "install source package, build binary package and remove spec file, sources, " "patches, and icons." msgstr "" -#: rpm.c:537 +#: rpm.c:541 msgid " --recompile " msgstr "" -#: rpm.c:538 +#: rpm.c:542 msgid "like --rebuild, but don't build any package" msgstr "" -#: rpm.c:541 +#: rpm.c:545 msgid " --resign + " msgstr "" -#: rpm.c:542 rpmqv.c:200 rpmqv.c:664 +#: lib/poptK.c:54 rpm.c:546 msgid "sign a package (discard current signature)" msgstr "" -#: rpm.c:543 +#: rpm.c:547 msgid " --addsign + " msgstr "" -#: rpm.c:544 rpmqv.c:198 rpmqv.c:666 +#: lib/poptK.c:52 rpm.c:548 msgid "add a signature to a package" msgstr "" -#: rpm.c:545 +#: rpm.c:549 msgid " --checksig +" msgstr "" -#: rpm.c:546 +#: rpm.c:550 msgid " -K + " msgstr "" -#: rpm.c:547 rpmqv.c:204 rpmqv.c:670 +#: lib/poptK.c:58 rpm.c:551 msgid "verify package signature" msgstr "" -#: rpm.c:549 rpmqv.c:206 rpmqv.c:672 +#: lib/poptK.c:64 rpm.c:553 msgid "skip any PGP signatures" msgstr "" -#: rpm.c:551 rpmqv.c:208 rpmqv.c:674 +#: lib/poptK.c:61 rpm.c:555 msgid "skip any GPG signatures" msgstr "" -#: rpm.c:553 rpmqv.c:676 +#: rpm.c:557 msgid "skip any MD5 signatures" msgstr "" -#: rpm.c:557 +#: rpm.c:561 msgid "make sure a valid database exists" msgstr "" -#: rpm.c:559 +#: rpm.c:563 msgid "rebuild database from existing database" msgstr "" -#: rpm.c:567 rpmqv.c:581 +#: rpm.c:565 rpmdb/poptDB.c:27 +msgid "verify database files" +msgstr "" + +#: rpm.c:573 msgid "" "set the file permissions to those in the package database using the same " "package specification options as -q" msgstr "" -#: rpm.c:570 rpmqv.c:584 +#: rpm.c:576 msgid "" "set the file owner and group to those in the package database using the same " "package specification options as -q" msgstr "" -#: rpm.c:722 rpm.c:728 rpm.c:737 rpm.c:759 rpm.c:765 rpm.c:772 rpm.c:780 -#: rpm.c:788 rpm.c:809 rpm.c:872 rpmqv.c:877 rpmqv.c:883 rpmqv.c:890 -#: rpmqv.c:896 rpmqv.c:938 rpmqv.c:946 rpmqv.c:952 rpmqv.c:960 rpmqv.c:1033 +#: rpm.c:728 rpm.c:734 rpm.c:743 rpm.c:765 rpm.c:771 rpm.c:778 rpm.c:786 +#: rpm.c:794 rpm.c:815 rpm.c:821 rpm.c:884 rpmqv.c:528 rpmqv.c:534 rpmqv.c:540 +#: rpmqv.c:574 msgid "only one major mode may be specified" msgstr "" -#: rpm.c:730 +#: rpm.c:736 msgid "-u and --uninstall are deprecated and no longer work.\n" msgstr "" -#: rpm.c:732 +#: rpm.c:738 msgid "Use -e or --erase instead.\n" msgstr "" -#: rpm.c:815 rpmqv.c:919 +#: lib/poptI.c:49 rpm.c:827 msgid "relocations must begin with a /" msgstr "" -#: rpm.c:817 rpmqv.c:921 +#: lib/poptI.c:51 rpm.c:829 msgid "relocations must contain a =" msgstr "" -#: rpm.c:820 rpmqv.c:925 +#: lib/poptI.c:54 rpm.c:832 msgid "relocations must have a / following the =" msgstr "" -#: rpm.c:829 rpmqv.c:904 +#: lib/poptI.c:37 rpm.c:841 msgid "exclude paths must begin with a /" msgstr "" -#: rpm.c:838 rpmqv.c:986 +#: rpm.c:850 rpmqv.c:481 msgid "The --rcfile option has been eliminated.\n" msgstr "" -#: rpm.c:839 +#: rpm.c:851 msgid "Use --macros with a colon separated list of macro files to read.\n" msgstr "" -#: rpm.c:844 rpmqv.c:993 +#: rpm.c:856 rpmqv.c:488 #, c-format msgid "Internal error in argument processing (%d) :-(\n" msgstr "" -#: rpm.c:879 rpmqv.c:1048 +#: rpm.c:891 rpmqv.c:555 msgid "one type of query/verify may be performed at a time" msgstr "" -#: rpm.c:884 rpmqv.c:1052 +#: rpm.c:896 rpmqv.c:559 msgid "unexpected query flags" msgstr "" -#: rpm.c:887 rpmqv.c:1055 +#: rpm.c:899 rpmqv.c:562 msgid "unexpected query format" msgstr "" -#: rpm.c:890 rpmqv.c:1058 +#: rpm.c:902 rpmqv.c:565 msgid "unexpected query source" msgstr "" -#: rpm.c:893 rpmqv.c:1068 +#: rpm.c:905 rpmqv.c:590 msgid "only installation, upgrading, rmsource and rmspec may be forced" msgstr "" -#: rpm.c:896 rpmqv.c:1073 +#: rpm.c:908 rpmqv.c:592 msgid "files may only be relocated during package installation" msgstr "" -#: rpm.c:899 rpmqv.c:1076 +#: rpm.c:911 rpmqv.c:595 msgid "only one of --prefix or --relocate may be used" msgstr "" -#: rpm.c:902 rpmqv.c:1079 +#: rpm.c:914 rpmqv.c:598 msgid "" "--relocate and --excludepath may only be used when installing new packages" msgstr "" -#: rpm.c:905 rpmqv.c:1082 +#: rpm.c:917 rpmqv.c:601 msgid "--prefix may only be used when installing new packages" msgstr "" -#: rpm.c:908 rpmqv.c:1085 +#: rpm.c:920 rpmqv.c:604 msgid "arguments to --prefix must begin with a /" msgstr "" -#: rpm.c:911 rpmqv.c:1088 +#: rpm.c:923 rpmqv.c:607 msgid "--hash (-h) may only be specified during package installation" msgstr "" -#: rpm.c:915 rpmqv.c:1092 +#: rpm.c:927 rpmqv.c:611 msgid "--percent may only be specified during package installation" msgstr "" -#: rpm.c:919 rpmqv.c:1097 +#: rpm.c:931 rpmqv.c:616 msgid "--replacefiles may only be specified during package installation" msgstr "" -#: rpm.c:923 rpmqv.c:1101 +#: rpm.c:935 rpmqv.c:620 msgid "--replacepkgs may only be specified during package installation" msgstr "" -#: rpm.c:927 rpmqv.c:1105 +#: rpm.c:939 rpmqv.c:624 msgid "--excludedocs may only be specified during package installation" msgstr "" -#: rpm.c:931 rpmqv.c:1109 +#: rpm.c:943 rpmqv.c:628 msgid "--includedocs may only be specified during package installation" msgstr "" -#: rpm.c:935 rpmqv.c:1113 +#: rpm.c:947 rpmqv.c:632 msgid "only one of --excludedocs and --includedocs may be specified" msgstr "" -#: rpm.c:939 rpmqv.c:1117 +#: rpm.c:951 rpmqv.c:636 msgid "--ignorearch may only be specified during package installation" msgstr "" -#: rpm.c:943 rpmqv.c:1121 +#: rpm.c:955 rpmqv.c:640 msgid "--ignoreos may only be specified during package installation" msgstr "" -#: rpm.c:947 rpmqv.c:1126 +#: rpm.c:959 rpmqv.c:645 msgid "--ignoresize may only be specified during package installation" msgstr "" -#: rpm.c:951 rpmqv.c:1130 +#: rpm.c:963 rpmqv.c:649 msgid "--allmatches may only be specified during package erasure" msgstr "" -#: rpm.c:955 rpmqv.c:1134 +#: rpm.c:967 rpmqv.c:653 msgid "--allfiles may only be specified during package installation" msgstr "" -#: rpm.c:959 rpmqv.c:1139 +#: rpm.c:971 rpmqv.c:658 msgid "--justdb may only be specified during package installation and erasure" msgstr "" -#: rpm.c:966 +#: rpm.c:978 msgid "" "script disabling options may only be specified during package installation, " "erasure, and verification" msgstr "" -#: rpm.c:970 +#: rpm.c:982 msgid "--apply may only be specified during package installation" msgstr "" -#: rpm.c:975 rpmqv.c:1151 +#: rpm.c:987 rpmqv.c:668 msgid "" "trigger disabling options may only be specified during package installation " "and erasure" msgstr "" -#: rpm.c:979 rpmqv.c:1155 +#: rpm.c:991 rpmqv.c:672 msgid "" "--nodeps may only be specified during package building, rebuilding, " "recompilation, installation,erasure, and verification" msgstr "" -#: rpm.c:984 rpmqv.c:1160 +#: rpm.c:996 rpmqv.c:677 msgid "" "--test may only be specified during package installation, erasure, and " "building" msgstr "" -#: rpm.c:988 rpmqv.c:1165 +#: rpm.c:1000 rpmqv.c:682 msgid "" "--root (-r) may only be specified during installation, erasure, querying, " "and database rebuilds" msgstr "" -#: rpm.c:1000 rpmqv.c:1177 +#: rpm.c:1012 rpmqv.c:694 msgid "arguments to --root (-r) must begin with a /" msgstr "" -#: rpm.c:1006 +#: rpm.c:1018 msgid "--oldpackage may only be used during upgrades" msgstr "" -#: rpm.c:1009 rpmqv.c:1184 +#: rpm.c:1021 msgid "--nopgp may only be used during signature checking" msgstr "" -#: rpm.c:1012 rpmqv.c:1187 +#: rpm.c:1024 msgid "--nogpg may only be used during signature checking" msgstr "" -#: rpm.c:1015 rpmqv.c:1192 +#: rpm.c:1027 msgid "" "--nomd5 may only be used during signature checking and package verification" msgstr "" -#: rpm.c:1026 rpmqv.c:1208 +#: rpm.c:1038 rpmqv.c:715 msgid "no files to sign\n" msgstr "" -#: rpm.c:1031 rpmqv.c:1213 +#: rpm.c:1043 rpmqv.c:720 #, c-format msgid "cannot access file %s\n" msgstr "" -#: rpm.c:1046 rpmqv.c:1232 +#: rpm.c:1058 rpmqv.c:739 msgid "pgp not found: " msgstr "" -#: rpm.c:1050 rpmqv.c:1237 +#: rpm.c:1062 rpmqv.c:744 msgid "Enter pass phrase: " msgstr "" -#: rpm.c:1052 rpmqv.c:1239 +#: rpm.c:1064 rpmqv.c:746 msgid "Pass phrase check failed\n" msgstr "" -#: rpm.c:1055 rpmqv.c:1243 +#: rpm.c:1067 rpmqv.c:750 msgid "Pass phrase is good.\n" msgstr "" -#: rpm.c:1060 rpmqv.c:1248 +#: rpm.c:1072 rpmqv.c:755 +#, c-format msgid "Invalid %%_signature spec in macro file.\n" msgstr "" -#: rpm.c:1066 rpmqv.c:1255 +#: rpm.c:1078 rpmqv.c:762 msgid "--sign may only be used during package building" msgstr "" -#: rpm.c:1081 rpmqv.c:1271 +#: rpm.c:1093 rpmqv.c:778 msgid "exec failed\n" msgstr "" -#: rpm.c:1100 rpmqv.c:1521 +#: rpm.c:1116 rpmqv.c:985 msgid "unexpected arguments to --querytags " msgstr "" -#: rpm.c:1111 rpmqv.c:1545 +#: rpm.c:1127 rpmqv.c:994 msgid "no packages given for signature check" msgstr "" -#: rpm.c:1122 rpmqv.c:1556 +#: rpm.c:1138 rpmqv.c:1003 msgid "no packages given for signing" msgstr "" -#: rpm.c:1138 rpmqv.c:1415 +#: rpm.c:1154 rpmqv.c:896 msgid "no packages given for uninstall" msgstr "" -#: rpm.c:1227 rpmqv.c:1444 +#: rpm.c:1243 rpmqv.c:919 msgid "no packages given for install" msgstr "" -#: rpm.c:1251 rpmqv.c:1487 +#: rpm.c:1267 rpmqv.c:948 msgid "extra arguments given for query of all packages" msgstr "" -#: rpm.c:1256 rpmqv.c:1492 +#: rpm.c:1272 rpmqv.c:957 msgid "no arguments given for query" msgstr "" -#: rpm.c:1273 rpmqv.c:1509 +#: rpm.c:1289 rpmqv.c:973 msgid "extra arguments given for verify of all packages" msgstr "" -#: rpm.c:1277 rpmqv.c:1513 +#: rpm.c:1293 rpmqv.c:977 msgid "no arguments given for verify" msgstr "" -#: rpm2cpio.c:24 -#, c-format -msgid "cannot open package: %s\n" -msgstr "" - #: rpm2cpio.c:34 msgid "argument is not an RPM package\n" msgstr "" @@ -1101,654 +1104,364 @@ msgstr "" msgid "cannot re-open payload: %s\n" msgstr "" -#: rpmqv.c:133 +#: rpmqv.c:103 msgid "provide less detailed output" msgstr "" -#: rpmqv.c:135 +#: rpmqv.c:105 msgid "provide more detailed output" msgstr "" -#: rpmqv.c:138 +#: rpmqv.c:108 msgid "' '" msgstr "" -#: rpmqv.c:140 +#: rpmqv.c:110 msgid "print macro expansion of +" msgstr "" -#: rpmqv.c:141 +#: rpmqv.c:111 msgid "+" msgstr "" -#: rpmqv.c:144 +#: rpmqv.c:114 msgid "" msgstr "" -#: rpmqv.c:147 rpmqv.c:314 +#: lib/poptI.c:175 rpmqv.c:117 msgid "" msgstr "" -#: rpmqv.c:149 +#: rpmqv.c:119 msgid "read instead of default macro file(s)" msgstr "" -#: rpmqv.c:150 rpmqv.c:154 rpmqv.c:158 +#: rpmqv.c:120 rpmqv.c:124 rpmqv.c:128 msgid "" msgstr "" -#: rpmqv.c:153 rpmqv.c:157 +#: rpmqv.c:123 rpmqv.c:127 msgid "read instead of default rpmrc file(s)" msgstr "" -#: rpmqv.c:166 +#: rpmqv.c:136 msgid "disable use of libio(3) API" msgstr "" -#: rpmqv.c:169 +#: rpmqv.c:139 msgid "debug protocol data stream" msgstr "" -#: rpmqv.c:171 +#: rpmqv.c:141 msgid "debug rpmio I/O" msgstr "" -#: rpmqv.c:173 +#: rpmqv.c:143 msgid "debug URL cache handling" msgstr "" -#: rpmqv.c:181 -msgid "initialize database" +#: rpmqv.c:161 +msgid "Query options (with -q or --query):" msgstr "" -#: rpmqv.c:183 -msgid "rebuild database inverted lists from installed package headers" +#: rpmqv.c:164 +msgid "Verify options (with -V or --verify):" msgstr "" -#: rpmqv.c:186 -msgid "generate headers compatible with (legacy) rpm[23] packaging" +#: rpmqv.c:170 +msgid "Signature options:" msgstr "" -#: lib/poptBT.c:179 rpmqv.c:189 -msgid "generate headers compatible with rpm4 packaging" +#: rpmqv.c:176 +msgid "Database options:" msgstr "" -#: rpmqv.c:235 rpmqv.c:277 -msgid "do not execute package scriptlet(s)" +#: rpmqv.c:182 +msgid "Build options with [ | | ]:" msgstr "" -#: rpmqv.c:240 -msgid "save erased package files by renaming into sub-directory" +#: rpmqv.c:188 +msgid "Install/Upgrade/Erase options:" msgstr "" -#: rpmqv.c:242 -msgid "+" +#: rpmqv.c:193 +msgid "Common options for all rpm modes:" msgstr "" -#: rpmqv.c:246 rpmqv.c:602 -msgid "skip files with leading component " +#: lib/poptI.c:20 rpmqv.c:208 +#, c-format +msgid "%s: %s\n" msgstr "" -#: rpmqv.c:247 -msgid "" +#: rpmqv.c:233 +#, c-format +msgid "Usage: %s {--help}\n" msgstr "" -#: rpmqv.c:252 -msgid "upgrade package(s) if already installed" +#: rpmqv.c:482 +msgid "Use \"--macros \" instead.\n" msgstr "" -#: rpmqv.c:253 rpmqv.c:266 rpmqv.c:329 -msgid "+" +#: rpmqv.c:584 +msgid "--dbpath given for operation that does not use a database" msgstr "" -#: rpmqv.c:280 -msgid "do not execute %%pre scriptlet (if any)" +#: rpmqv.c:663 +msgid "" +"script disabling options may only be specified during package installation " +"and erasure" msgstr "" -#: rpmqv.c:283 -msgid "do not execute %%post scriptlet (if any)" +#: rpmqv.c:808 +msgid "no packages files given for rebuild" msgstr "" -#: rpmqv.c:286 -msgid "do not execute %%preun scriptlet (if any)" +#: rpmqv.c:877 +msgid "no spec files given for build" msgstr "" -#: rpmqv.c:289 -msgid "do not execute %%postun scriptlet (if any)" +#: rpmqv.c:879 +msgid "no tar files given for build" msgstr "" -#: rpmqv.c:293 -msgid "do not execute any scriptlet(s) triggered by this package" +#: build/build.c:119 build/pack.c:416 +msgid "Unable to open temp file.\n" msgstr "" -#: rpmqv.c:296 -msgid "do not execute any %%triggerprein scriptlet(s)" +#: build/build.c:198 +#, c-format +msgid "Executing(%s): %s\n" msgstr "" -#: rpmqv.c:299 -msgid "do not execute any %%triggerin scriptlet(s)" +#: build/build.c:204 +#, c-format +msgid "Exec of %s failed (%s): %s\n" msgstr "" -#: rpmqv.c:302 -msgid "do not execute any %%triggerun scriptlet(s)" +#: build/build.c:213 +#, c-format +msgid "Bad exit status from %s (%s)\n" msgstr "" -#: rpmqv.c:305 -msgid "do not execute any %%triggerpostun scriptlet(s)" +#: build/build.c:313 +msgid "" +"\n" +"\n" +"RPM build errors:\n" msgstr "" -#: rpmqv.c:316 -msgid "relocate files from path to " +#: build/expression.c:216 +msgid "syntax error while parsing ==\n" msgstr "" -#: rpmqv.c:317 -msgid "=" +#: build/expression.c:246 +msgid "syntax error while parsing &&\n" msgstr "" -#: rpmqv.c:319 -msgid "save erased package files by repackaging" +#: build/expression.c:255 +msgid "syntax error while parsing ||\n" msgstr "" -#: rpmqv.c:328 -msgid "upgrade package(s)" +#: build/expression.c:295 +msgid "parse error in expression\n" msgstr "" -#: rpmqv.c:348 -msgid "Query options (with -q or --query):" +#: build/expression.c:327 +msgid "unmatched (\n" msgstr "" -#: rpmqv.c:351 -msgid "Verify options (with -V or --verify):" +#: build/expression.c:357 +msgid "- only on numbers\n" msgstr "" -#: rpmqv.c:357 -msgid "Signature options:" +#: build/expression.c:373 +msgid "! only on numbers\n" msgstr "" -#: rpmqv.c:363 -msgid "Database options:" +#: build/expression.c:415 build/expression.c:463 build/expression.c:521 +#: build/expression.c:613 +msgid "types must match\n" msgstr "" -#: rpmqv.c:369 -msgid "Build options with [ | | ]:" +#: build/expression.c:428 +msgid "* / not suported for strings\n" msgstr "" -#: rpmqv.c:375 -msgid "Install/Upgrade/Erase options:" +#: build/expression.c:479 +msgid "- not suported for strings\n" msgstr "" -#: rpmqv.c:380 -msgid "Common options for all rpm modes:" +#: build/expression.c:626 +msgid "&& and || not suported for strings\n" msgstr "" -#: rpmqv.c:415 -#, c-format -msgid "Usage: %s {--help}\n" +#: build/expression.c:659 build/expression.c:706 +msgid "syntax error in expression\n" msgstr "" -#: rpmqv.c:486 -msgid " All modes support the following options:" +#: build/files.c:263 +#, c-format +msgid "TIMECHECK failure: %s\n" msgstr "" -#: rpmqv.c:487 -msgid " --define ' '" +#: build/files.c:321 build/files.c:414 build/files.c:597 +#, c-format +msgid "Missing '(' in %s %s\n" msgstr "" -#: rpmqv.c:489 -msgid " --eval '+' " +#: build/files.c:332 build/files.c:539 build/files.c:608 +#, c-format +msgid "Missing ')' in %s(%s\n" msgstr "" -#: rpmqv.c:490 -msgid "print the expansion of macro to stdout" +#: build/files.c:370 build/files.c:564 +#, c-format +msgid "Invalid %s token: %s\n" msgstr "" -#: rpmqv.c:491 -msgid " --pipe " -msgstr "" - -#: rpmqv.c:493 -msgid " --rcfile " -msgstr "" - -#: rpmqv.c:494 -msgid "use instead of default list of macro files" -msgstr "" - -#: rpmqv.c:498 -msgid " --dbpath " -msgstr "" - -#: rpmqv.c:500 -msgid " --root " -msgstr "" - -#: rpmqv.c:510 -msgid "" -" Install, upgrade and query (with -p) modes allow URL's to be used in place" -msgstr "" - -#: rpmqv.c:511 -msgid " of file names as well as the following options:" -msgstr "" - -#: rpmqv.c:512 -msgid " --ftpproxy " -msgstr "" - -#: rpmqv.c:514 -msgid " --ftpport " -msgstr "" - -#: rpmqv.c:516 -msgid " --httpproxy " -msgstr "" - -#: rpmqv.c:518 -msgid " --httpport " -msgstr "" - -#: rpmqv.c:524 -msgid " Package specification options:" -msgstr "" - -#: lib/poptQV.c:68 rpmqv.c:526 -msgid "query/verify all packages" -msgstr "" - -#: rpmqv.c:527 -msgid " -f + " -msgstr "" - -#: rpmqv.c:528 -msgid "query/verify package owning " -msgstr "" - -#: rpmqv.c:529 -msgid " -p + " -msgstr "" - -#: rpmqv.c:530 -msgid "query/verify (uninstalled) package " -msgstr "" - -#: rpmqv.c:531 -msgid " --triggeredby " -msgstr "" - -#: rpmqv.c:532 -msgid "query/verify packages triggered by " -msgstr "" - -#: rpmqv.c:533 -msgid " --whatprovides " -msgstr "" - -#: rpmqv.c:534 -msgid "query/verify packages which provide capability" -msgstr "" - -#: rpmqv.c:535 -msgid " --whatrequires " -msgstr "" - -#: rpmqv.c:536 -msgid "query/verify packages which require capability" -msgstr "" - -#: rpmqv.c:540 -msgid " --queryformat " -msgstr "" - -#: rpmqv.c:543 -msgid " Information selection options:" -msgstr "" - -#: rpmqv.c:559 -msgid "list capabilities provided by package" -msgstr "" - -#: rpmqv.c:561 -msgid "list capabilities required by package" -msgstr "" - -#: rpmqv.c:563 -msgid "print the various [un]install scriptlets" -msgstr "" - -#: rpmqv.c:565 -msgid "show the trigger scriptlets contained in the package" -msgstr "" - -#: rpmqv.c:576 -msgid "do not execute scripts (if any)" -msgstr "" - -#: rpmqv.c:591 -msgid " --install " -msgstr "" - -#: rpmqv.c:592 -msgid " -i " -msgstr "" - -#: rpmqv.c:601 -msgid " --excludepath " -msgstr "" - -#: rpmqv.c:622 -msgid "don't execute any installation scriptlets" -msgstr "" - -#: rpmqv.c:624 -msgid "don't execute any scriptlets triggered by this package" -msgstr "" - -#: rpmqv.c:627 -msgid " --prefix " -msgstr "" - -#: rpmqv.c:629 -msgid " --relocate =" -msgstr "" - -#: rpmqv.c:638 -msgid " --upgrade " -msgstr "" - -#: rpmqv.c:639 -msgid " -U " -msgstr "" - -#: rpmqv.c:644 -msgid " --erase " -msgstr "" - -#: rpmqv.c:645 -msgid " -e " -msgstr "" - -#: rpmqv.c:663 -msgid " --resign + " -msgstr "" - -#: rpmqv.c:665 -msgid " --addsign + " -msgstr "" - -#: rpmqv.c:668 -msgid " --checksig +" -msgstr "" - -#: rpmqv.c:669 -msgid " -K + " -msgstr "" - -#: rpmqv.c:682 -msgid "initalize database (unnecessary, legacy use)" -msgstr "" - -#: rpmqv.c:684 -msgid "rebuild database indices from existing database headers" -msgstr "" - -#: rpmqv.c:987 -msgid "Use \"--macros \" instead.\n" -msgstr "" - -#: rpmqv.c:1062 -msgid "--dbpath given for operation that does not use a database" -msgstr "" - -#: rpmqv.c:1146 -msgid "" -"script disabling options may only be specified during package installation " -"and erasure" -msgstr "" - -#: rpmqv.c:1313 -msgid "no packages files given for rebuild" -msgstr "" - -#: rpmqv.c:1382 -msgid "no spec files given for build" -msgstr "" - -#: rpmqv.c:1384 -msgid "no tar files given for build" -msgstr "" - -#: build/build.c:119 build/pack.c:411 -msgid "Unable to open temp file.\n" -msgstr "" - -#: build/build.c:198 -#, c-format -msgid "Executing(%s): %s\n" -msgstr "" - -#: build/build.c:204 -#, c-format -msgid "Exec of %s failed (%s): %s\n" -msgstr "" - -#: build/build.c:213 -#, c-format -msgid "Bad exit status from %s (%s)\n" -msgstr "" - -#: build/build.c:313 -msgid "" -"\n" -"\n" -"RPM build errors:\n" -msgstr "" - -#: build/expression.c:216 -msgid "syntax error while parsing ==\n" -msgstr "" - -#: build/expression.c:246 -msgid "syntax error while parsing &&\n" -msgstr "" - -#: build/expression.c:255 -msgid "syntax error while parsing ||\n" -msgstr "" - -#: build/expression.c:295 -msgid "parse error in expression\n" -msgstr "" - -#: build/expression.c:327 -msgid "unmatched (\n" -msgstr "" - -#: build/expression.c:357 -msgid "- only on numbers\n" -msgstr "" - -#: build/expression.c:373 -msgid "! only on numbers\n" -msgstr "" - -#: build/expression.c:415 build/expression.c:463 build/expression.c:521 -#: build/expression.c:613 -msgid "types must match\n" -msgstr "" - -#: build/expression.c:428 -msgid "* / not suported for strings\n" -msgstr "" - -#: build/expression.c:479 -msgid "- not suported for strings\n" -msgstr "" - -#: build/expression.c:626 -msgid "&& and || not suported for strings\n" -msgstr "" - -#: build/expression.c:659 build/expression.c:706 -msgid "syntax error in expression\n" -msgstr "" - -#: build/files.c:261 -#, c-format -msgid "TIMECHECK failure: %s\n" -msgstr "" - -#: build/files.c:319 build/files.c:412 build/files.c:595 -#, c-format -msgid "Missing '(' in %s %s\n" -msgstr "" - -#: build/files.c:330 build/files.c:537 build/files.c:606 -#, c-format -msgid "Missing ')' in %s(%s\n" -msgstr "" - -#: build/files.c:368 build/files.c:562 -#, c-format -msgid "Invalid %s token: %s\n" -msgstr "" - -#: build/files.c:428 +#: build/files.c:430 #, c-format msgid "Non-white space follows %s(): %s\n" msgstr "" -#: build/files.c:466 +#: build/files.c:468 #, c-format msgid "Bad syntax: %s(%s)\n" msgstr "" -#: build/files.c:476 +#: build/files.c:478 #, c-format msgid "Bad mode spec: %s(%s)\n" msgstr "" -#: build/files.c:488 +#: build/files.c:490 #, c-format msgid "Bad dirmode spec: %s(%s)\n" msgstr "" -#: build/files.c:633 +#: build/files.c:635 +#, c-format msgid "Unusual locale length: \"%.*s\" in %%lang(%s)\n" msgstr "" -#: build/files.c:644 +#: build/files.c:646 +#, c-format msgid "Duplicate locale %.*s in %%lang(%s)\n" msgstr "" -#: build/files.c:790 +#: build/files.c:792 +#, c-format msgid "Hit limit for %%docdir\n" msgstr "" -#: build/files.c:796 +#: build/files.c:798 +#, c-format msgid "Only one arg for %%docdir\n" msgstr "" #. We already got a file -- error -#: build/files.c:824 +#: build/files.c:826 #, c-format msgid "Two files on one line: %s\n" msgstr "" -#: build/files.c:838 +#: build/files.c:840 #, c-format msgid "File must begin with \"/\": %s\n" msgstr "" -#: build/files.c:850 +#: build/files.c:852 +#, c-format msgid "Can't mix special %%doc with other forms: %s\n" msgstr "" -#: build/files.c:1021 +#: build/files.c:1023 #, c-format msgid "File listed twice: %s\n" msgstr "" -#: build/files.c:1163 +#: build/files.c:1165 #, c-format msgid "Symlink points to BuildRoot: %s -> %s\n" msgstr "" -#: build/files.c:1354 +#: build/files.c:1356 #, c-format msgid "File doesn't match prefix (%s): %s\n" msgstr "" -#: build/files.c:1364 +#: build/files.c:1366 #, c-format msgid "File not found: %s\n" msgstr "" -#: build/files.c:1407 build/files.c:1959 build/parsePrep.c:44 +#: build/files.c:1409 build/files.c:1961 build/parsePrep.c:45 #, c-format msgid "Bad owner/group: %s\n" msgstr "" -#: build/files.c:1419 +#: build/files.c:1421 #, c-format msgid "File %4d: %07o %s.%s\t %s\n" msgstr "" -#: build/files.c:1500 +#: build/files.c:1502 #, c-format msgid "File needs leading \"/\": %s\n" msgstr "" -#: build/files.c:1530 +#: build/files.c:1532 #, c-format msgid "File not found by glob: %s\n" msgstr "" -#: build/files.c:1588 +#: build/files.c:1590 +#, c-format msgid "Could not open %%files file %s: %s\n" msgstr "" -#: build/files.c:1599 build/pack.c:134 +#: build/files.c:1601 build/pack.c:136 #, c-format msgid "line: %s\n" msgstr "" -#: build/files.c:1947 +#: build/files.c:1949 #, c-format msgid "Bad file: %s: %s\n" msgstr "" #. XXX this error message is probably not seen. -#: build/files.c:2018 +#: build/files.c:2020 #, c-format msgid "Couldn't exec %s: %s\n" msgstr "" -#: build/files.c:2023 +#: build/files.c:2025 #, c-format msgid "Couldn't fork %s: %s\n" msgstr "" -#: build/files.c:2105 +#: build/files.c:2107 #, c-format msgid "%s failed\n" msgstr "" -#: build/files.c:2109 +#: build/files.c:2111 #, c-format msgid "failed to write all data to %s\n" msgstr "" -#: build/files.c:2239 +#: build/files.c:2243 #, c-format msgid "Finding %s: (using %s)...\n" msgstr "" -#: build/files.c:2263 build/files.c:2277 +#: build/files.c:2269 build/files.c:2283 #, c-format msgid "Failed to find %s:\n" msgstr "" -#: build/files.c:2396 +#: build/files.c:2402 #, c-format msgid "Processing files: %s-%s-%s\n" msgstr "" @@ -1774,126 +1487,131 @@ msgstr "" msgid "Could not canonicalize hostname: %s\n" msgstr "" -#: build/pack.c:74 +#: build/pack.c:76 #, c-format msgid "create archive failed on file %s: %s\n" msgstr "" -#: build/pack.c:96 +#: build/pack.c:98 #, c-format msgid "cpio_copy write failed: %s\n" msgstr "" -#: build/pack.c:103 +#: build/pack.c:105 #, c-format msgid "cpio_copy read failed: %s\n" msgstr "" -#: build/pack.c:196 +#: build/pack.c:198 #, c-format msgid "Could not open PreIn file: %s\n" msgstr "" -#: build/pack.c:203 +#: build/pack.c:205 #, c-format msgid "Could not open PreUn file: %s\n" msgstr "" -#: build/pack.c:210 +#: build/pack.c:212 #, c-format msgid "Could not open PostIn file: %s\n" msgstr "" -#: build/pack.c:217 +#: build/pack.c:219 #, c-format msgid "Could not open PostUn file: %s\n" msgstr "" -#: build/pack.c:225 +#: build/pack.c:227 #, c-format msgid "Could not open VerifyScript file: %s\n" msgstr "" -#: build/pack.c:240 +#: build/pack.c:242 #, c-format msgid "Could not open Trigger script file: %s\n" msgstr "" -#: build/pack.c:265 +#: build/pack.c:270 #, c-format msgid "readRPM: open %s: %s\n" msgstr "" -#: build/pack.c:274 +#: build/pack.c:279 #, c-format msgid "readRPM: read %s: %s\n" msgstr "" -#: build/pack.c:296 +#: build/pack.c:287 build/pack.c:457 +#, c-format +msgid "%s: Fseek failed: %s\n" +msgstr "" + +#: build/pack.c:303 #, c-format msgid "readRPM: %s is not an RPM package\n" msgstr "" -#: build/pack.c:305 +#: build/pack.c:312 #, c-format msgid "readRPM: reading header from %s\n" msgstr "" -#: build/pack.c:424 +#: build/pack.c:428 msgid "Bad CSA data\n" msgstr "" -#: build/pack.c:466 +#: build/pack.c:480 #, c-format msgid "Generating signature: %d\n" msgstr "" -#: build/pack.c:480 +#: build/pack.c:499 #, c-format msgid "Could not open %s: %s\n" msgstr "" -#: build/pack.c:517 lib/psm.c:1460 +#: build/pack.c:536 lib/psm.c:1503 #, c-format msgid "Unable to write package: %s\n" msgstr "" -#: build/pack.c:532 +#: build/pack.c:551 #, c-format msgid "Unable to open sigtarget %s: %s\n" msgstr "" -#: build/pack.c:542 +#: build/pack.c:561 #, c-format msgid "Unable to read header from %s: %s\n" msgstr "" -#: build/pack.c:556 +#: build/pack.c:575 #, c-format msgid "Unable to write header to %s: %s\n" msgstr "" -#: build/pack.c:566 +#: build/pack.c:585 #, c-format msgid "Unable to read payload from %s: %s\n" msgstr "" -#: build/pack.c:572 +#: build/pack.c:591 #, c-format msgid "Unable to write payload to %s: %s\n" msgstr "" -#: build/pack.c:599 lib/psm.c:1719 +#: build/pack.c:617 lib/psm.c:1762 #, c-format msgid "Wrote: %s\n" msgstr "" -#: build/pack.c:667 +#: build/pack.c:683 #, c-format msgid "Could not generate output filename for package %s: %s\n" msgstr "" -#: build/pack.c:684 +#: build/pack.c:700 #, c-format msgid "cannot create %s: %s\n" msgstr "" @@ -1903,234 +1621,257 @@ msgstr "" msgid "line %d: second %s\n" msgstr "" -#: build/parseChangelog.c:123 +#: build/parseChangelog.c:125 +#, c-format msgid "%%changelog entries must start with *\n" msgstr "" -#: build/parseChangelog.c:131 +#: build/parseChangelog.c:133 +#, c-format msgid "incomplete %%changelog entry\n" msgstr "" -#: build/parseChangelog.c:148 +#: build/parseChangelog.c:150 +#, c-format msgid "bad date in %%changelog: %s\n" msgstr "" -#: build/parseChangelog.c:153 +#: build/parseChangelog.c:155 +#, c-format msgid "%%changelog not in decending chronological order\n" msgstr "" -#: build/parseChangelog.c:161 build/parseChangelog.c:172 +#: build/parseChangelog.c:163 build/parseChangelog.c:174 +#, c-format msgid "missing name in %%changelog\n" msgstr "" -#: build/parseChangelog.c:179 +#: build/parseChangelog.c:181 +#, c-format msgid "no description in %%changelog\n" msgstr "" -#: build/parseDescription.c:39 +#: build/parseDescription.c:41 +#, c-format msgid "line %d: Error parsing %%description: %s\n" msgstr "" -#: build/parseDescription.c:52 build/parseFiles.c:50 build/parseScript.c:190 +#: build/parseDescription.c:54 build/parseFiles.c:50 build/parseScript.c:191 #, c-format msgid "line %d: Bad option %s: %s\n" msgstr "" -#: build/parseDescription.c:65 build/parseFiles.c:62 build/parseScript.c:202 +#: build/parseDescription.c:67 build/parseFiles.c:62 build/parseScript.c:203 #, c-format msgid "line %d: Too many names: %s\n" msgstr "" -#: build/parseDescription.c:75 build/parseFiles.c:71 build/parseScript.c:211 +#: build/parseDescription.c:77 build/parseFiles.c:71 build/parseScript.c:212 #, c-format msgid "line %d: Package does not exist: %s\n" msgstr "" -#: build/parseDescription.c:87 +#: build/parseDescription.c:89 #, c-format msgid "line %d: Second description\n" msgstr "" #: build/parseFiles.c:36 +#, c-format msgid "line %d: Error parsing %%files: %s\n" msgstr "" #: build/parseFiles.c:78 +#, c-format msgid "line %d: Second %%files list\n" msgstr "" -#: build/parsePreamble.c:218 +#: build/parsePreamble.c:227 #, c-format msgid "Architecture is excluded: %s\n" msgstr "" -#: build/parsePreamble.c:223 +#: build/parsePreamble.c:232 #, c-format msgid "Architecture is not included: %s\n" msgstr "" -#: build/parsePreamble.c:228 +#: build/parsePreamble.c:237 #, c-format msgid "OS is excluded: %s\n" msgstr "" -#: build/parsePreamble.c:233 +#: build/parsePreamble.c:242 #, c-format msgid "OS is not included: %s\n" msgstr "" -#: build/parsePreamble.c:250 +#: build/parsePreamble.c:264 #, c-format msgid "%s field must be present in package: %s\n" msgstr "" -#: build/parsePreamble.c:277 +#: build/parsePreamble.c:292 #, c-format msgid "Duplicate %s entries in package: %s\n" msgstr "" -#: build/parsePreamble.c:331 +#: build/parsePreamble.c:348 #, c-format msgid "Unable to open icon %s: %s\n" msgstr "" -#: build/parsePreamble.c:349 +#: build/parsePreamble.c:366 #, c-format msgid "Unable to read icon %s: %s\n" msgstr "" -#: build/parsePreamble.c:362 +#: build/parsePreamble.c:379 #, c-format msgid "Unknown icon type: %s\n" msgstr "" -#: build/parsePreamble.c:435 +#: build/parsePreamble.c:423 +#, c-format +msgid "line %d: Tag takes single token only: %s\n" +msgstr "" + +#: build/parsePreamble.c:459 #, c-format msgid "line %d: Malformed tag: %s\n" msgstr "" #. Empty field -#: build/parsePreamble.c:443 +#: build/parsePreamble.c:467 #, c-format msgid "line %d: Empty tag: %s\n" msgstr "" -#: build/parsePreamble.c:465 build/parsePreamble.c:472 +#: build/parsePreamble.c:489 build/parsePreamble.c:496 #, c-format msgid "line %d: Illegal char '-' in %s: %s\n" msgstr "" -#: build/parsePreamble.c:529 build/parseSpec.c:389 +#: build/parsePreamble.c:553 build/parseSpec.c:391 #, c-format msgid "BuildRoot can not be \"/\": %s\n" msgstr "" -#: build/parsePreamble.c:542 +#: build/parsePreamble.c:566 #, c-format msgid "line %d: Prefixes must not end with \"/\": %s\n" msgstr "" -#: build/parsePreamble.c:554 +#: build/parsePreamble.c:578 #, c-format msgid "line %d: Docdir must begin with '/': %s\n" msgstr "" -#: build/parsePreamble.c:566 +#: build/parsePreamble.c:590 #, c-format msgid "line %d: Epoch/Serial field must be a number: %s\n" msgstr "" -#: build/parsePreamble.c:606 build/parsePreamble.c:617 +#: build/parsePreamble.c:630 build/parsePreamble.c:641 #, c-format msgid "line %d: Bad %s: qualifiers: %s\n" msgstr "" -#: build/parsePreamble.c:643 +#: build/parsePreamble.c:667 #, c-format msgid "line %d: Bad BuildArchitecture format: %s\n" msgstr "" -#: build/parsePreamble.c:652 +#: build/parsePreamble.c:676 #, c-format msgid "Internal error: Bogus tag %d\n" msgstr "" -#: build/parsePreamble.c:802 +#: build/parsePreamble.c:828 #, c-format msgid "Bad package specification: %s\n" msgstr "" -#: build/parsePreamble.c:808 +#: build/parsePreamble.c:834 #, c-format msgid "Package already exists: %s\n" msgstr "" -#: build/parsePreamble.c:835 +#: build/parsePreamble.c:861 #, c-format msgid "line %d: Unknown tag: %s\n" msgstr "" -#: build/parsePreamble.c:857 +#: build/parsePreamble.c:883 msgid "Spec file can't use BuildRoot\n" msgstr "" -#: build/parsePrep.c:39 +#: build/parsePrep.c:40 #, c-format msgid "Bad source: %s: %s\n" msgstr "" -#: build/parsePrep.c:77 +#: build/parsePrep.c:79 #, c-format msgid "No patch number %d\n" msgstr "" -#: build/parsePrep.c:168 +#: build/parsePrep.c:171 #, c-format msgid "No source number %d\n" msgstr "" -#: build/parsePrep.c:188 +#: build/parsePrep.c:191 #, c-format msgid "Couldn't download nosource %s: %s\n" msgstr "" -#: build/parsePrep.c:283 +#: build/parsePrep.c:288 +#, c-format msgid "Error parsing %%setup: %s\n" msgstr "" -#: build/parsePrep.c:298 +#: build/parsePrep.c:303 +#, c-format msgid "line %d: Bad arg to %%setup: %s\n" msgstr "" -#: build/parsePrep.c:316 +#: build/parsePrep.c:321 +#, c-format msgid "line %d: Bad %%setup option %s: %s\n" msgstr "" -#: build/parsePrep.c:450 +#: build/parsePrep.c:458 +#, c-format msgid "line %d: Need arg to %%patch -b: %s\n" msgstr "" -#: build/parsePrep.c:459 +#: build/parsePrep.c:467 +#, c-format msgid "line %d: Need arg to %%patch -z: %s\n" msgstr "" -#: build/parsePrep.c:471 +#: build/parsePrep.c:479 +#, c-format msgid "line %d: Need arg to %%patch -p: %s\n" msgstr "" -#: build/parsePrep.c:478 +#: build/parsePrep.c:486 +#, c-format msgid "line %d: Bad arg to %%patch -p: %s\n" msgstr "" -#: build/parsePrep.c:485 +#: build/parsePrep.c:493 msgid "Too many patches!\n" msgstr "" -#: build/parsePrep.c:489 +#: build/parsePrep.c:497 +#, c-format msgid "line %d: Bad arg to %%patch: %s\n" msgstr "" -#: build/parsePrep.c:523 +#: build/parsePrep.c:531 +#, c-format msgid "line %d: second %%prep\n" msgstr "" @@ -2155,22 +1896,22 @@ msgstr "" msgid "line %d: Version required: %s\n" msgstr "" -#: build/parseScript.c:156 +#: build/parseScript.c:157 #, c-format msgid "line %d: triggers must have --: %s\n" msgstr "" -#: build/parseScript.c:166 build/parseScript.c:227 +#: build/parseScript.c:167 build/parseScript.c:228 #, c-format msgid "line %d: Error parsing %s: %s\n" msgstr "" -#: build/parseScript.c:177 +#: build/parseScript.c:178 #, c-format msgid "line %d: script program must begin with '/': %s\n" msgstr "" -#: build/parseScript.c:219 +#: build/parseScript.c:220 #, c-format msgid "line %d: Second %s\n" msgstr "" @@ -2187,6 +1928,7 @@ msgid "Unable to open %s: %s\n" msgstr "" #: build/parseSpec.c:200 +#, c-format msgid "Unclosed %%if\n" msgstr "" @@ -2196,299 +1938,194 @@ msgid "%s:%d: parseExpressionBoolean returns %d\n" msgstr "" #: build/parseSpec.c:281 +#, c-format msgid "%s:%d: Got a %%else with no %%if\n" msgstr "" #: build/parseSpec.c:293 +#, c-format msgid "%s:%d: Got a %%endif with no %%if\n" msgstr "" #: build/parseSpec.c:307 build/parseSpec.c:316 +#, c-format msgid "malformed %%include statement\n" msgstr "" -#: build/parseSpec.c:505 +#: build/parseSpec.c:508 msgid "No compatible architectures found for build\n" msgstr "" -#: build/parseSpec.c:559 +#: build/parseSpec.c:563 +#, c-format msgid "Package has no %%description: %s\n" msgstr "" -#: build/spec.c:225 +#: build/spec.c:228 #, c-format msgid "line %d: Bad number: %s\n" msgstr "" -#: build/spec.c:231 +#: build/spec.c:234 #, c-format msgid "line %d: Bad no%s number: %d\n" msgstr "" -#: build/spec.c:290 +#: build/spec.c:293 #, c-format msgid "line %d: Bad %s number: %s\n" msgstr "" -#: lib/cpio.c:185 +#: lib/cpio.c:187 #, c-format msgid "(error 0x%x)" msgstr "" -#: lib/cpio.c:188 +#: lib/cpio.c:190 msgid "Bad magic" msgstr "" -#: lib/cpio.c:189 +#: lib/cpio.c:191 msgid "Bad/unreadable header" msgstr "" -#: lib/cpio.c:210 +#: lib/cpio.c:212 msgid "Header size too big" msgstr "" -#: lib/cpio.c:211 +#: lib/cpio.c:213 msgid "Unknown file type" msgstr "" -#: lib/cpio.c:212 +#: lib/cpio.c:214 msgid "Missing hard link" msgstr "" -#: lib/cpio.c:213 +#: lib/cpio.c:215 msgid "MD5 sum mismatch" msgstr "" -#: lib/cpio.c:214 +#: lib/cpio.c:216 msgid "Internal error" msgstr "" -#: lib/cpio.c:223 +#: lib/cpio.c:225 msgid " failed - " msgstr "" -#: lib/db1.c:99 lib/db2.c:117 lib/db3.c:102 -#, c-format -msgid "db%d error(%d) from %s: %s\n" -msgstr "" - -#: lib/db1.c:102 lib/db2.c:120 lib/db3.c:105 -#, c-format -msgid "db%d error(%d): %s\n" -msgstr "" - -#: lib/db1.c:418 -#, c-format -msgid "closed db file %s\n" -msgstr "" - -#: lib/db1.c:421 -#, c-format -msgid "removed db file %s\n" -msgstr "" - -#: lib/db1.c:452 -#, c-format -msgid "bad db file %s\n" -msgstr "" - -#: lib/db1.c:457 -#, c-format -msgid "opening db file %s mode 0x%x\n" -msgstr "" - -#. XXX check errno validity -#: lib/db1.c:480 -#, c-format -msgid "cannot get %s lock on database\n" -msgstr "" - -#: lib/db1.c:481 lib/db2.c:787 lib/db3.c:798 -msgid "exclusive" -msgstr "" - -#: lib/db1.c:481 lib/db2.c:787 lib/db3.c:798 -msgid "shared" -msgstr "" - -#: lib/db2.c:145 lib/db3.c:131 -#, c-format -msgid "closed db environment %s/%s\n" -msgstr "" - -#: lib/db2.c:161 lib/db3.c:147 -#, c-format -msgid "removed db environment %s/%s\n" -msgstr "" - -#: lib/db2.c:198 lib/db3.c:186 -#, c-format -msgid "opening db environment %s/%s %s\n" -msgstr "" - -#: lib/db2.c:588 lib/db3.c:591 -#, c-format -msgid "closed db index %s/%s\n" -msgstr "" - -#: lib/db2.c:679 lib/db3.c:686 -#, c-format -msgid "opening db index %s/%s %s mode=0x%x\n" -msgstr "" - -#: lib/db2.c:785 lib/db3.c:796 -#, c-format -msgid "cannot get %s lock on %s/%s\n" -msgstr "" - -#: lib/db2.c:792 lib/db3.c:803 -#, c-format -msgid "locked db index %s/%s\n" -msgstr "" - -#: lib/dbconfig.c:260 -#, c-format -msgid "unrecognized db option: \"%s\" ignored\n" -msgstr "" - -#: lib/dbconfig.c:289 -#, c-format -msgid "%s has invalid numeric value, skipped\n" -msgstr "" - -#: lib/dbconfig.c:298 -#, c-format -msgid "%s has too large or too small long value, skipped\n" -msgstr "" - -#: lib/dbconfig.c:307 -#, c-format -msgid "%s has too large or too small integer value, skipped\n" -msgstr "" - -#. XXX legacy epoch-less requires/conflicts compatibility -#: lib/depends.c:565 +#. XXX legacy epoch-less requires/conflicts compatibility +#: lib/depends.c:564 #, c-format msgid "" "the \"B\" dependency needs an epoch (assuming same as \"A\")\n" "\tA %s\tB %s\n" msgstr "" -#: lib/depends.c:594 +#: lib/depends.c:593 #, c-format msgid " %s A %s\tB %s\n" msgstr "" -#: lib/depends.c:595 lib/depends.c:1075 lib/depends.c:1200 +#: lib/depends.c:594 lib/depends.c:1210 lib/depends.c:1343 msgid "YES" msgstr "" -#: lib/depends.c:595 lib/depends.c:1075 lib/depends.c:1200 +#: lib/depends.c:594 lib/depends.c:1210 lib/depends.c:1343 msgid "NO " msgstr "" -#: lib/depends.c:964 +#: lib/depends.c:1011 #, c-format msgid "%s: %-45s YES (added files)\n" msgstr "" -#: lib/depends.c:1022 +#: lib/depends.c:1117 #, c-format msgid "%s: %-45s YES (added provide)\n" msgstr "" -#: lib/depends.c:1074 +#: lib/depends.c:1209 #, c-format msgid "%s: %-45s %-s (cached)\n" msgstr "" -#: lib/depends.c:1095 +#: lib/depends.c:1238 #, c-format msgid "%s: %-45s YES (rpmrc provides)\n" msgstr "" -#: lib/depends.c:1112 +#: lib/depends.c:1255 #, c-format msgid "%s: %-45s YES (rpmlib provides)\n" msgstr "" -#: lib/depends.c:1134 +#: lib/depends.c:1279 #, c-format msgid "%s: %-45s YES (db files)\n" msgstr "" -#: lib/depends.c:1147 +#: lib/depends.c:1292 #, c-format msgid "%s: %-45s YES (db provides)\n" msgstr "" -#: lib/depends.c:1161 +#: lib/depends.c:1306 #, c-format msgid "%s: %-45s YES (db package)\n" msgstr "" -#: lib/depends.c:1179 +#: lib/depends.c:1322 #, c-format msgid "%s: %-45s NO\n" msgstr "" -#: lib/depends.c:1200 +#: lib/depends.c:1343 #, c-format msgid "%s: (%s, %s) added to Depends cache.\n" msgstr "" #. requirements are not satisfied. -#: lib/depends.c:1261 +#: lib/depends.c:1415 #, c-format msgid "package %s-%s-%s require not satisfied: %s\n" msgstr "" #. conflicts exist. -#: lib/depends.c:1329 +#: lib/depends.c:1494 #, c-format msgid "package %s conflicts: %s\n" msgstr "" -#: lib/depends.c:1549 +#: lib/depends.c:1737 #, c-format msgid "removing %s-%s-%s \"%s\" from tsort relations.\n" msgstr "" #. Record all relations. -#: lib/depends.c:1697 +#: lib/depends.c:1886 msgid "========== recording tsort relations\n" msgstr "" #. T4. Scan for zeroes. -#: lib/depends.c:1755 +#: lib/depends.c:1944 msgid "" "========== tsorting packages (order, #predecessors, #succesors, depth)\n" msgstr "" -#: lib/depends.c:1807 +#: lib/depends.c:1994 msgid "========== successors only (presentation order)\n" msgstr "" -#: lib/depends.c:1859 +#: lib/depends.c:2046 msgid "LOOP:\n" msgstr "" -#: lib/depends.c:1888 +#: lib/depends.c:2075 msgid "========== continuing tsort ...\n" msgstr "" -#: lib/falloc.c:144 -#, c-format -msgid "" -"free list corrupt (%u)- please run\n" -"\t\"rpm --rebuilddb\"\n" -"More information is available from http://www.rpm.org or the " -"rpm-list@redhat.com mailing list\n" -"if \"rpm --rebuilddb\" fails to correct the problem.\n" -msgstr "" - #: lib/formats.c:28 lib/formats.c:54 lib/formats.c:83 lib/formats.c:124 -#: lib/header.c:2667 lib/header.c:2684 lib/header.c:2702 +#: lib/header.c:2195 lib/header.c:2214 lib/header.c:2234 msgid "(not a number)" msgstr "" @@ -2502,7 +2139,7 @@ msgstr "" msgid "mntctl() failed to return mount points: %s\n" msgstr "" -#: lib/fs.c:105 lib/fs.c:187 lib/fs.c:290 +#: lib/fs.c:105 lib/fs.c:189 lib/fs.c:292 #, c-format msgid "failed to stat %s: %s\n" msgstr "" @@ -2516,481 +2153,620 @@ msgstr "" msgid "failed to open %s: %s\n" msgstr "" -#: lib/fs.c:312 +#: lib/fs.c:315 #, c-format msgid "file %s is on an unknown device\n" msgstr "" -#: lib/fsm.c:280 +#: lib/fsm.c:292 msgid "========= Directories not explictly included in package:\n" msgstr "" -#: lib/fsm.c:282 +#: lib/fsm.c:294 #, c-format msgid "%9d %s\n" msgstr "" -#: lib/fsm.c:1089 +#: lib/fsm.c:1115 #, c-format msgid "%s directory created with perms %04o.\n" msgstr "" -#: lib/fsm.c:1398 lib/fsm.c:1523 +#: lib/fsm.c:1433 lib/fsm.c:1558 #, c-format msgid "%s saved as %s\n" msgstr "" -#: lib/fsm.c:1549 +#: lib/fsm.c:1584 #, c-format msgid "%s rmdir of %s failed: Directory not empty\n" msgstr "" -#: lib/fsm.c:1555 +#: lib/fsm.c:1590 #, c-format msgid "%s rmdir of %s failed: %s\n" msgstr "" -#: lib/fsm.c:1565 +#: lib/fsm.c:1600 #, c-format msgid "%s unlink of %s failed: %s\n" msgstr "" -#: lib/fsm.c:1584 +#: lib/fsm.c:1619 #, c-format msgid "%s created as %s\n" msgstr "" #. This should not be allowed -#: lib/header.c:173 +#: lib/header.c:212 msgid "dataLength() RPM_STRING_TYPE count must be 1.\n" msgstr "" -#: lib/header.c:208 lib/header.c:1120 lib/psm.c:372 +#: lib/header.c:247 lib/header_internal.c:139 lib/psm.c:390 #, c-format msgid "Data type %d not supported\n" msgstr "" -#: lib/header.c:1555 -#, c-format -msgid "Bad count for headerAddEntry(): %d\n" -msgstr "" - -#. @-observertrans@ -#: lib/header.c:2014 +#. @-observertrans -readonlytrans@ +#: lib/header.c:1511 #, c-format msgid "missing { after %" msgstr "" -#. @-observertrans@ -#: lib/header.c:2044 +#. @-observertrans -readonlytrans@ +#: lib/header.c:1541 msgid "missing } after %{" msgstr "" -#. @-observertrans@ -#: lib/header.c:2058 +#. @-observertrans -readonlytrans@ +#: lib/header.c:1555 msgid "empty tag format" msgstr "" -#. @-observertrans@ -#: lib/header.c:2070 +#. @-observertrans -readonlytrans@ +#: lib/header.c:1569 msgid "empty tag name" msgstr "" -#. @-observertrans@ -#: lib/header.c:2087 +#. @-observertrans -readonlytrans@ +#: lib/header.c:1586 msgid "unknown tag" msgstr "" -#. @-observertrans@ -#: lib/header.c:2114 +#. @-observertrans -readonlytrans@ +#: lib/header.c:1613 msgid "] expected at end of array" msgstr "" -#. @-observertrans@ -#: lib/header.c:2132 +#. @-observertrans -readonlytrans@ +#: lib/header.c:1631 msgid "unexpected ]" msgstr "" -#. @-observertrans@ -#: lib/header.c:2136 +#. @-observertrans -readonlytrans@ +#: lib/header.c:1635 msgid "unexpected }" msgstr "" -#. @-observertrans@ -#: lib/header.c:2199 +#. @-observertrans -readonlytrans@ +#: lib/header.c:1701 msgid "? expected in expression" msgstr "" -#. @-observertrans@ -#: lib/header.c:2208 +#. @-observertrans -readonlytrans@ +#: lib/header.c:1710 msgid "{ expected after ? in expression" msgstr "" -#. @-observertrans@ -#: lib/header.c:2221 lib/header.c:2263 +#. @-observertrans -readonlytrans@ +#: lib/header.c:1723 lib/header.c:1765 msgid "} expected in expression" msgstr "" -#. @-observertrans@ -#: lib/header.c:2231 +#. @-observertrans -readonlytrans@ +#: lib/header.c:1733 msgid ": expected following ? subexpression" msgstr "" -#. @-observertrans@ -#: lib/header.c:2248 +#. @-observertrans -readonlytrans@ +#: lib/header.c:1750 msgid "{ expected after : in expression" msgstr "" -#. @-observertrans@ -#: lib/header.c:2273 +#. @-observertrans -readonlytrans@ +#: lib/header.c:1775 msgid "| expected at end of expression" msgstr "" -#: lib/header.c:2444 +#: lib/header.c:1955 msgid "(unknown type)" msgstr "" -#: lib/misc.c:330 lib/misc.c:335 lib/misc.c:341 +#: lib/misc.c:229 lib/misc.c:234 lib/misc.c:240 #, c-format msgid "error creating temporary file %s\n" msgstr "" -#: lib/package.c:124 +#: lib/package.c:131 msgid "packaging version 1 is not supported by this version of RPM\n" msgstr "" -#: lib/package.c:186 +#: lib/package.c:195 msgid "" "only packaging with major numbers <= 4 is supported by this version of RPM\n" msgstr "" -#: lib/poptBT.c:98 +#: lib/poptBT.c:100 #, c-format msgid "buildroot already specified, ignoring %s\n" msgstr "" -#: lib/poptBT.c:124 +#: lib/poptBT.c:126 #, c-format msgid "build through %prep (unpack sources and apply patches) from " msgstr "" -#: lib/poptBT.c:125 lib/poptBT.c:128 lib/poptBT.c:131 lib/poptBT.c:134 -#: lib/poptBT.c:137 lib/poptBT.c:140 lib/poptBT.c:143 +#: lib/poptBT.c:127 lib/poptBT.c:130 lib/poptBT.c:133 lib/poptBT.c:136 +#: lib/poptBT.c:139 lib/poptBT.c:142 lib/poptBT.c:145 msgid "" msgstr "" -#: lib/poptBT.c:127 +#: lib/poptBT.c:129 msgid "build through %build (%prep, then compile) from " msgstr "" -#: lib/poptBT.c:130 +#: lib/poptBT.c:132 msgid "build through %install (%prep, %build, then install) from " msgstr "" -#: lib/poptBT.c:133 +#: lib/poptBT.c:135 #, c-format msgid "verify %files section from " msgstr "" -#: lib/poptBT.c:136 +#: lib/poptBT.c:138 msgid "build source and binary packages from " msgstr "" -#: lib/poptBT.c:139 +#: lib/poptBT.c:141 msgid "build binary package only from " msgstr "" -#: lib/poptBT.c:142 +#: lib/poptBT.c:144 msgid "build source package only from " msgstr "" -#: lib/poptBT.c:146 +#: lib/poptBT.c:148 #, c-format msgid "build through %prep (unpack sources and apply patches) from " msgstr "" -#: lib/poptBT.c:147 lib/poptBT.c:150 lib/poptBT.c:153 lib/poptBT.c:156 -#: lib/poptBT.c:159 lib/poptBT.c:162 lib/poptBT.c:165 +#: lib/poptBT.c:149 lib/poptBT.c:152 lib/poptBT.c:155 lib/poptBT.c:158 +#: lib/poptBT.c:161 lib/poptBT.c:164 lib/poptBT.c:167 msgid "" msgstr "" -#: lib/poptBT.c:149 +#: lib/poptBT.c:151 msgid "build through %build (%prep, then compile) from " msgstr "" -#: lib/poptBT.c:152 +#: lib/poptBT.c:154 msgid "build through %install (%prep, %build, then install) from " msgstr "" -#: lib/poptBT.c:155 +#: lib/poptBT.c:157 #, c-format msgid "verify %files section from " msgstr "" -#: lib/poptBT.c:158 +#: lib/poptBT.c:160 msgid "build source and binary packages from " msgstr "" -#: lib/poptBT.c:161 +#: lib/poptBT.c:163 msgid "build binary package only from " msgstr "" -#: lib/poptBT.c:164 +#: lib/poptBT.c:166 msgid "build source package only from " msgstr "" -#: lib/poptBT.c:168 +#: lib/poptBT.c:170 msgid "build binary package from " msgstr "" -#: lib/poptBT.c:169 lib/poptBT.c:172 +#: lib/poptBT.c:171 lib/poptBT.c:174 msgid "" msgstr "" -#: lib/poptBT.c:171 +#: lib/poptBT.c:173 msgid "" "build through %install (%prep, %build, then install) from " msgstr "" -#: lib/poptBT.c:175 +#: lib/poptBT.c:177 msgid "override build root" msgstr "" -#: lib/poptBT.c:181 -msgid "ignore ExcludeArch: directives from spec file" +#: lib/poptBT.c:181 rpmdb/poptDB.c:32 +msgid "generate headers compatible with rpm4 packaging" msgstr "" #: lib/poptBT.c:183 -msgid "debug file state machine" +msgid "ignore ExcludeArch: directives from spec file" msgstr "" #: lib/poptBT.c:185 +msgid "debug file state machine" +msgstr "" + +#: lib/poptBT.c:187 msgid "do not execute any stages of the build" msgstr "" -#: lib/poptBT.c:189 +#: lib/poptBT.c:191 msgid "generate package header(s) compatible with (legacy) rpm[23] packaging" msgstr "" -#: lib/poptBT.c:192 +#: lib/poptBT.c:194 msgid "do not accept i18N msgstr's from specfile" msgstr "" -#: lib/poptBT.c:196 +#: lib/poptBT.c:198 msgid "remove specfile when done" msgstr "" -#: lib/poptBT.c:202 +#: lib/poptBT.c:204 msgid "override target platform" msgstr "" -#: lib/poptBT.c:204 +#: lib/poptBT.c:206 msgid "lookup i18N strings in specfile catalog" msgstr "" -#: lib/poptQV.c:70 -msgid "query/verify package(s) owning file" +#: lib/poptI.c:86 lib/poptI.c:136 +msgid "do not execute package scriptlet(s)" +msgstr "" + +#: lib/poptI.c:93 +msgid "save erased package files by renaming into sub-directory" +msgstr "" + +#: lib/poptI.c:95 +msgid "+" +msgstr "" + +#: lib/poptI.c:100 +msgid "skip files with leading component " +msgstr "" + +#: lib/poptI.c:101 +msgid "" +msgstr "" + +#: lib/poptI.c:107 +msgid "upgrade package(s) if already installed" +msgstr "" + +#: lib/poptI.c:108 lib/poptI.c:124 lib/poptI.c:193 +msgid "+" +msgstr "" + +#: lib/poptI.c:139 +#, c-format +msgid "do not execute %%pre scriptlet (if any)" +msgstr "" + +#: lib/poptI.c:142 +#, c-format +msgid "do not execute %%post scriptlet (if any)" +msgstr "" + +#: lib/poptI.c:145 +#, c-format +msgid "do not execute %%preun scriptlet (if any)" +msgstr "" + +#: lib/poptI.c:148 +#, c-format +msgid "do not execute %%postun scriptlet (if any)" +msgstr "" + +#: lib/poptI.c:152 +msgid "do not execute any scriptlet(s) triggered by this package" +msgstr "" + +#: lib/poptI.c:155 +#, c-format +msgid "do not execute any %%triggerprein scriptlet(s)" +msgstr "" + +#: lib/poptI.c:158 +#, c-format +msgid "do not execute any %%triggerin scriptlet(s)" +msgstr "" + +#: lib/poptI.c:161 +#, c-format +msgid "do not execute any %%triggerun scriptlet(s)" +msgstr "" + +#: lib/poptI.c:164 +#, c-format +msgid "do not execute any %%triggerpostun scriptlet(s)" +msgstr "" + +#: lib/poptI.c:177 +msgid "relocate files from path to " +msgstr "" + +#: lib/poptI.c:178 +msgid "=" +msgstr "" + +#: lib/poptI.c:181 +msgid "save erased package files by repackaging" +msgstr "" + +#: lib/poptI.c:192 +msgid "upgrade package(s)" +msgstr "" + +#: lib/poptK.c:56 +msgid "generate GPG/PGP signature" msgstr "" #: lib/poptQV.c:72 -msgid "query/verify package(s) in group" +msgid "query/verify all packages" msgstr "" #: lib/poptQV.c:74 -msgid "query/verify a package file (i.e. a binary *.rpm file)" +msgid "query/verify package(s) owning file" msgstr "" #: lib/poptQV.c:76 -msgid "rpm query mode" +msgid "query/verify package(s) in group" +msgstr "" + +#: lib/poptQV.c:78 +msgid "query/verify a package file (i.e. a binary *.rpm file)" msgstr "" #: lib/poptQV.c:80 +msgid "rpm query mode" +msgstr "" + +#: lib/poptQV.c:84 msgid "display known query tags" msgstr "" -#: lib/poptQV.c:82 +#: lib/poptQV.c:86 msgid "query a spec file" msgstr "" -#: lib/poptQV.c:82 +#: lib/poptQV.c:86 msgid "" msgstr "" -#: lib/poptQV.c:84 +#: lib/poptQV.c:88 msgid "query the package(s) triggered by the package" msgstr "" -#: lib/poptQV.c:86 +#: lib/poptQV.c:90 msgid "rpm verify mode" msgstr "" -#: lib/poptQV.c:88 +#: lib/poptQV.c:92 msgid "rpm verify mode (legacy)" msgstr "" -#: lib/poptQV.c:90 +#: lib/poptQV.c:94 msgid "query/verify the package(s) which require a dependency" msgstr "" -#: lib/poptQV.c:92 +#: lib/poptQV.c:96 msgid "query/verify the package(s) which provide a dependency" msgstr "" -#: lib/poptQV.c:134 +#: lib/poptQV.c:146 msgid "list all configuration files" msgstr "" -#: lib/poptQV.c:136 +#: lib/poptQV.c:148 msgid "list all documentation files" msgstr "" -#: lib/poptQV.c:138 +#: lib/poptQV.c:150 msgid "dump basic file information" msgstr "" -#: lib/poptQV.c:140 +#: lib/poptQV.c:152 msgid "list files in package" msgstr "" -#: lib/poptQV.c:144 +#: lib/poptQV.c:156 msgid "use the following query format" msgstr "" -#: lib/poptQV.c:146 +#: lib/poptQV.c:158 msgid "substitute i18n sections into spec file" msgstr "" -#: lib/poptQV.c:148 +#: lib/poptQV.c:160 msgid "display the states of the listed files" msgstr "" -#: lib/poptQV.c:150 +#: lib/poptQV.c:162 msgid "display a verbose file listing" msgstr "" -#: lib/problems.c:81 +#: lib/poptQV.c:178 +msgid "don't verify MD5 digest of files" +msgstr "" + +#: lib/poptQV.c:181 +msgid "don't verify size of files" +msgstr "" + +#: lib/poptQV.c:184 +msgid "don't verify symlink path of files" +msgstr "" + +#: lib/poptQV.c:187 +msgid "don't verify owner of files" +msgstr "" + +#: lib/poptQV.c:190 +msgid "don't verify group of files" +msgstr "" + +#: lib/poptQV.c:193 +msgid "don't verify modification time of files" +msgstr "" + +#: lib/poptQV.c:196 lib/poptQV.c:199 +msgid "don't verify mode of files" +msgstr "" + +#: lib/poptQV.c:202 +msgid "don't verify files in package" +msgstr "" + +#: lib/poptQV.c:204 +msgid "don't verify package dependencies" +msgstr "" + +#: lib/poptQV.c:206 lib/poptQV.c:209 +msgid "don't execute %verifyscript (if any)" +msgstr "" + +#: lib/poptQV.c:212 +msgid "don't verify header SHA1 digest" +msgstr "" + +#: lib/problems.c:83 #, c-format msgid " is needed by %s-%s-%s\n" msgstr "" -#: lib/problems.c:84 +#: lib/problems.c:86 #, c-format msgid " conflicts with %s-%s-%s\n" msgstr "" -#: lib/problems.c:119 +#: lib/problems.c:123 #, c-format msgid "package %s is for a different architecture" msgstr "" -#: lib/problems.c:124 +#: lib/problems.c:128 #, c-format msgid "package %s is for a different operating system" msgstr "" -#: lib/problems.c:129 +#: lib/problems.c:133 #, c-format msgid "package %s is already installed" msgstr "" -#: lib/problems.c:134 +#: lib/problems.c:138 #, c-format msgid "path %s in package %s is not relocateable" msgstr "" -#: lib/problems.c:139 +#: lib/problems.c:143 #, c-format msgid "file %s conflicts between attempted installs of %s and %s" msgstr "" -#: lib/problems.c:144 +#: lib/problems.c:148 #, c-format msgid "file %s from install of %s conflicts with file from package %s" msgstr "" -#: lib/problems.c:149 +#: lib/problems.c:153 #, c-format msgid "package %s (which is newer than %s) is already installed" msgstr "" -#: lib/problems.c:154 +#: lib/problems.c:158 #, c-format msgid "installing package %s needs %ld%cb on the %s filesystem" msgstr "" -#: lib/problems.c:164 +#: lib/problems.c:168 #, c-format msgid "installing package %s needs %ld inodes on the %s filesystem" msgstr "" -#: lib/problems.c:169 +#: lib/problems.c:173 #, c-format msgid "package %s pre-transaction syscall(s): %s failed: %s" msgstr "" -#: lib/problems.c:176 +#: lib/problems.c:180 #, c-format msgid "unknown error %d encountered while manipulating package %s" msgstr "" -#: lib/psm.c:559 +#: lib/psm.c:584 #, c-format -msgid "cannot create %s %s\n" +msgid "cannot create %%%s %s\n" msgstr "" -#: lib/psm.c:565 +#: lib/psm.c:590 #, c-format -msgid "cannot write to %s\n" +msgid "cannot write to %%%s %s\n" msgstr "" -#: lib/psm.c:602 +#: lib/psm.c:628 msgid "source package expected, binary found\n" msgstr "" -#: lib/psm.c:710 +#: lib/psm.c:735 msgid "source package contains no .spec file\n" msgstr "" -#: lib/psm.c:960 +#: lib/psm.c:990 #, c-format msgid "execution of %s scriptlet from %s-%s-%s failed, waitpid returned %s\n" msgstr "" -#: lib/psm.c:967 +#: lib/psm.c:997 #, c-format msgid "execution of %s scriptlet from %s-%s-%s failed, exit status %d\n" msgstr "" -#: lib/psm.c:1275 +#: lib/psm.c:1315 #, c-format msgid "%s: %s-%s-%s has %d files, test = %d\n" msgstr "" -#: lib/psm.c:1389 +#: lib/psm.c:1432 #, c-format msgid "%s: %s scriptlet failed (%d), skipping %s-%s-%s\n" msgstr "" -#: lib/psm.c:1497 +#: lib/psm.c:1540 #, c-format msgid "user %s does not exist - using root\n" msgstr "" -#: lib/psm.c:1506 +#: lib/psm.c:1549 #, c-format msgid "group %s does not exist - using root\n" msgstr "" -#: lib/psm.c:1545 +#: lib/psm.c:1588 #, c-format msgid "unpacking of archive failed%s%s: %s\n" msgstr "" -#: lib/psm.c:1546 +#: lib/psm.c:1589 msgid " on file " msgstr "" -#: lib/psm.c:1811 +#: lib/psm.c:1849 #, c-format msgid "%s: running %s script(s) (if any)\n" msgstr "" @@ -3004,168 +2780,168 @@ msgstr "" msgid "(contains no files)" msgstr "" -#: lib/query.c:251 +#: lib/query.c:257 msgid "normal " msgstr "" -#: lib/query.c:253 +#: lib/query.c:259 msgid "replaced " msgstr "" -#: lib/query.c:255 +#: lib/query.c:261 msgid "not installed " msgstr "" -#: lib/query.c:257 +#: lib/query.c:263 msgid "net shared " msgstr "" -#: lib/query.c:259 +#: lib/query.c:265 #, c-format msgid "(unknown %3d) " msgstr "" -#: lib/query.c:264 +#: lib/query.c:270 msgid "(no state) " msgstr "" -#: lib/query.c:283 lib/query.c:328 +#: lib/query.c:289 lib/query.c:334 msgid "package has neither file owner or id lists\n" msgstr "" -#: lib/query.c:387 +#: lib/query.c:393 #, c-format msgid "can't query %s: %s\n" msgstr "" -#: lib/query.c:513 lib/query.c:545 lib/rpminstall.c:321 lib/rpminstall.c:452 +#: lib/query.c:524 lib/query.c:558 lib/rpminstall.c:323 lib/rpminstall.c:456 #, c-format msgid "open of %s failed: %s\n" msgstr "" -#: lib/query.c:524 +#: lib/query.c:537 #, c-format msgid "query of %s failed\n" msgstr "" -#: lib/query.c:530 +#: lib/query.c:543 msgid "old format source packages cannot be queried\n" msgstr "" -#: lib/query.c:555 lib/rpminstall.c:462 +#: lib/query.c:568 lib/rpminstall.c:466 #, c-format msgid "%s: read manifest failed: %s\n" msgstr "" -#: lib/query.c:598 +#: lib/query.c:610 #, c-format msgid "query of specfile %s failed, can't parse\n" msgstr "" -#: lib/query.c:620 +#: lib/query.c:632 msgid "no packages\n" msgstr "" -#: lib/query.c:631 +#: lib/query.c:651 #, c-format msgid "group %s does not contain any packages\n" msgstr "" -#: lib/query.c:641 +#: lib/query.c:661 #, c-format msgid "no package triggers %s\n" msgstr "" -#: lib/query.c:651 +#: lib/query.c:671 #, c-format msgid "no package requires %s\n" msgstr "" -#: lib/query.c:662 +#: lib/query.c:682 #, c-format msgid "no package provides %s\n" msgstr "" -#: lib/query.c:696 +#: lib/query.c:717 #, c-format msgid "file %s: %s\n" msgstr "" -#: lib/query.c:700 +#: lib/query.c:721 #, c-format msgid "file %s is not owned by any package\n" msgstr "" -#: lib/query.c:726 +#: lib/query.c:747 #, c-format msgid "invalid package number: %s\n" msgstr "" -#: lib/query.c:729 +#: lib/query.c:750 #, c-format msgid "package record number: %u\n" msgstr "" -#: lib/query.c:734 +#: lib/query.c:755 #, c-format msgid "record %u could not be read\n" msgstr "" -#: lib/query.c:745 lib/rpminstall.c:599 +#: lib/query.c:766 lib/rpminstall.c:603 #, c-format msgid "package %s is not installed\n" msgstr "" -#: lib/rpmchecksig.c:39 +#: lib/rpmchecksig.c:40 #, c-format msgid "%s: open failed: %s\n" msgstr "" -#: lib/rpmchecksig.c:51 +#: lib/rpmchecksig.c:52 msgid "makeTempFile failed\n" msgstr "" -#: lib/rpmchecksig.c:84 +#: lib/rpmchecksig.c:86 #, c-format msgid "%s: Fwrite failed: %s\n" msgstr "" -#: lib/rpmchecksig.c:90 +#: lib/rpmchecksig.c:92 #, c-format msgid "%s: Fread failed: %s\n" msgstr "" -#: lib/rpmchecksig.c:127 lib/rpmchecksig.c:262 +#: lib/rpmchecksig.c:129 lib/rpmchecksig.c:262 #, c-format msgid "%s: readLead failed\n" msgstr "" -#: lib/rpmchecksig.c:132 +#: lib/rpmchecksig.c:134 #, c-format msgid "%s: Can't sign v1.0 RPM\n" msgstr "" -#: lib/rpmchecksig.c:136 +#: lib/rpmchecksig.c:138 #, c-format msgid "%s: Can't re-sign v2.0 RPM\n" msgstr "" -#: lib/rpmchecksig.c:145 lib/rpmchecksig.c:278 +#: lib/rpmchecksig.c:147 lib/rpmchecksig.c:278 #, c-format msgid "%s: rpmReadSignature failed\n" msgstr "" -#: lib/rpmchecksig.c:149 lib/rpmchecksig.c:283 +#: lib/rpmchecksig.c:151 lib/rpmchecksig.c:283 #, c-format msgid "%s: No signature available\n" msgstr "" -#: lib/rpmchecksig.c:182 +#: lib/rpmchecksig.c:184 #, c-format msgid "%s: writeLead failed: %s\n" msgstr "" -#: lib/rpmchecksig.c:188 +#: lib/rpmchecksig.c:190 #, c-format msgid "%s: rpmWriteSignature failed: %s\n" msgstr "" @@ -3199,689 +2975,843 @@ msgstr "" msgid "OK" msgstr "" -#: lib/rpmdb.c:102 -#, c-format -msgid "dbiTagsInit: unrecognized tag name: \"%s\" ignored\n" +#: lib/rpminstall.c:161 +msgid "Preparing..." msgstr "" -#: lib/rpmdb.c:280 -#, c-format -msgid "cannot open %s index using db%d - %s (%d)\n" +#: lib/rpminstall.c:163 +msgid "Preparing packages for installation..." msgstr "" -#: lib/rpmdb.c:300 +#: lib/rpminstall.c:274 #, c-format -msgid "cannot open %s index\n" +msgid "Retrieving %s\n" msgstr "" -#: lib/rpmdb.c:386 +#. XXX undefined %{name}/%{version}/%{release} here +#. XXX %{_tmpdir} does not exist +#: lib/rpminstall.c:284 #, c-format -msgid "error(%d) getting \"%s\" records from %s index\n" +msgid " ... as %s\n" msgstr "" -#: lib/rpmdb.c:511 +#: lib/rpminstall.c:288 #, c-format -msgid "error(%d) storing record %s into %s\n" +msgid "skipping %s - transfer failed - %s\n" msgstr "" -#: lib/rpmdb.c:521 +#: lib/rpminstall.c:362 #, c-format -msgid "error(%d) removing record %s from %s\n" -msgstr "" - -#: lib/rpmdb.c:753 -msgid "no dbpath has been set\n" -msgstr "" - -#: lib/rpmdb.c:854 -msgid "" -"old format database is present; use --rebuilddb to generate a new format " -"database\n" +msgid "cannot open Packages database in %s\n" msgstr "" -#. error -#: lib/rpmdb.c:1044 +#: lib/rpminstall.c:384 #, c-format -msgid "error(%d) counting packages\n" +msgid "package %s is not relocateable\n" msgstr "" -#: lib/rpmdb.c:1100 lib/rpmdb.c:1662 +#: lib/rpminstall.c:430 #, c-format -msgid "%s: cannot read header at 0x%x\n" +msgid "error reading from file %s\n" msgstr "" -#: lib/rpmdb.c:1365 lib/rpmdb.c:2505 +#: lib/rpminstall.c:436 #, c-format -msgid "record number %u in database is bad -- skipping.\n" +msgid "file %s requires a newer version of RPM\n" msgstr "" -#: lib/rpmdb.c:1729 +#: lib/rpminstall.c:448 lib/rpminstall.c:674 #, c-format -msgid "removing \"%s\" from %s index.\n" +msgid "%s cannot be installed\n" msgstr "" -#: lib/rpmdb.c:1738 +#: lib/rpminstall.c:480 #, c-format -msgid "removing %d entries from %s index.\n" +msgid "found %d source and %d binary packages\n" msgstr "" -#: lib/rpmdb.c:1928 +#: lib/rpminstall.c:495 +msgid "failed dependencies:\n" +msgstr "" + +#: lib/rpminstall.c:516 +msgid "installing binary packages\n" +msgstr "" + +#: lib/rpminstall.c:534 #, c-format -msgid "error(%d) allocating new package instance\n" +msgid "cannot open file %s: %s\n" msgstr "" -#: lib/rpmdb.c:2006 +#: lib/rpminstall.c:590 #, c-format -msgid "adding \"%s\" to %s index.\n" +msgid "cannot open %s/packages.rpm\n" msgstr "" -#: lib/rpmdb.c:2017 +#: lib/rpminstall.c:606 #, c-format -msgid "adding %d entries to %s index.\n" +msgid "\"%s\" specifies multiple packages\n" +msgstr "" + +#: lib/rpminstall.c:629 +msgid "removing these packages would break dependencies:\n" msgstr "" -#: lib/rpmdb.c:2399 +#: lib/rpminstall.c:658 #, c-format -msgid "removing %s after successful db3 rebuild.\n" +msgid "cannot open %s: %s\n" msgstr "" -#: lib/rpmdb.c:2427 -msgid "no dbpath has been set" +#: lib/rpminstall.c:664 +#, c-format +msgid "Installing %s\n" msgstr "" -#: lib/rpmdb.c:2452 +#: lib/rpmlead.c:49 #, c-format -msgid "rebuilding database %s into %s\n" +msgid "read failed: %s (%d)\n" msgstr "" -#: lib/rpmdb.c:2456 +#: lib/rpmrc.c:165 #, c-format -msgid "temporary database %s already exists\n" +msgid "missing second ':' at %s:%d\n" msgstr "" -#: lib/rpmdb.c:2462 +#: lib/rpmrc.c:168 #, c-format -msgid "creating directory %s\n" +msgid "missing architecture name at %s:%d\n" msgstr "" -#: lib/rpmdb.c:2464 +#: lib/rpmrc.c:325 #, c-format -msgid "creating directory %s: %s\n" +msgid "Incomplete data line at %s:%d\n" msgstr "" -#: lib/rpmdb.c:2471 +#: lib/rpmrc.c:330 #, c-format -msgid "opening old database with dbapi %d\n" +msgid "Too many args in data line at %s:%d\n" msgstr "" -#: lib/rpmdb.c:2482 +#: lib/rpmrc.c:338 #, c-format -msgid "opening new database with dbapi %d\n" +msgid "Bad arch/os number: %s (%s:%d)\n" msgstr "" -#: lib/rpmdb.c:2544 +#: lib/rpmrc.c:378 #, c-format -msgid "cannot add record originally at %u\n" +msgid "Incomplete default line at %s:%d\n" msgstr "" -#: lib/rpmdb.c:2562 -msgid "failed to rebuild database: original database remains in place\n" +#: lib/rpmrc.c:383 +#, c-format +msgid "Too many args in default line at %s:%d\n" msgstr "" -#: lib/rpmdb.c:2570 -msgid "failed to replace old database with new database!\n" +#: lib/rpmrc.c:585 +#, c-format +msgid "Cannot expand %s\n" msgstr "" -#: lib/rpmdb.c:2572 +#: lib/rpmrc.c:590 #, c-format -msgid "replace files in %s with files from %s to recover" +msgid "Cannot read %s, HOME is too large.\n" msgstr "" -#: lib/rpmdb.c:2582 +#: lib/rpmrc.c:607 #, c-format -msgid "removing directory %s\n" +msgid "Unable to open %s for reading: %s.\n" msgstr "" -#: lib/rpmdb.c:2584 +#. XXX Feof(fd) +#: lib/rpmrc.c:654 #, c-format -msgid "failed to remove directory %s: %s\n" +msgid "Failed to read %s: %s.\n" msgstr "" -#: lib/rpminstall.c:159 -msgid "Preparing..." +#: lib/rpmrc.c:691 +#, c-format +msgid "missing ':' (found 0x%02x) at %s:%d\n" msgstr "" -#: lib/rpminstall.c:161 -msgid "Preparing packages for installation..." +#: lib/rpmrc.c:708 lib/rpmrc.c:782 +#, c-format +msgid "missing argument for %s at %s:%d\n" msgstr "" -#: lib/rpminstall.c:272 +#: lib/rpmrc.c:725 lib/rpmrc.c:747 #, c-format -msgid "Retrieving %s\n" +msgid "%s expansion failed at %s:%d \"%s\"\n" msgstr "" -#. XXX undefined %{name}/%{version}/%{release} here -#. XXX %{_tmpdir} does not exist -#: lib/rpminstall.c:282 +#: lib/rpmrc.c:734 #, c-format -msgid " ... as %s\n" +msgid "cannot open %s at %s:%d: %s\n" msgstr "" -#: lib/rpminstall.c:286 +#: lib/rpmrc.c:774 #, c-format -msgid "skipping %s - transfer failed - %s\n" +msgid "missing architecture for %s at %s:%d\n" msgstr "" -#: lib/rpminstall.c:358 +#: lib/rpmrc.c:841 #, c-format -msgid "cannot open Packages database in %s\n" +msgid "bad option '%s' at %s:%d\n" msgstr "" -#: lib/rpminstall.c:380 +#: lib/rpmrc.c:1421 #, c-format -msgid "package %s is not relocateable\n" +msgid "Unknown system: %s\n" msgstr "" -#: lib/rpminstall.c:426 +#: lib/rpmrc.c:1422 +msgid "Please contact rpm-list@redhat.com\n" +msgstr "" + +#: lib/signature.c:127 +msgid "file is not regular -- skipping size check\n" +msgstr "" + +#: lib/signature.c:135 #, c-format -msgid "error reading from file %s\n" +msgid "Expected size: %12d = lead(%d)+sigs(%d)+pad(%d)+data(%d)\n" msgstr "" -#: lib/rpminstall.c:432 +#: lib/signature.c:139 #, c-format -msgid "file %s requires a newer version of RPM\n" +msgid " Actual size: %12d\n" +msgstr "" + +#: lib/signature.c:158 +msgid "No signature\n" msgstr "" -#: lib/rpminstall.c:444 lib/rpminstall.c:670 +#: lib/signature.c:162 +msgid "Old PGP signature\n" +msgstr "" + +#: lib/signature.c:173 +msgid "Old (internal-only) signature! How did you get that!?\n" +msgstr "" + +#: lib/signature.c:229 #, c-format -msgid "%s cannot be installed\n" +msgid "Signature: size(%d)+pad(%d)\n" msgstr "" -#: lib/rpminstall.c:476 +#: lib/signature.c:289 #, c-format -msgid "found %d source and %d binary packages\n" +msgid "Couldn't exec pgp (%s)\n" msgstr "" -#: lib/rpminstall.c:491 -msgid "failed dependencies:\n" +#: lib/signature.c:302 +msgid "pgp failed\n" msgstr "" -#: lib/rpminstall.c:512 -msgid "installing binary packages\n" +#. PGP failed to write signature +#. Just in case +#: lib/signature.c:309 +msgid "pgp failed to write signature\n" msgstr "" -#: lib/rpminstall.c:530 +#: lib/signature.c:314 #, c-format -msgid "cannot open file %s: %s\n" +msgid "PGP sig size: %d\n" +msgstr "" + +#: lib/signature.c:327 lib/signature.c:409 +msgid "unable to read the signature\n" msgstr "" -#: lib/rpminstall.c:586 +#: lib/signature.c:332 #, c-format -msgid "cannot open %s/packages.rpm\n" +msgid "Got %d bytes of PGP sig\n" +msgstr "" + +#: lib/signature.c:371 lib/signature.c:758 +msgid "Couldn't exec gpg\n" +msgstr "" + +#: lib/signature.c:384 +msgid "gpg failed\n" msgstr "" -#: lib/rpminstall.c:602 +#. GPG failed to write signature +#. Just in case +#: lib/signature.c:391 +msgid "gpg failed to write signature\n" +msgstr "" + +#: lib/signature.c:396 #, c-format -msgid "\"%s\" specifies multiple packages\n" +msgid "GPG sig size: %d\n" msgstr "" -#: lib/rpminstall.c:625 -msgid "removing these packages would break dependencies:\n" +#: lib/signature.c:414 +#, c-format +msgid "Got %d bytes of GPG sig\n" +msgstr "" + +#: lib/signature.c:442 +msgid "Generating signature using PGP.\n" +msgstr "" + +#: lib/signature.c:448 +msgid "Generating signature using GPG.\n" +msgstr "" + +#: lib/signature.c:530 lib/signature.c:605 +msgid "Could not run pgp. Use --nopgp to skip PGP checks.\n" +msgstr "" + +#: lib/signature.c:695 +msgid "Could not run gpg. Use --nogpg to skip GPG checks.\n" msgstr "" -#: lib/rpminstall.c:654 +#: lib/signature.c:787 +msgid "Couldn't exec pgp\n" +msgstr "" + +#. @notreached@ +#. This case should have been screened out long ago. +#: lib/signature.c:791 lib/signature.c:844 #, c-format -msgid "cannot open %s: %s\n" +msgid "Invalid %%_signature spec in macro file\n" msgstr "" -#: lib/rpminstall.c:660 +#: lib/signature.c:824 #, c-format -msgid "Installing %s\n" +msgid "You must set \"%%_gpg_name\" in your macro file\n" msgstr "" -#: lib/rpmlead.c:49 +#: lib/signature.c:836 #, c-format -msgid "read failed: %s (%d)\n" +msgid "You must set \"%%_pgp_name\" in your macro file\n" msgstr "" -#: lib/rpmrc.c:156 +#: lib/transaction.c:439 +msgid "========== relocations\n" +msgstr "" + +#: lib/transaction.c:443 #, c-format -msgid "missing second ':' at %s:%d\n" +msgid "%5d exclude %s\n" msgstr "" -#: lib/rpmrc.c:159 +#: lib/transaction.c:446 #, c-format -msgid "missing architecture name at %s:%d\n" +msgid "%5d relocate %s -> %s\n" msgstr "" -#: lib/rpmrc.c:314 +#: lib/transaction.c:516 #, c-format -msgid "Incomplete data line at %s:%d\n" +msgid "excluding multilib path %s%s\n" msgstr "" -#: lib/rpmrc.c:319 +#: lib/transaction.c:579 #, c-format -msgid "Too many args in data line at %s:%d\n" +msgid "excluding %s %s\n" msgstr "" -#: lib/rpmrc.c:327 +#: lib/transaction.c:589 #, c-format -msgid "Bad arch/os number: %s (%s:%d)\n" +msgid "relocating %s to %s\n" msgstr "" -#: lib/rpmrc.c:366 +#: lib/transaction.c:667 #, c-format -msgid "Incomplete default line at %s:%d\n" +msgid "relocating directory %s to %s\n" msgstr "" -#: lib/rpmrc.c:371 +#: lib/transaction.c:801 #, c-format -msgid "Too many args in default line at %s:%d\n" +msgid "%s skipped due to missingok flag\n" msgstr "" -#: lib/rpmrc.c:568 +#: lib/transaction.c:1399 #, c-format -msgid "Cannot expand %s\n" +msgid "excluding directory %s\n" +msgstr "" + +#: lib/verify.c:257 +msgid "package lacks both user name and id lists (this should never happen)\n" +msgstr "" + +#: lib/verify.c:278 +msgid "package lacks both group name and id lists (this should never happen)\n" msgstr "" -#: lib/rpmrc.c:573 +#: lib/verify.c:362 #, c-format -msgid "Cannot read %s, HOME is too large.\n" +msgid "%s-%s-%s: immutable header region digest check failed\n" msgstr "" -#: lib/rpmrc.c:590 +#: lib/verify.c:415 #, c-format -msgid "Unable to open %s for reading: %s.\n" +msgid "missing %s" msgstr "" -#. XXX Feof(fd) -#: lib/rpmrc.c:636 +#: lib/verify.c:508 #, c-format -msgid "Failed to read %s: %s.\n" +msgid "Unsatisfied dependencies for %s-%s-%s: " msgstr "" -#: lib/rpmrc.c:673 +#: rpmdb/db1.c:100 rpmdb/db3.c:84 #, c-format -msgid "missing ':' (found 0x%02x) at %s:%d\n" +msgid "db%d error(%d) from %s: %s\n" msgstr "" -#: lib/rpmrc.c:690 lib/rpmrc.c:764 +#: rpmdb/db1.c:103 rpmdb/db3.c:87 #, c-format -msgid "missing argument for %s at %s:%d\n" +msgid "db%d error(%d): %s\n" msgstr "" -#: lib/rpmrc.c:707 lib/rpmrc.c:729 +#: rpmdb/db1.c:168 #, c-format -msgid "%s expansion failed at %s:%d \"%s\"\n" +msgid "" +"Broken package chain at offset %d(0x%08x), attempting to reconnect ...\n" msgstr "" -#: lib/rpmrc.c:716 +#: rpmdb/db1.c:180 #, c-format -msgid "cannot open %s at %s:%d: %s\n" +msgid "Reconnecting broken chain at offset %d(0x%08x).\n" msgstr "" -#: lib/rpmrc.c:756 +#: rpmdb/db1.c:497 #, c-format -msgid "missing architecture for %s at %s:%d\n" +msgid "closed db file %s\n" msgstr "" -#: lib/rpmrc.c:823 +#: rpmdb/db1.c:500 #, c-format -msgid "bad option '%s' at %s:%d\n" +msgid "removed db file %s\n" msgstr "" -#: lib/rpmrc.c:1378 +#: rpmdb/db1.c:533 #, c-format -msgid "Unknown system: %s\n" +msgid "bad db file %s\n" msgstr "" -#: lib/rpmrc.c:1379 -msgid "Please contact rpm-list@redhat.com\n" +#: rpmdb/db1.c:538 +#, c-format +msgid "opening db file %s mode 0x%x\n" msgstr "" -#: lib/signature.c:126 -msgid "file is not regular -- skipping size check\n" +#. XXX check errno validity +#: rpmdb/db1.c:561 +#, c-format +msgid "cannot get %s lock on database\n" msgstr "" -#: lib/signature.c:134 +#: rpmdb/db1.c:562 rpmdb/db3.c:1057 +msgid "exclusive" +msgstr "" + +#: rpmdb/db1.c:562 rpmdb/db3.c:1057 +msgid "shared" +msgstr "" + +#: rpmdb/db3.c:112 #, c-format -msgid "Expected size: %12d = lead(%d)+sigs(%d)+pad(%d)+data(%d)\n" +msgid "closed db environment %s/%s\n" msgstr "" -#: lib/signature.c:138 +#: rpmdb/db3.c:128 #, c-format -msgid " Actual size: %12d\n" +msgid "removed db environment %s/%s\n" msgstr "" -#: lib/signature.c:157 -msgid "No signature\n" +#: rpmdb/db3.c:166 +#, c-format +msgid "opening db environment %s/%s %s\n" msgstr "" -#: lib/signature.c:161 -msgid "Old PGP signature\n" +#: rpmdb/db3.c:629 +#, c-format +msgid "closed db index %s/%s\n" msgstr "" -#: lib/signature.c:172 -msgid "Old (internal-only) signature! How did you get that!?\n" +#: rpmdb/db3.c:665 +#, c-format +msgid "verified db index %s/%s\n" msgstr "" -#: lib/signature.c:228 +#: rpmdb/db3.c:848 #, c-format -msgid "Signature: size(%d)+pad(%d)\n" +msgid "opening db index %s/%s %s mode=0x%x\n" msgstr "" -#: lib/signature.c:287 +#: rpmdb/db3.c:1055 #, c-format -msgid "Couldn't exec pgp (%s)\n" +msgid "cannot get %s lock on %s/%s\n" msgstr "" -#: lib/signature.c:300 -msgid "pgp failed\n" +#: rpmdb/db3.c:1062 +#, c-format +msgid "locked db index %s/%s\n" msgstr "" -#. PGP failed to write signature -#. Just in case -#: lib/signature.c:307 -msgid "pgp failed to write signature\n" +#: rpmdb/dbconfig.c:389 +#, c-format +msgid "unrecognized db option: \"%s\" ignored.\n" msgstr "" -#: lib/signature.c:312 +#: rpmdb/dbconfig.c:426 #, c-format -msgid "PGP sig size: %d\n" +msgid "%s has invalid numeric value, skipped\n" msgstr "" -#: lib/signature.c:325 lib/signature.c:406 -msgid "unable to read the signature\n" +#: rpmdb/dbconfig.c:435 +#, c-format +msgid "%s has too large or too small long value, skipped\n" msgstr "" -#: lib/signature.c:330 +#: rpmdb/dbconfig.c:444 #, c-format -msgid "Got %d bytes of PGP sig\n" +msgid "%s has too large or too small integer value, skipped\n" msgstr "" -#: lib/signature.c:368 lib/signature.c:726 -msgid "Couldn't exec gpg\n" +#: rpmdb/falloc.c:147 +#, c-format +msgid "" +"free list corrupt (%u)- please run\n" +"\t\"rpm --rebuilddb\"\n" +"More information is available from http://www.rpm.org or the rpm-list@redhat." +"com mailing list\n" +"if \"rpm --rebuilddb\" fails to correct the problem.\n" msgstr "" -#: lib/signature.c:381 -msgid "gpg failed\n" +#: rpmdb/poptDB.c:22 +msgid "initialize database" msgstr "" -#. GPG failed to write signature -#. Just in case -#: lib/signature.c:388 -msgid "gpg failed to write signature\n" +#: rpmdb/poptDB.c:24 +msgid "rebuild database inverted lists from installed package headers" msgstr "" -#: lib/signature.c:393 +#: rpmdb/poptDB.c:29 +msgid "generate headers compatible with (legacy) rpm[23] packaging" +msgstr "" + +#: rpmdb/rpmdb.c:104 #, c-format -msgid "GPG sig size: %d\n" +msgid "dbiTagsInit: unrecognized tag name: \"%s\" ignored\n" msgstr "" -#: lib/signature.c:411 +#: rpmdb/rpmdb.c:349 #, c-format -msgid "Got %d bytes of GPG sig\n" +msgid "cannot open %s index using db%d - %s (%d)\n" msgstr "" -#: lib/signature.c:439 -msgid "Generating signature using PGP.\n" +#: rpmdb/rpmdb.c:369 +#, c-format +msgid "cannot open %s index\n" msgstr "" -#: lib/signature.c:445 -msgid "Generating signature using GPG.\n" +#: rpmdb/rpmdb.c:460 +#, c-format +msgid "error(%d) getting \"%s\" records from %s index\n" msgstr "" -#: lib/signature.c:525 lib/signature.c:588 -msgid "Could not run pgp. Use --nopgp to skip PGP checks.\n" +#: rpmdb/rpmdb.c:588 +#, c-format +msgid "error(%d) storing record %s into %s\n" msgstr "" -#: lib/signature.c:665 -msgid "Could not run gpg. Use --nogpg to skip GPG checks.\n" +#: rpmdb/rpmdb.c:598 +#, c-format +msgid "error(%d) removing record %s from %s\n" msgstr "" -#: lib/signature.c:755 -msgid "Couldn't exec pgp\n" +#: rpmdb/rpmdb.c:844 +msgid "no dbpath has been set\n" msgstr "" -#. @notreached@ -#. This case should have been screened out long ago. -#: lib/signature.c:759 lib/signature.c:812 -msgid "Invalid %%_signature spec in macro file\n" +#: rpmdb/rpmdb.c:951 +msgid "" +"old format database is present; use --rebuilddb to generate a new format " +"database\n" msgstr "" -#: lib/signature.c:792 -msgid "You must set \"%%_gpg_name\" in your macro file\n" +#. @=nullpass@ +#. error +#: rpmdb/rpmdb.c:1183 +#, c-format +msgid "error(%d) counting packages\n" msgstr "" -#: lib/signature.c:804 -msgid "You must set \"%%_pgp_name\" in your macro file\n" +#: rpmdb/rpmdb.c:1913 rpmdb/rpmdb.c:3077 +#, c-format +msgid "record number %u in database is bad -- skipping.\n" msgstr "" -#: lib/transaction.c:419 -msgid "========== relocations\n" +#: rpmdb/rpmdb.c:1964 +#, c-format +msgid "rpmdb: damaged header instance #%u retrieved, skipping.\n" msgstr "" -#: lib/transaction.c:423 +#: rpmdb/rpmdb.c:2228 #, c-format -msgid "%5d exclude %s\n" +msgid "%s: cannot read header at 0x%x\n" msgstr "" -#: lib/transaction.c:426 +#: rpmdb/rpmdb.c:2295 #, c-format -msgid "%5d relocate %s -> %s\n" +msgid "removing \"%s\" from %s index.\n" msgstr "" -#: lib/transaction.c:496 +#: rpmdb/rpmdb.c:2304 #, c-format -msgid "excluding multilib path %s%s\n" +msgid "removing %d entries from %s index.\n" msgstr "" -#: lib/transaction.c:559 +#: rpmdb/rpmdb.c:2495 #, c-format -msgid "excluding %s %s\n" +msgid "error(%d) allocating new package instance\n" msgstr "" -#: lib/transaction.c:569 +#: rpmdb/rpmdb.c:2573 #, c-format -msgid "relocating %s to %s\n" +msgid "adding \"%s\" to %s index.\n" msgstr "" -#: lib/transaction.c:647 +#: rpmdb/rpmdb.c:2584 #, c-format -msgid "relocating directory %s to %s\n" +msgid "adding %d entries to %s index.\n" msgstr "" -#: lib/transaction.c:778 +#: rpmdb/rpmdb.c:2966 #, c-format -msgid "%s skipped due to missingok flag\n" +msgid "removing %s after successful db3 rebuild.\n" +msgstr "" + +#: rpmdb/rpmdb.c:2996 +msgid "no dbpath has been set" msgstr "" -#: lib/transaction.c:1367 +#: rpmdb/rpmdb.c:3023 #, c-format -msgid "excluding directory %s\n" +msgid "rebuilding database %s into %s\n" msgstr "" -#: lib/verify.c:63 -msgid "don't verify files in package" +#: rpmdb/rpmdb.c:3027 +#, c-format +msgid "temporary database %s already exists\n" msgstr "" -#: lib/verify.c:69 -msgid "do not execute %verifyscript (if any)" +#: rpmdb/rpmdb.c:3033 +#, c-format +msgid "creating directory %s\n" msgstr "" -#: lib/verify.c:265 -msgid "package lacks both user name and id lists (this should never happen)\n" +#: rpmdb/rpmdb.c:3035 +#, c-format +msgid "creating directory %s: %s\n" msgstr "" -#: lib/verify.c:286 -msgid "package lacks both group name and id lists (this should never happen)\n" +#: rpmdb/rpmdb.c:3042 +#, c-format +msgid "opening old database with dbapi %d\n" msgstr "" -#: lib/verify.c:360 +#: rpmdb/rpmdb.c:3053 #, c-format -msgid "missing %s" +msgid "opening new database with dbapi %d\n" msgstr "" -#: lib/verify.c:441 +#: rpmdb/rpmdb.c:3117 #, c-format -msgid "Unsatisfied dependencies for %s-%s-%s: " +msgid "cannot add record originally at %u\n" +msgstr "" + +#: rpmdb/rpmdb.c:3135 +msgid "failed to rebuild database: original database remains in place\n" +msgstr "" + +#: rpmdb/rpmdb.c:3143 +msgid "failed to replace old database with new database!\n" +msgstr "" + +#: rpmdb/rpmdb.c:3145 +#, c-format +msgid "replace files in %s with files from %s to recover" +msgstr "" + +#: rpmdb/rpmdb.c:3155 +#, c-format +msgid "removing directory %s\n" msgstr "" -#: rpmio/macro.c:201 +#: rpmdb/rpmdb.c:3157 +#, c-format +msgid "failed to remove directory %s: %s\n" +msgstr "" + +#: rpmio/macro.c:208 #, c-format msgid "======================== active %d empty %d\n" msgstr "" #. XXX just in case -#: rpmio/macro.c:319 +#: rpmio/macro.c:330 #, c-format msgid "%3d>%*s(empty)" msgstr "" -#: rpmio/macro.c:360 +#: rpmio/macro.c:372 #, c-format msgid "%3d<%*s(empty)\n" msgstr "" -#: rpmio/macro.c:576 +#: rpmio/macro.c:593 +#, c-format msgid "Macro %%%s has unterminated body\n" msgstr "" -#: rpmio/macro.c:603 +#: rpmio/macro.c:620 +#, c-format msgid "Macro %%%s has illegal name (%%define)\n" msgstr "" -#: rpmio/macro.c:610 +#: rpmio/macro.c:626 +#, c-format msgid "Macro %%%s has unterminated opts\n" msgstr "" -#: rpmio/macro.c:615 +#: rpmio/macro.c:631 +#, c-format msgid "Macro %%%s has empty body\n" msgstr "" -#: rpmio/macro.c:620 +#: rpmio/macro.c:636 +#, c-format msgid "Macro %%%s failed to expand\n" msgstr "" -#: rpmio/macro.c:652 +#: rpmio/macro.c:669 +#, c-format msgid "Macro %%%s has illegal name (%%undefine)\n" msgstr "" -#: rpmio/macro.c:757 +#: rpmio/macro.c:780 +#, c-format msgid "Macro %%%s (%s) was not used below level %d\n" msgstr "" -#: rpmio/macro.c:851 +#: rpmio/macro.c:875 #, c-format msgid "Unknown option %c in %s(%s)\n" msgstr "" -#: rpmio/macro.c:1035 +#: rpmio/macro.c:1063 #, c-format msgid "Recursion depth(%d) greater than max(%d)\n" msgstr "" -#: rpmio/macro.c:1102 rpmio/macro.c:1119 +#: rpmio/macro.c:1130 rpmio/macro.c:1147 #, c-format msgid "Unterminated %c: %s\n" msgstr "" -#: rpmio/macro.c:1160 +#: rpmio/macro.c:1188 +#, c-format msgid "A %% is followed by an unparseable macro\n" msgstr "" -#: rpmio/macro.c:1287 +#: rpmio/macro.c:1315 +#, c-format msgid "Macro %%%.*s not found, skipping\n" msgstr "" -#: rpmio/macro.c:1363 +#: rpmio/macro.c:1391 msgid "Target buffer overflow\n" msgstr "" #. XXX Fstrerror -#: rpmio/macro.c:1548 rpmio/macro.c:1554 +#: rpmio/macro.c:1580 rpmio/macro.c:1586 #, c-format msgid "File %s: %s\n" msgstr "" -#: rpmio/macro.c:1557 +#: rpmio/macro.c:1589 #, c-format msgid "File %s is smaller than %u bytes\n" msgstr "" -#: rpmio/rpmio.c:555 +#: rpmio/rpmio.c:584 msgid "Success" msgstr "" -#: rpmio/rpmio.c:558 +#: rpmio/rpmio.c:587 msgid "Bad server response" msgstr "" -#: rpmio/rpmio.c:561 +#: rpmio/rpmio.c:590 msgid "Server I/O error" msgstr "" -#: rpmio/rpmio.c:564 +#: rpmio/rpmio.c:593 msgid "Server timeout" msgstr "" -#: rpmio/rpmio.c:567 +#: rpmio/rpmio.c:596 msgid "Unable to lookup server host address" msgstr "" -#: rpmio/rpmio.c:570 +#: rpmio/rpmio.c:599 msgid "Unable to lookup server host name" msgstr "" -#: rpmio/rpmio.c:573 +#: rpmio/rpmio.c:602 msgid "Failed to connect to server" msgstr "" -#: rpmio/rpmio.c:576 +#: rpmio/rpmio.c:605 msgid "Failed to establish data connection to server" msgstr "" -#: rpmio/rpmio.c:579 +#: rpmio/rpmio.c:608 msgid "I/O error to local file" msgstr "" -#: rpmio/rpmio.c:582 +#: rpmio/rpmio.c:611 msgid "Error setting remote server to passive mode" msgstr "" -#: rpmio/rpmio.c:585 +#: rpmio/rpmio.c:614 msgid "File not found on server" msgstr "" -#: rpmio/rpmio.c:588 +#: rpmio/rpmio.c:617 msgid "Abort in progress" msgstr "" -#: rpmio/rpmio.c:592 +#: rpmio/rpmio.c:621 msgid "Unknown or unexpected error" msgstr "" -#: rpmio/rpmio.c:1203 +#: rpmio/rpmio.c:1242 #, c-format msgid "logging into %s as %s, pw %s\n" msgstr "" -#: rpmio/rpmlog.c:42 +#: rpmio/rpmlog.c:44 msgid "(no error)" msgstr "" -#. !< RPMLOG_EMERG -#: rpmio/rpmlog.c:97 rpmio/rpmlog.c:98 rpmio/rpmlog.c:99 +#. @-readonlytrans@ +#. FIX: double indeirection. +#. @observer@ +#: rpmio/rpmlog.c:102 rpmio/rpmlog.c:103 rpmio/rpmlog.c:104 msgid "fatal error: " msgstr "" #. !< RPMLOG_CRIT -#: rpmio/rpmlog.c:100 +#: rpmio/rpmlog.c:105 msgid "error: " msgstr "" #. !< RPMLOG_ERR -#: rpmio/rpmlog.c:101 +#: rpmio/rpmlog.c:106 msgid "warning: " msgstr "" @@ -3890,32 +3820,32 @@ msgstr "" msgid "memory alloc (%u bytes) returned NULL.\n" msgstr "" -#: rpmio/url.c:101 +#: rpmio/url.c:103 #, c-format msgid "warning: u %p ctrl %p nrefs != 0 (%s %s)\n" msgstr "" -#: rpmio/url.c:121 +#: rpmio/url.c:123 #, c-format msgid "warning: u %p data %p nrefs != 0 (%s %s)\n" msgstr "" -#: rpmio/url.c:149 +#: rpmio/url.c:151 #, c-format msgid "warning: uCache[%d] %p nrefs(%d) != 1 (%s %s)\n" msgstr "" -#: rpmio/url.c:246 +#: rpmio/url.c:244 #, c-format msgid "Password for %s@%s: " msgstr "" -#: rpmio/url.c:271 rpmio/url.c:297 +#: rpmio/url.c:269 rpmio/url.c:295 #, c-format msgid "error: %sport must be a number\n" msgstr "" -#: rpmio/url.c:435 +#: rpmio/url.c:434 msgid "url port must be a number\n" msgstr "" diff --git a/popt/po/popt.pot b/popt/po/popt.pot index 3687099..f786aef 100644 --- a/popt/po/popt.pot +++ b/popt/po/popt.pot @@ -6,99 +6,111 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-02-22 17:41-0500\n" +"POT-Creation-Date: 2001-06-19 07:33-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: ENCODING\n" +"Content-Transfer-Encoding: 8bit\n" #: popt.c:29 msgid "unknown errno" msgstr "" -#: popt.c:758 +#: popt.c:888 #, c-format msgid "option type (%d) not implemented in popt\n" msgstr "" -#: popt.c:893 +#: popt.c:1053 msgid "missing argument" msgstr "" -#: popt.c:895 +#: popt.c:1055 msgid "unknown option" msgstr "" -#: popt.c:897 +#: popt.c:1057 msgid "mutually exclusive logical operations requested" msgstr "" -#: popt.c:899 +#: popt.c:1059 +msgid "opt->arg should not be NULL" +msgstr "" + +#: popt.c:1061 msgid "aliases nested too deeply" msgstr "" -#: popt.c:901 +#: popt.c:1063 msgid "error in parameter quoting" msgstr "" -#: popt.c:903 +#: popt.c:1065 msgid "invalid numeric value" msgstr "" -#: popt.c:905 +#: popt.c:1067 msgid "number too large or too small" msgstr "" -#: popt.c:909 +#: popt.c:1069 +msgid "memory allocation failed" +msgstr "" + +#: popt.c:1073 msgid "unknown error" msgstr "" -#: popthelp.c:28 +#: popthelp.c:32 msgid "Show this help message" msgstr "" -#: popthelp.c:29 +#: popthelp.c:33 msgid "Display brief usage message" msgstr "" -#: popthelp.c:60 +#: popthelp.c:36 +msgid "Display option defaults in message" +msgstr "" + +#: popthelp.c:71 msgid "NONE" msgstr "" -#: popthelp.c:61 +#: popthelp.c:72 msgid "VAL" msgstr "" -#: popthelp.c:62 +#: popthelp.c:73 msgid "INT" msgstr "" -#: popthelp.c:63 +#: popthelp.c:74 msgid "LONG" msgstr "" -#: popthelp.c:64 +#: popthelp.c:75 msgid "STRING" msgstr "" -#: popthelp.c:65 +#: popthelp.c:76 msgid "FLOAT" msgstr "" -#: popthelp.c:66 +#: popthelp.c:77 msgid "DOUBLE" msgstr "" -#: popthelp.c:67 +#: popthelp.c:78 msgid "ARG" msgstr "" -#: popthelp.c:241 +#: popthelp.c:354 msgid "Usage:" msgstr "" -#: popthelp.c:260 +#: popthelp.c:376 msgid "[OPTION...]" msgstr "" diff --git a/rpm.spec b/rpm.spec index afcfa3b..3c9cdca 100644 --- a/rpm.spec +++ b/rpm.spec @@ -31,8 +31,6 @@ BuildRequires: db3-devel # XXX linked binaries like /bin/rpm. %ifnarch ia64 Requires: glibc >= 2.1.92 -# XXX needed to avoid libdb.so.2 satisfied by compat/libc5 provides. -Requires: db1 = 1.85 %endif %endif @@ -131,11 +129,30 @@ rm -rf $RPM_BUILD_ROOT make DESTDIR="$RPM_BUILD_ROOT" install +%ifos linux + +# Save list of packages through cron +mkdir -p ${RPM_BUILD_ROOT}/etc/cron.daily +install -m 755 scripts/rpm.daily ${RPM_BUILD_ROOT}/etc/cron.daily/rpm + +mkdir -p ${RPM_BUILD_ROOT}/etc/logrotate.d +install -m 755 scripts/rpm.log ${RPM_BUILD_ROOT}/etc/logrotate.d/rpm + mkdir -p $RPM_BUILD_ROOT/etc/rpm cat << E_O_F > $RPM_BUILD_ROOT/etc/rpm/macros.db1 %%_dbapi 1 E_O_F +mkdir -p $RPM_BUILD_ROOT/var/lib/rpm +for dbi in \ + Basenames Conflictname Dirnames Group Installtid Name Providename \ + Provideversion Removetid Requirename Requireversion Triggername +do + touch $RPM_BUILD_ROOT/var/lib/rpm/$dbi +done + +%endif + %if %{with_apidocs} gzip -9n apidocs/man/man*/* || : %endif @@ -151,34 +168,46 @@ gzip -9n apidocs/man/man*/* || : rm -rf $RPM_BUILD_ROOT %pre +%ifos linux if [ -f /var/lib/rpm/Packages -a -f /var/lib/rpm/packages.rpm ]; then -# echo " -#You have both -# /var/lib/rpm/packages.rpm db1 format installed package headers -# /var/lib/rpm/Packages db3 format installed package headers -#Please remove (or at least rename) one of those files, and re-install. -#" + echo " +You have both + /var/lib/rpm/packages.rpm db1 format installed package headers + /var/lib/rpm/Packages db3 format installed package headers +Please remove (or at least rename) one of those files, and re-install. +" exit 1 fi +/usr/sbin/groupadd -g 37 rpm > /dev/null 2>&1 +/usr/sbin/useradd -d /var/lib/rpm -u 37 -g 37 rpm > /dev/null 2>&1 +%endif exit 0 %post %ifos linux /sbin/ldconfig -%endif if [ -f /var/lib/rpm/packages.rpm ]; then - : # do nothing + /bin/chown rpm.rpm /var/lib/rpm/*.rpm elif [ -f /var/lib/rpm/Packages ]; then # undo db1 configuration rm -f /etc/rpm/macros.db1 + /bin/chown rpm.rpm /var/lib/rpm/[A-Z]* else # initialize db3 database rm -f /etc/rpm/macros.db1 /bin/rpm --initdb fi +%endif +exit 0 %ifos linux -%postun -p /sbin/ldconfig +%postun +/sbin/ldconfig +if [ $1 == 0 ]; then + /usr/sbin/userdel rpm + /usr/sbin/groupdel rpm +fi + %post devel -p /sbin/ldconfig %postun devel -p /sbin/ldconfig @@ -192,50 +221,79 @@ fi %postun python -p /sbin/ldconfig %endif +%define rpmattr %attr(0755, rpm, rpm) +%define rpmdbattr %rpmattr %verify(not md5 size mtime) %ghost + %files %defattr(-,root,root) %doc RPM-PGP-KEY RPM-GPG-KEY CHANGES GROUPS doc/manual/[a-z]* -/bin/rpm -%dir /etc/rpm -%config(missingok) /etc/rpm/macros.db1 -%{__prefix}/bin/rpm2cpio -%{__prefix}/bin/gendiff -%{__prefix}/bin/rpmdb -%{__prefix}/bin/rpm[eiukqv] -%{__prefix}/bin/rpmsign -%{__prefix}/bin/rpmquery -%{__prefix}/bin/rpmverify +%attr(0755, rpm, rpm) /bin/rpm + +%ifos linux +%config(noreplace,missingok) /etc/cron.daily/rpm +%config(noreplace,missingok) /etc/logrotate.d/rpm +%dir /etc/rpm +%config(noreplace,missingok) /etc/rpm/macros.db1 +%attr(0755, rpm, rpm) %dir /var/lib/rpm +%rpmdbattr /var/lib/rpm/Basenames +%rpmdbattr /var/lib/rpm/Conflictname +#%rpmdbattr /var/lib/rpm/__db.001 +%rpmdbattr /var/lib/rpm/Dirnames +%rpmdbattr /var/lib/rpm/Group +%rpmdbattr /var/lib/rpm/Installtid +%rpmdbattr /var/lib/rpm/Name +#%rpmdbattr /var/lib/rpm/Packages +%rpmdbattr /var/lib/rpm/Providename +%rpmdbattr /var/lib/rpm/Provideversion +%rpmdbattr /var/lib/rpm/Removetid +%rpmdbattr /var/lib/rpm/Requirename +%rpmdbattr /var/lib/rpm/Requireversion +%rpmdbattr /var/lib/rpm/Triggername +%endif + +%rpmattr %{__prefix}/bin/rpm2cpio +%rpmattr %{__prefix}/bin/gendiff +%rpmattr %{__prefix}/bin/rpmdb +%rpmattr %{__prefix}/bin/rpm[eiukqv] +%rpmattr %{__prefix}/bin/rpmsign +%rpmattr %{__prefix}/bin/rpmquery +%rpmattr %{__prefix}/bin/rpmverify + %{__prefix}/lib/librpm.so.* +%{__prefix}/lib/librpmdb.so.* %{__prefix}/lib/librpmio.so.* %{__prefix}/lib/librpmbuild.so.* -%{__prefix}/lib/rpm/config.guess -%{__prefix}/lib/rpm/config.sub -%{__prefix}/lib/rpm/convertrpmrc.sh -%{__prefix}/lib/rpm/macros -%{__prefix}/lib/rpm/mkinstalldirs -%{__prefix}/lib/rpm/rpmdb -%{__prefix}/lib/rpm/rpm[eiukqv] -%{__prefix}/lib/rpm/rpmpopt* -%{__prefix}/lib/rpm/rpmrc - -%ifarch i386 i486 i586 i686 -%{__prefix}/lib/rpm/i[3456]86* +%rpmattr %{__prefix}/lib/rpm/config.guess +%rpmattr %{__prefix}/lib/rpm/config.sub +%rpmattr %{__prefix}/lib/rpm/convertrpmrc.sh +%attr(0644, rpm, rpm) %{__prefix}/lib/rpm/macros +%rpmattr %{__prefix}/lib/rpm/mkinstalldirs +%rpmattr %{__prefix}/lib/rpm/rpm.* +%rpmattr %{__prefix}/lib/rpm/rpm[deiukqv] +%attr(0644, rpm, rpm) %{__prefix}/lib/rpm/rpmpopt* +%attr(0644, rpm, rpm) %{__prefix}/lib/rpm/rpmrc + +%ifarch i386 i486 i586 i686 athlon +%attr(-, rpm, rpm) %{__prefix}/lib/rpm/i[3456]86* %endif %ifarch alpha -%{__prefix}/lib/rpm/alpha* +%attr(-, rpm, rpm) %{__prefix}/lib/rpm/alpha* %endif %ifarch sparc sparc64 -%{__prefix}/lib/rpm/sparc* +%attr(-, rpm, rpm) %{__prefix}/lib/rpm/sparc* %endif %ifarch ia64 -%{__prefix}/lib/rpm/ia64* +%attr(-, rpm, rpm) %{__prefix}/lib/rpm/ia64* %endif %ifarch powerpc ppc -%{__prefix}/lib/rpm/ppc* +%attr(-, rpm, rpm) %{__prefix}/lib/rpm/ppc* +%endif +%ifarch s390 s390x +%attr(-, rpm, rpm) %{__prefix}/lib/rpm/s390* %endif %ifarch armv3l armv4l -%{__prefix}/lib/rpm/armv[34][lb]* +%attr(-, rpm, rpm) %{__prefix}/lib/rpm/armv[34][lb]* %endif %lang(cs) %{__prefix}/*/locale/cs/LC_MESSAGES/rpm.mo @@ -257,7 +315,9 @@ fi %lang(sv) %{__prefix}/*/locale/sv/LC_MESSAGES/rpm.mo %lang(tr) %{__prefix}/*/locale/tr/LC_MESSAGES/rpm.mo -%{__prefix}%{__share}/man/man[18]/*.[18]* +%{__prefix}%{__share}/man/man1/gendiff.1* +%{__prefix}%{__share}/man/man8/rpm.8* +%{__prefix}%{__share}/man/man8/rpm2cpio.8* %lang(pl) %{__prefix}%{__share}/man/pl/man[18]/*.[18]* %lang(ru) %{__prefix}%{__share}/man/ru/man[18]/*.[18]* %lang(sk) %{__prefix}%{__share}/man/sk/man[18]/*.[18]* @@ -271,31 +331,35 @@ fi %dir %{__prefix}/src/redhat/SRPMS %dir %{__prefix}/src/redhat/RPMS %{__prefix}/src/redhat/RPMS/* -%{__prefix}/bin/rpmbuild -%{__prefix}/lib/rpm/brp-* -%{__prefix}/lib/rpm/check-prereqs -%{__prefix}/lib/rpm/cpanflute -%{__prefix}/lib/rpm/find-lang.sh -%{__prefix}/lib/rpm/find-prov.pl -%{__prefix}/lib/rpm/find-provides -%{__prefix}/lib/rpm/find-provides.perl -%{__prefix}/lib/rpm/find-req.pl -%{__prefix}/lib/rpm/find-requires -%{__prefix}/lib/rpm/find-requires.perl -%{__prefix}/lib/rpm/get_magic.pl -%{__prefix}/lib/rpm/getpo.sh -%{__prefix}/lib/rpm/http.req -%{__prefix}/lib/rpm/javadeps -%{__prefix}/lib/rpm/magic.prov -%{__prefix}/lib/rpm/magic.req -%{__prefix}/lib/rpm/perl.prov -%{__prefix}/lib/rpm/perl.req -%{__prefix}/lib/rpm/rpm[bt] -%{__prefix}/lib/rpm/rpmdiff -%{__prefix}/lib/rpm/rpmdiff.cgi -%{__prefix}/lib/rpm/u_pkg.sh -%{__prefix}/lib/rpm/vpkg-provides.sh -%{__prefix}/lib/rpm/vpkg-provides2.sh +%rpmattr %{__prefix}/bin/rpmbuild +%rpmattr %{__prefix}/lib/rpm/brp-* +%rpmattr %{__prefix}/lib/rpm/check-prereqs +%rpmattr %{__prefix}/lib/rpm/config.site +%rpmattr %{__prefix}/lib/rpm/cpanflute +%rpmattr %{__prefix}/lib/rpm/cross-build +%rpmattr %{__prefix}/lib/rpm/find-lang.sh +%rpmattr %{__prefix}/lib/rpm/find-prov.pl +%rpmattr %{__prefix}/lib/rpm/find-provides +%rpmattr %{__prefix}/lib/rpm/find-provides.perl +%rpmattr %{__prefix}/lib/rpm/find-req.pl +%rpmattr %{__prefix}/lib/rpm/find-requires +%rpmattr %{__prefix}/lib/rpm/find-requires.perl +%rpmattr %{__prefix}/lib/rpm/get_magic.pl +%rpmattr %{__prefix}/lib/rpm/getpo.sh +%rpmattr %{__prefix}/lib/rpm/http.req +%rpmattr %{__prefix}/lib/rpm/javadeps +%rpmattr %{__prefix}/lib/rpm/magic.prov +%rpmattr %{__prefix}/lib/rpm/magic.req +%rpmattr %{__prefix}/lib/rpm/perl.prov +%rpmattr %{__prefix}/lib/rpm/perl.req +%rpmattr %{__prefix}/lib/rpm/rpm[bt] +%rpmattr %{__prefix}/lib/rpm/rpmdiff +%rpmattr %{__prefix}/lib/rpm/rpmdiff.cgi +%rpmattr %{__prefix}/lib/rpm/u_pkg.sh +%rpmattr %{__prefix}/lib/rpm/vpkg-provides.sh +%rpmattr %{__prefix}/lib/rpm/vpkg-provides2.sh + +%{__prefix}%{__share}/man/man8/rpmbuild.8* %if %{with_python_subpackage} %files python @@ -312,6 +376,9 @@ fi %{__prefix}/lib/librpm.a %{__prefix}/lib/librpm.la %{__prefix}/lib/librpm.so +%{__prefix}/lib/librpmdb.a +%{__prefix}/lib/librpmdb.la +%{__prefix}/lib/librpmdb.so %{__prefix}/lib/librpmio.a %{__prefix}/lib/librpmio.la %{__prefix}/lib/librpmio.so diff --git a/rpmdb/falloc.c b/rpmdb/falloc.c index 777c776..46b70f3 100644 --- a/rpmdb/falloc.c +++ b/rpmdb/falloc.c @@ -388,7 +388,7 @@ static int fadSanity(FD_t fd, int offset, const struct faHeader * fh, int printi int rc = 0; /* Check size range and alignment. */ - if (!(fh->size > 0 || fh->size <= 0x00200000 && (fh->size & 0x3f) == 0)) + if (!(fh->size > 0 && fh->size <= 0x00200000 && (fh->size & 0x3f) == 0)) rc |= 0x1; /* Check forward link range, alignment and offset. */ diff --git a/rpmrc.in b/rpmrc.in index 0ad704c..5a65e61 100644 --- a/rpmrc.in +++ b/rpmrc.in @@ -1,7 +1,7 @@ #/*! \page config_rpmrc Default configuration: /usr/lib/rpm/rpmrc # \verbatim # -# $Id: rpmrc.in,v 2.37 2001/05/16 19:19:15 jbj Exp $ +# $Id: rpmrc.in,v 2.38 2001/06/19 11:38:51 jbj Exp $ # # This is a global RPM configuration file. All changes made here will # be lost when the rpm package is upgraded. Any per-system configuration @@ -50,6 +50,8 @@ optflags: falcon -O2 -fomit-frame-pointer optflags: atariclone -O2 -fomit-frame-pointer optflags: milan -O2 -fomit-frame-pointer optflags: hades -O2 -fomit-frame-pointer +optflags: s390 -O2 +optflags: s390x -O2 ############################################################# # Canonical arch names and numbers @@ -97,6 +99,7 @@ arch_canon: milan: m68kmint 13 arch_canon: hades: m68kmint 13 arch_canon: s390: s390 14 arch_canon: i370: i370 14 +arch_canon: s390x: s390x 15 ############################################################# # Canonical OS names and numbers @@ -168,6 +171,9 @@ buildarchtranslate: atariclone: m68kmint buildarchtranslate: milan: m68kmint buildarchtranslate: hades: m68kmint +buildarchtranslate: s390: s390 +buildarchtranslate: s390x: s390x + ############################################################# # Architecture compatibility @@ -224,8 +230,9 @@ arch_compat: atariclone: m68kmint noarch arch_compat: milan: m68kmint noarch arch_compat: hades: m68kmint noarch -arch_compat: s390: i370 arch_compat: i370: noarch +arch_compat: s390: noarch +arch_compat: s390x: noarch arch_compat: ia64: i686 noarch @@ -299,7 +306,9 @@ buildarch_compat: milan: m68kmint noarch buildarch_compat: hades: m68kmint noarch buildarch_compat: ia64: noarch + buildarch_compat: s390: noarch +buildarch_compat: s390x: noarch macrofiles: @RPMCONFIGDIR@/macros:@RPMCONFIGDIR@/%{_target}/macros:@SYSCONFIGDIR@/macros.specspo:@SYSCONFIGDIR@/macros.db1:@SYSCONFIGDIR@/macros:@SYSCONFIGDIR@/%{_target}/macros:~/.rpmmacros -- 2.7.4