Establish mechanism for up2date to reconfigure rpmlib.
authorjbj <devnull@localhost>
Fri, 28 Jun 2002 00:35:57 +0000 (00:35 +0000)
committerjbj <devnull@localhost>
Fri, 28 Jun 2002 00:35:57 +0000 (00:35 +0000)
Disambiguate failures to import with error messages.

CVS patchset: 5528
CVS date: 2002/06/28 00:35:57

lib/rpmchecksig.c
rpmio/rpmerr.h
rpmrc.in

index a7e9faa..ec76a9c 100644 (file)
@@ -382,10 +382,18 @@ static int rpmImportPubkey(const rpmts ts,
        Header h = NULL;
 
        /* Read pgp packet. */
-       if ((rc =  pgpReadPkts(fn, &pkt, &pktlen)) <= 0
-        ||  rc != PGPARMOR_PUBKEY
-        || (enc = b64encode(pkt, pktlen)) == NULL)
-       {
+       if ((rc =  pgpReadPkts(fn, &pkt, &pktlen)) <= 0) {
+           rpmError(RPMERR_IMPORT, _("%s: import read failed.\n"), fn);
+           res++;
+           goto bottom;
+       }
+       if (rc != PGPARMOR_PUBKEY) {
+           rpmError(RPMERR_IMPORT, _("%s: not an armored public key.\n"), fn);
+           res++;
+           goto bottom;
+       }
+       if ((enc = b64encode(pkt, pktlen)) == NULL) {
+           rpmError(RPMERR_IMPORT, _("%s: base64 encode failed.\n"), fn);
            res++;
            goto bottom;
        }
index 19e3d70..7c07fe4 100644 (file)
@@ -127,6 +127,7 @@ typedef enum rpmerrCode_e {
     RPMERR_BADSIGTYPE  = _em(200), /*!< Unknown signature type */
     RPMERR_SIGGEN      = _em(201), /*!< Error generating signature */
     RPMERR_SIGVFY      = _nm(202), /*!< */
+    RPMERR_IMPORT      = _em(203), /*!< */
 
     RPMDEBUG_UNLINK    = _dm(512u+16), /*!< unlink(2) failed */
     RPMDEBUG_RMDIR     = _dm(512u+17), /*!< rmdir(2) failed */
index c7256d9..9c2dc51 100644 (file)
--- 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.49 2002/06/20 02:19:21 jbj Exp $
+# $Id: rpmrc.in,v 2.50 2002/06/28 00:35:57 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
@@ -343,7 +343,7 @@ buildarch_compat: ia64: noarch
 buildarch_compat: s390: noarch
 buildarch_compat: s390x: noarch
 
-macrofiles:    @RPMCONFIGDIR@/macros:@RPMCONFIGDIR@/%{_target}/macros:@SYSCONFIGDIR@/macros.specspo:@SYSCONFIGDIR@/macros.prelink:@SYSCONFIGDIR@/macros:@SYSCONFIGDIR@/%{_target}/macros:~/.rpmmacros
+macrofiles:    @RPMCONFIGDIR@/macros:@RPMCONFIGDIR@/%{_target}/macros:@SYSCONFIGDIR@/macros.specspo:@SYSCONFIGDIR@/macros.prelink:@SYSCONFIGDIR@/macros.up2date:@SYSCONFIGDIR@/macros:@SYSCONFIGDIR@/%{_target}/macros:~/.rpmmacros
 
 # \endverbatim
 #*/