Establish mechanism for up2date to reconfigure rpmlib.

Disambiguate failures to import with error messages.

CVS patchset: 5528
CVS date: 2002/06/28 00:35:57
This commit is contained in:
jbj 2002-06-28 00:35:57 +00:00
parent 446dfecf43
commit 4252cddc29
3 changed files with 15 additions and 6 deletions

View 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;
}

View 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 */

View File

@ -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
#*/