Disambiguate failures to import with error messages.
CVS patchset: 5528
CVS date: 2002/06/28 00:35:57
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;
}
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 */
#/*! \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
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
#*/