From bc348ac49cddff43f7aed6d0d17531a8482d0e47 Mon Sep 17 00:00:00 2001 From: jbj Date: Mon, 12 Feb 2001 16:33:08 +0000 Subject: [PATCH] Rename RPMSIG_* signature types to RPMSIGTYPE_* to avoid confusion. Remove dead code. CVS patchset: 4549 CVS date: 2001/02/12 16:33:08 --- build/pack.c | 2 +- lib/psm.c | 286 ++++++++++++++++++--------------------------------- lib/psm.h | 1 + lib/rpmchecksig.c | 2 +- lib/signature.c | 21 ++-- lib/signature.h | 67 ++++++------ po/rpm.pot | 85 +++++++-------- tools/rpmsignature.c | 5 +- 8 files changed, 187 insertions(+), 282 deletions(-) diff --git a/build/pack.c b/build/pack.c index 3a75da3..84c9f8f 100644 --- a/build/pack.c +++ b/build/pack.c @@ -469,7 +469,7 @@ int writeRPM(Header *hdrp, const char *fileName, int type, lead.type = type; lead.archnum = archnum; lead.osnum = osnum; - lead.signature_type = RPMSIG_HEADERSIG; /* New-style signature */ + lead.signature_type = RPMSIGTYPE_HEADERSIG; { const char *name, *version, *release; headerNVR(h, &name, &version, &release); diff --git a/lib/psm.c b/lib/psm.c index ab8efaf..0cd8e7d 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -212,77 +212,6 @@ void freeFi(TFI_t fi) /*@notreached@*/ } -#ifdef DYING -/** - */ -struct pkgIterator { -/*@dependent@*/ /*@kept@*/ TFI_t fi; - int i; -}; - -/** - */ -static /*@null@*/ void * pkgFreeIterator(/*@only@*/ /*@null@*/ void * this) { - return _free(this); -} - -/** - */ -static /*@only@*/ void * pkgInitIterator(/*@kept@*/ rpmTransactionSet ts, - /*@kept@*/ TFI_t fi) -{ - struct pkgIterator * pi = NULL; - if (ts && fi) { - pi = xcalloc(sizeof(*pi), 1); - pi->fi = fi; - switch (fi->type) { - case TR_ADDED: pi->i = 0; break; - case TR_REMOVED: pi->i = fi->fc; break; - } - } - return pi; -} - -/** - */ -static int pkgNextIterator(/*@null@*/ void * this) { - struct pkgIterator * pi = this; - int i = -1; - - if (pi) { - TFI_t fi = pi->fi; - switch (fi->type) { - case TR_ADDED: - if (pi->i < fi->fc) - i = pi->i++; - break; - case TR_REMOVED: - if (pi->i >= 0) - i = --pi->i; - break; - } - } - return i; -} - -int pkgActions(const rpmTransactionSet ts, TFI_t fi, fileStage a) -{ - int rc = 0; - - if (fi->actions) { - void * pi = pkgInitIterator(ts, fi); - int i; - while ((i = pkgNextIterator(pi)) != -1) { - if (pkgAction(ts, fi, i, a)) - rc++; - } - pi = pkgFreeIterator(pi); - } - return rc; -} -#endif - - /** * Macros to be defined from per-header tag values. * @todo Should other macros be added from header when installing a package? @@ -363,51 +292,6 @@ static void setFileOwners(TFI_t fi) } } -#ifdef DYING -/** - * Truncate header changelog tag to configurable limit before installing. - * @param h header - * @return none - */ -static void trimChangelog(TFI_t fi, Header h) -{ - HGE_t hge = (HGE_t)fi->hge; - HFD_t hfd = fi->hfd; - int * times; - const char ** names, ** texts; - int cnt, ctt; - long numToKeep = rpmExpandNumeric( - "%{?_instchangelog:%{_instchagelog}}%{!?_instchangelog:5}"); - char * end; - int count; - - if (numToKeep < 0) return; - - if (!numToKeep) { - headerRemoveEntry(h, RPMTAG_CHANGELOGTIME); - headerRemoveEntry(h, RPMTAG_CHANGELOGNAME); - headerRemoveEntry(h, RPMTAG_CHANGELOGTEXT); - return; - } - - if (!hge(h, RPMTAG_CHANGELOGTIME, NULL, (void **) ×, &count) || - count < numToKeep) return; - - hge(h, RPMTAG_CHANGELOGNAME, &cnt, (void **) &names, &count); - hge(h, RPMTAG_CHANGELOGTEXT, &ctt, (void **) &texts, &count); - - headerModifyEntry(h, RPMTAG_CHANGELOGTIME, RPM_INT32_TYPE, times, - numToKeep); - headerModifyEntry(h, RPMTAG_CHANGELOGNAME, RPM_STRING_ARRAY_TYPE, names, - numToKeep); - headerModifyEntry(h, RPMTAG_CHANGELOGTEXT, RPM_STRING_ARRAY_TYPE, texts, - numToKeep); - - names = hfd(names, cnt); - texts = hfd(texts, ctt); -} -#endif /* DYING */ - /** * Copy file data from h to newH. * @param h header from @@ -984,6 +868,50 @@ exit: } /** + * Enter and leave a chroot. + * @param ts transaction set + * @param fi transaction element file info + * @return 0 on sucess or not performed, chroot(2) rc otherwise + */ +static int psmChroot(rpmTransactionSet ts, TFI_t fi, int enter) +{ + int rc = 0; + + if (enter) { + /* Change root directory if requested and not already done. */ + if (ts->rootDir && !ts->chrootDone && !fi->chrootDone) { + static int _loaded = 0; + + /* + * This loads all of the name services libraries, in case we + * don't have access to them in the chroot(). + */ + if (!_loaded) { + (void)getpwnam("root"); + endpwent(); + _loaded++; + } + + chdir("/"); + /*@-unrecog@*/ + rc = chroot(ts->rootDir); + /*@=unrecog@*/ + fi->chrootDone = ts->chrootDone = 1; + } + } else { + /* Restore root directory if changed. */ + if (fi->chrootDone) { + /*@-unrecog@*/ + rc = chroot("."); + /*@=unrecog@*/ + fi->chrootDone = ts->chrootDone = 0; + chdir(ts->currDir); + } + } + return rc; +} + +/** * @todo Packages w/o files never get a callback, hence don't get displayed * on install with -v. */ @@ -992,7 +920,6 @@ int installBinaryPackage(const rpmTransactionSet ts, TFI_t fi) HGE_t hge = (HGE_t)fi->hge; /*@observer@*/ static char * stepName = " install"; Header oldH = NULL; - int chrootDone = 0; int otherOffset = 0; int ec = 2; /* assume error return */ int rc; @@ -1073,23 +1000,8 @@ int installBinaryPackage(const rpmTransactionSet ts, TFI_t fi) goto exit; } - if (ts->rootDir && !ts->chrootDone) { - static int _loaded = 0; - - /* - * This loads all of the name services libraries, in case we - * don't have access to them in the chroot(). - */ - if (!_loaded) { - (void)getpwnam("root"); - endpwent(); - _loaded++; - } - - chdir("/"); - /*@-unrecog@*/ chroot(ts->rootDir); /*@=unrecog@*/ - chrootDone = ts->chrootDone = 1; - } + /* Change root directory if requested and not already done. */ + (void) psmChroot(ts, fi, 1); if (fi->fc > 0 && !(ts->transFlags & RPMTRANS_FLAG_JUSTDB)) { @@ -1101,11 +1013,8 @@ int installBinaryPackage(const rpmTransactionSet ts, TFI_t fi) goto exit; } - if (ts->rootDir && chrootDone) { - /*@-unrecog@*/ chroot("."); /*@=unrecog@*/ - chrootDone = ts->chrootDone = 0; - chdir(ts->currDir); - } + /* Restore root directory if changed. */ + (void) psmChroot(ts, fi, 0); if (fi->fc > 0 && fi->fstates) { headerAddEntry(fi->h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, @@ -1117,12 +1026,16 @@ int installBinaryPackage(const rpmTransactionSet ts, TFI_t fi) &installTime, 1); } -#ifdef DYING - trimChangelog(fi, fi->h); -#endif + /* + * Legacy: changelogs used to be trimmed to (configurable) lsat N entries + * here. This doesn't make sense now that headers have immutable regions, + * as trimming changelogs would only increase the size of the header. + */ - /* if this package has already been installed, remove it from the database - before adding the new one */ + /* + * If this package has already been installed, remove it from the database + * before adding the new one. + */ if (otherOffset) rpmdbRemove(ts->rpmdb, ts->id, otherOffset); @@ -1169,11 +1082,9 @@ int installBinaryPackage(const rpmTransactionSet ts, TFI_t fi) ec = 0; exit: - if (ts->chrootDone) { - /*@-unrecog@*/ chroot("."); /*@=unrecog@*/ - chdir(ts->currDir); - ts->chrootDone = 0; - } + /* Restore root directory if changed. */ + (void) psmChroot(ts, fi, 0); + if (oldH) headerFree(oldH); return ec; @@ -1183,7 +1094,6 @@ int removeBinaryPackage(const rpmTransactionSet ts, TFI_t fi) { /*@observer@*/ static char * stepName = " erase"; Header h; - int chrootDone = 0; const char * failedFile = NULL; const void * pkgKey = NULL; int rc = 0; @@ -1198,8 +1108,10 @@ assert(fi->type == TR_REMOVED); * versions of this package that will be installed when we are finished. */ fi->scriptArg = rpmdbCountPackages(ts->rpmdb, fi->name) - 1; - if (fi->scriptArg < 0) - return 1; + if (fi->scriptArg < 0) { + rc = 1; + goto exit; + } { rpmdbMatchIterator mi = NULL; @@ -1209,27 +1121,31 @@ assert(fi->type == TR_REMOVED); h = rpmdbNextIterator(mi); if (h == NULL) { rpmdbFreeIterator(mi); - return 2; + rc = 2; + goto exit; } h = headerLink(h); rpmdbFreeIterator(mi); } - if (ts->rootDir && !ts->chrootDone) { - chdir("/"); - /*@-unrecog@*/ chroot(ts->rootDir); /*@=unrecog@*/ - chrootDone = ts->chrootDone = 1; - } + /* Change root directory if requested and not already done. */ + (void) psmChroot(ts, fi, 1); if (!(ts->transFlags & RPMTRANS_FLAG_NOTRIGGERS)) { /* run triggers from this package which are keyed on installed packages */ - if (runImmedTriggers(ts, RPMSENSE_TRIGGERUN, h, -1)) - return 2; + rc = runImmedTriggers(ts, RPMSENSE_TRIGGERUN, h, -1); + if (rc) { + rc = 2; + goto exit; + } /* run triggers which are set off by the removal of this package */ - if (runTriggers(ts, RPMSENSE_TRIGGERUN, h, -1)) - return 1; + rc = runTriggers(ts, RPMSENSE_TRIGGERUN, h, -1); + if (rc) { + rc = 1; + goto exit; + } } rpmMessage(RPMMESS_DEBUG, _("%s: running %s script(s) (if any)\n"), @@ -1237,8 +1153,10 @@ assert(fi->type == TR_REMOVED); rc = runInstScript(ts, h, RPMTAG_PREUN, RPMTAG_PREUNPROG, fi->scriptArg, (ts->transFlags & RPMTRANS_FLAG_NOSCRIPTS)); - if (rc) - return 1; + if (rc) { + rc = 1; + goto exit; + } if (fi->fc > 0 && !(ts->transFlags & RPMTRANS_FLAG_JUSTDB)) { @@ -1253,31 +1171,33 @@ assert(fi->type == TR_REMOVED); (void)ts->notify(h, RPMCALLBACK_UNINST_STOP, 0, fi->fc, pkgKey, ts->notifyData); } + /* XXX WTFO? erase failures are not cause for stopping. */ rpmMessage(RPMMESS_DEBUG, _("%s: running %s script(s) (if any)\n"), stepName, "post-erase"); rc = runInstScript(ts, h, RPMTAG_POSTUN, RPMTAG_POSTUNPROG, fi->scriptArg, (ts->transFlags & RPMTRANS_FLAG_NOSCRIPTS)); - /* XXX postun failures are not cause for erasure failure. */ + /* XXX WTFO? postun failures are not cause for erasure failure. */ if (!(ts->transFlags & RPMTRANS_FLAG_NOTRIGGERS)) { /* Run postun triggers which are set off by this package's removal. */ rc = runTriggers(ts, RPMSENSE_TRIGGERPOSTUN, h, -1); - if (rc) - return 2; + if (rc) { + rc = 2; + goto exit; + } } + rc = 0; - if (ts->rootDir && chrootDone) { - /*@-unrecog@*/ chroot("."); /*@=unrecog@*/ - chrootDone = ts->chrootDone = 0; - chdir(ts->currDir); - } +exit: + /* Restore root directory if changed. */ + (void) psmChroot(ts, fi, 0); - if (!(ts->transFlags & RPMTRANS_FLAG_TEST)) + if (!rc && !(ts->transFlags & RPMTRANS_FLAG_TEST)) rpmdbRemove(ts->rpmdb, ts->id, fi->record); - return 0; + return rc; } int repackage(const rpmTransactionSet ts, TFI_t fi) @@ -1290,7 +1210,6 @@ int repackage(const rpmTransactionSet ts, TFI_t fi) Header h = NULL; Header oh = NULL; char * rpmio_flags; - int chrootDone = 0; int saveerrno; int rc = 0; @@ -1304,7 +1223,8 @@ assert(fi->type == TR_REMOVED); h = rpmdbNextIterator(mi); if (h == NULL) { rpmdbFreeIterator(mi); - return 2; + rc = 2; + goto exit; } h = headerLink(h); rpmdbFreeIterator(mi); @@ -1372,7 +1292,7 @@ assert(fi->type == TR_REMOVED); lead.type = RPMLEAD_BINARY; lead.archnum = archnum; lead.osnum = osnum; - lead.signature_type = RPMSIG_UNSIGNED; + lead.signature_type = RPMSIGTYPE_HEADERSIG; { char buf[256]; sprintf(buf, "%s-%s-%s", fi->name, fi->version, fi->release); @@ -1400,11 +1320,7 @@ assert(fi->type == TR_REMOVED); if (rc) goto exit; /* Change root directory if requested and not already done. */ - if (ts->rootDir && !ts->chrootDone) { - chdir("/"); - /*@-unrecog@*/ chroot(ts->rootDir); /*@=unrecog@*/ - chrootDone = ts->chrootDone = 1; - } + (void) psmChroot(ts, fi, 1); /* Write the payload into the package. */ { FD_t cfd; @@ -1430,11 +1346,7 @@ assert(fi->type == TR_REMOVED); exit: /* Restore root directory if changed. */ - if (ts->rootDir && chrootDone) { - /*@-unrecog@*/ chroot("."); /*@=unrecog@*/ - chrootDone = ts->chrootDone = 0; - chdir(ts->currDir); - } + (void) psmChroot(ts, fi, 0); if (h) headerFree(h); if (oh) headerFree(oh); diff --git a/lib/psm.h b/lib/psm.h index 7cf6019..a8c763c 100644 --- a/lib/psm.h +++ b/lib/psm.h @@ -73,6 +73,7 @@ struct transactionFileInfo_s { int astriplen; int striplen; int scriptArg; + int chrootDone; unsigned int archiveSize; mode_t dperms; /*!< Directory perms (0755) if not mapped. */ mode_t fperms; /*!< File perms (0644) if not mapped. */ diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index 6f409e1..99a6cdc 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -185,7 +185,7 @@ l = malloc(sizeof(*l)); if (manageFile(&ofd, &trpm, O_WRONLY|O_CREAT|O_TRUNC, 0)) goto exit; - l->signature_type = RPMSIG_HEADERSIG; + l->signature_type = RPMSIGTYPE_HEADERSIG; if (writeLead(ofd, l)) { rpmError(RPMERR_WRITELEAD, _("%s: writeLead failed: %s\n"), trpm, Fstrerror(ofd)); diff --git a/lib/signature.c b/lib/signature.c index 37894ce..8f8606b 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -43,7 +43,6 @@ int rpmLookupSignatureType(int action) break; case RPMLOOKUPSIG_ENABLE: disabled = 0; - /* fall through */ /*@fallthrough@*/ case RPMLOOKUPSIG_QUERY: if (disabled) @@ -125,7 +124,7 @@ static inline int checkSize(FD_t fd, int siglen, int pad, int datalen) return ((sizeof(struct rpmlead) + siglen + pad + datalen) - st.st_size); } -int rpmReadSignature(FD_t fd, Header * headerp, short sigType) +int rpmReadSignature(FD_t fd, Header * headerp, sigType sig_type) { byte buf[2048]; int sigSize, pad; @@ -139,15 +138,15 @@ int rpmReadSignature(FD_t fd, Header * headerp, short sigType) /* XXX Yuck, see ALPHA_LOSSAGE in lib/rpmchecksig.c */ #ifdef __alpha - if (sigType == RPMSIG_NONE) sigType = RPMSIG_HEADERSIG; + if (sig_type == RPMSIGTYPE_NONE) sig_type = RPMSIGTYPE_HEADERSIG; #endif - switch (sigType) { - case RPMSIG_NONE: + switch (sig_type) { + case RPMSIGTYPE_NONE: rpmMessage(RPMMESS_DEBUG, _("No signature\n")); rc = 0; break; - case RPMSIG_PGP262_1024: + case RPMSIGTYPE_PGP262_1024: rpmMessage(RPMMESS_DEBUG, _("Old PGP signature\n")); /* These are always 256 bytes */ if (timedRead(fd, buf, 256) != 256) @@ -156,13 +155,13 @@ int rpmReadSignature(FD_t fd, Header * headerp, short sigType) headerAddEntry(h, RPMSIGTAG_PGP, RPM_BIN_TYPE, buf, 152); rc = 0; break; - case RPMSIG_MD5: - case RPMSIG_MD5_PGP: + case RPMSIGTYPE_MD5: + case RPMSIGTYPE_MD5_PGP: rpmError(RPMERR_BADSIGTYPE, _("Old (internal-only) signature! How did you get that!?\n")); break; - case RPMSIG_HEADERSIG: - case RPMSIG_UNSIGNED: + case RPMSIGTYPE_HEADERSIG: + case RPMSIGTYPE_DISABLE: /* This is a new style signature */ h = headerRead(fd, HEADER_MAGIC_YES); if (h == NULL) @@ -174,7 +173,7 @@ int rpmReadSignature(FD_t fd, Header * headerp, short sigType) sigSize -= (16 + 16); pad = (8 - (sigSize % 8)) % 8; /* 8-byte pad */ - if (sigType == RPMSIG_HEADERSIG) { + if (sig_type == RPMSIGTYPE_HEADERSIG) { if (! headerGetEntry(h, RPMSIGTAG_SIZE, &type, (void **)&archSize, &count)) break; diff --git a/lib/signature.h b/lib/signature.h index 9543fde..4cd7c35 100644 --- a/lib/signature.h +++ b/lib/signature.h @@ -8,35 +8,37 @@ #include +/** \ingroup signature + * Signature types stored in rpm lead. + */ +typedef enum sigType_e { + RPMSIGTYPE_NONE = 0, /*!< unused, legacy. */ + RPMSIGTYPE_PGP262_1024 = 1, /*!< unused, legacy. */ + RPMSIGTYPE_BAD = 2, /*!< Unknown signature type. */ + RPMSIGTYPE_MD5 = 3, /*!< unused, legacy. */ + RPMSIGTYPE_MD5_PGP = 4, /*!< unused, legacy. */ + RPMSIGTYPE_HEADERSIG= 5, /*!< Header style signature */ + RPMSIGTYPE_DISABLE = 6, /*!< Disable verification (debugging only) */ +} sigType; + +/** \ingroup signature + * Identify PGP versions. + * @note Greater than 0 is a valid PGP version. + */ +typedef enum pgpVersion_e { + PGP_NOTDETECTED = -1, + PGP_UNKNOWN = 0, + PGP_2 = 2, + PGP_5 = 5 +} pgpVersion; + #ifdef __cplusplus extern "C" { #endif -/**************************************************/ -/* */ -/* Signature types */ -/* */ -/* These are what goes in the Lead */ -/* */ -/**************************************************/ - -#define RPMSIG_NONE 0 /* Do not change! */ -#define RPMSIG_BAD 2 /* Returned for unknown types */ -/* The following types are no longer generated */ -#define RPMSIG_PGP262_1024 1 /* No longer generated */ -#define RPMSIG_MD5 3 -#define RPMSIG_MD5_PGP 4 - -/* These are the new-style signatures. They are Header structures. */ -/* Inside them we can put any number of any type of signature we like. */ - -#define RPMSIG_HEADERSIG 5 /* New Header style signature */ - -#define RPMSIG_UNSIGNED 6 - /** \ingroup signature * Return new, empty (signature) header instance. - * @return new + * @return signature header */ Header rpmNewSignature(void); @@ -48,7 +50,7 @@ Header rpmNewSignature(void); * @param sig_type type of signature header to read (from lead). * @return 0 on success, 1 on error */ -int rpmReadSignature(FD_t fd, /*@out@*/ Header *header, short sig_type); +int rpmReadSignature(FD_t fd, /*@out@*/ Header *header, sigType sig_type); /** \ingroup signature * Write signature header. @@ -61,7 +63,7 @@ int rpmWriteSignature(FD_t fd, Header header); /** \ingroup signature * Generate a signature of data in file, insert in header. */ -int rpmAddSignature(Header header, const char *file, +int rpmAddSignature(Header h, const char *file, int_32 sigTag, const char *passPhrase); /******************************************************************/ @@ -79,23 +81,12 @@ int rpmLookupSignatureType(int action); /** \ingroup signature * Read a pass phrase from the user. */ -char *rpmGetPassPhrase(const char *prompt, const int sigTag); - -/** \ingroup signature - * Identify PGP versions. - * @note Greater than 0 is a valid PGP version. - */ -typedef enum pgpVersion_e { - PGP_NOTDETECTED = -1, - PGP_UNKNOWN = 0, - PGP_2 = 2, - PGP_5 = 5 -} pgpVersion; +char * rpmGetPassPhrase(const char *prompt, const int sigTag); /** \ingroup signature * Return path to pgp executable of given type, or NULL when not found. */ -const char *rpmDetectPGPVersion( /*@out@*/ pgpVersion *pgpVersion); +/*@null@*/ const char * rpmDetectPGPVersion( /*@out@*/ pgpVersion *pgpVersion); #ifdef __cplusplus } diff --git a/po/rpm.pot b/po/rpm.pot index 46008d5..013d152 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-02-11 16:49-0500\n" +"POT-Creation-Date: 2001-02-12 10:41-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1808,7 +1808,7 @@ msgstr "" msgid "Could not open %s: %s\n" msgstr "" -#: build/pack.c:481 lib/psm.c:1384 +#: build/pack.c:481 lib/psm.c:1304 #, c-format msgid "Unable to write package: %s\n" msgstr "" @@ -1838,7 +1838,7 @@ msgstr "" msgid "Unable to write payload to %s: %s\n" msgstr "" -#: build/pack.c:563 lib/psm.c:1448 +#: build/pack.c:563 lib/psm.c:1360 #, c-format msgid "Wrote: %s\n" msgstr "" @@ -2536,7 +2536,7 @@ msgstr "" msgid "dataLength() RPM_STRING_TYPE count must be 1.\n" msgstr "" -#: lib/header.c:207 lib/header.c:1081 lib/psm.c:504 +#: lib/header.c:207 lib/header.c:1081 lib/psm.c:388 #, c-format msgid "Data type %d not supported\n" msgstr "" @@ -2904,12 +2904,12 @@ msgstr "" msgid "unknown error %d encountered while manipulating package %s" msgstr "" -#: lib/psm.c:348 +#: lib/psm.c:277 #, c-format msgid "user %s does not exist - using root\n" msgstr "" -#: lib/psm.c:356 +#: lib/psm.c:285 #, c-format msgid "group %s does not exist - using root\n" msgstr "" @@ -2919,48 +2919,49 @@ msgstr "" #. * was used up - if so, we should return a different error. #. #. XXX FIXME: Fclose with libio destroys errno -#: lib/psm.c:728 +#: lib/psm.c:612 #, c-format msgid "unpacking of archive failed%s%s: %s\n" msgstr "" -#: lib/psm.c:729 +#: lib/psm.c:613 msgid " on file " msgstr "" -#: lib/psm.c:770 +#: lib/psm.c:654 #, c-format msgid "cannot create %s %s\n" msgstr "" -#: lib/psm.c:776 +#: lib/psm.c:660 #, c-format msgid "cannot write to %s\n" msgstr "" -#: lib/psm.c:797 +#: lib/psm.c:681 msgid "installing a source package\n" msgstr "" -#: lib/psm.c:849 +#: lib/psm.c:733 msgid "source package contains no .spec file\n" msgstr "" -#: lib/psm.c:929 +#: lib/psm.c:813 msgid "source package expected, binary found\n" msgstr "" -#: lib/psm.c:1000 lib/psm.c:1191 +#: lib/psm.c:927 lib/psm.c:1101 #, c-format msgid "%s: %s-%s-%s has %d files, test = %d\n" msgstr "" -#: lib/psm.c:1064 lib/psm.c:1146 lib/psm.c:1235 lib/psm.c:1257 +#. XXX WTFO? erase failures are not cause for stopping. +#: lib/psm.c:991 lib/psm.c:1059 lib/psm.c:1151 lib/psm.c:1176 #, c-format msgid "%s: running %s script(s) (if any)\n" msgstr "" -#: lib/psm.c:1071 +#: lib/psm.c:998 msgid "skipping %s-%s-%s install, %%pre scriptlet failed rc %d\n" msgstr "" @@ -3542,121 +3543,121 @@ msgstr "" msgid "execution of %s scriptlet from %s-%s-%s failed, exit status %d\n" msgstr "" -#: lib/signature.c:115 +#: lib/signature.c:114 msgid "file is not regular -- skipping size check\n" msgstr "" -#: lib/signature.c:119 +#: lib/signature.c:118 #, c-format msgid "Expected size: %12d = lead(%d)+sigs(%d)+pad(%d)+data(%d)\n" msgstr "" -#: lib/signature.c:123 +#: lib/signature.c:122 #, c-format msgid " Actual size: %12d\n" msgstr "" -#: lib/signature.c:147 +#: lib/signature.c:146 msgid "No signature\n" msgstr "" -#: lib/signature.c:151 +#: lib/signature.c:150 msgid "Old PGP signature\n" msgstr "" -#: lib/signature.c:162 +#: lib/signature.c:161 msgid "Old (internal-only) signature! How did you get that!?\n" msgstr "" -#: lib/signature.c:218 +#: lib/signature.c:217 #, c-format msgid "Signature: size(%d)+pad(%d)\n" msgstr "" -#: lib/signature.c:277 +#: lib/signature.c:276 #, c-format msgid "Couldn't exec pgp (%s)\n" msgstr "" -#: lib/signature.c:288 +#: lib/signature.c:287 msgid "pgp failed\n" msgstr "" #. PGP failed to write signature #. Just in case -#: lib/signature.c:295 +#: lib/signature.c:294 msgid "pgp failed to write signature\n" msgstr "" -#: lib/signature.c:300 +#: lib/signature.c:299 #, c-format msgid "PGP sig size: %d\n" msgstr "" -#: lib/signature.c:311 lib/signature.c:388 +#: lib/signature.c:310 lib/signature.c:387 msgid "unable to read the signature\n" msgstr "" -#: lib/signature.c:316 +#: lib/signature.c:315 #, c-format msgid "Got %d bytes of PGP sig\n" msgstr "" -#: lib/signature.c:354 lib/signature.c:700 +#: lib/signature.c:353 lib/signature.c:699 msgid "Couldn't exec gpg\n" msgstr "" -#: lib/signature.c:365 +#: lib/signature.c:364 msgid "gpg failed\n" msgstr "" #. GPG failed to write signature #. Just in case -#: lib/signature.c:372 +#: lib/signature.c:371 msgid "gpg failed to write signature\n" msgstr "" -#: lib/signature.c:377 +#: lib/signature.c:376 #, c-format msgid "GPG sig size: %d\n" msgstr "" -#: lib/signature.c:393 +#: lib/signature.c:392 #, c-format msgid "Got %d bytes of GPG sig\n" msgstr "" -#: lib/signature.c:421 +#: lib/signature.c:420 msgid "Generating signature using PGP.\n" msgstr "" -#: lib/signature.c:427 +#: lib/signature.c:426 msgid "Generating signature using GPG.\n" msgstr "" -#: lib/signature.c:507 lib/signature.c:568 +#: lib/signature.c:506 lib/signature.c:567 msgid "Could not run pgp. Use --nopgp to skip PGP checks.\n" msgstr "" -#: lib/signature.c:641 +#: lib/signature.c:640 msgid "Could not run gpg. Use --nogpg to skip GPG checks.\n" msgstr "" -#: lib/signature.c:729 +#: lib/signature.c:728 msgid "Couldn't exec pgp\n" msgstr "" #. @notreached@ #. This case should have been screened out long ago. -#: lib/signature.c:733 lib/signature.c:786 +#: lib/signature.c:732 lib/signature.c:785 msgid "Invalid %%_signature spec in macro file\n" msgstr "" -#: lib/signature.c:766 +#: lib/signature.c:765 msgid "You must set \"%%_gpg_name\" in your macro file\n" msgstr "" -#: lib/signature.c:778 +#: lib/signature.c:777 msgid "You must set \"%%_pgp_name\" in your macro file\n" msgstr "" diff --git a/tools/rpmsignature.c b/tools/rpmsignature.c index 71d553d..977842c 100644 --- a/tools/rpmsignature.c +++ b/tools/rpmsignature.c @@ -26,12 +26,13 @@ int main(int argc, char **argv) readLead(fdi, &lead); rpmReadSignature(fdi, &sig, lead.signature_type); switch (lead.signature_type) { - case RPMSIG_NONE: + case RPMSIGTYPE_NONE: fprintf(stderr, _("No signature available.\n")); break; - default: + default: fdo = Fopen("-", "w.ufdio"); rpmWriteSignature(fdo, sig); + break; } return 0; -- 2.7.4