From bd3990b81cbd1df9b5b5164ef32e44158288e95f Mon Sep 17 00:00:00 2001 From: jbj Date: Mon, 22 Mar 1999 17:31:53 +0000 Subject: fix: don't add header if signature generation failed (Carlo Wood). CVS patchset: 2909 CVS date: 1999/03/22 17:31:53 --- rpm.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'rpm.c') diff --git a/rpm.c b/rpm.c index a9dcbd727..8d08dd8e4 100755 --- a/rpm.c +++ b/rpm.c @@ -1100,7 +1100,7 @@ int main(int argc, char ** argv) { if (errors) return errors; if (poptPeekArg(optCon)) { - switch (sigTag = rpmLookupSignatureType()) { + switch (sigTag = rpmLookupSignatureType(RPMLOOKUPSIG_QUERY)) { case 0: break; case RPMSIGTAG_GPG: @@ -1111,7 +1111,7 @@ int main(int argc, char ** argv) { fprintf(stderr, _("pgp not found: ")); if (rpmDetectPGPVersion(RPMSIGTAG_PGP5)) { fprintf(stderr, - _("Use `signature: pgp5' instead of `signature: pgp' in spec file.\n")); + _("Use `%%_signature pgp5' instead of `%%_signature pgp' in macro file.\n")); exit(EXIT_FAILURE); } /* Fall through to default: */ @@ -1121,7 +1121,7 @@ int main(int argc, char ** argv) { fprintf(stderr, _("pgp version 5 not found: ")); if (rpmDetectPGPVersion(RPMSIGTAG_PGP)) { fprintf(stderr, - _("Use `signature: pgp' instead of `signature: pgp5' in spec file.\n")); + _("Use `%%_signature pgp' instead of `%%_signature pgp5' in macro file.\n")); exit(EXIT_FAILURE); } /* Fall through to default: */ @@ -1137,16 +1137,19 @@ int main(int argc, char ** argv) { } /* Fall through */ default: - fprintf(stderr, _("Invalid signature spec in rc file.\n")); + fprintf(stderr, + _("Invalid %%_signature spec in macro file.\n")); exit(EXIT_FAILURE); } } } else { argerror(_("--sign may only be used during package building")); } - } else { - /* Override any rpmrc setting */ - addMacro(&globalMacroContext, "_signature", NULL, "none", RMIL_CMDLINE); + } + else + { + /* Make rpmLookupSignatureType() return 0 ("none") from now on */ + rpmLookupSignatureType(RPMLOOKUPSIG_DISABLE); } if (pipeOutput) { -- cgit v1.2.3