add --trust

This commit is contained in:
Paul Nasrat 2006-04-25 21:21:57 +00:00
parent 4863930fba
commit ef115724c8
2 changed files with 76 additions and 1 deletions

70
rpm-4.4.2-trust.patch Normal file
View File

@ -0,0 +1,70 @@
--- rpm-4.4.2/lib/poptQV.c.trust 2006-04-24 17:42:20.000000000 -0400
+++ rpm-4.4.2/lib/poptQV.c 2006-04-24 17:44:05.000000000 -0400
@@ -31,6 +31,10 @@
#define POPT_HDLIST -1011
#define POPT_FTSWALK -1012
+/* -1025 thrugh -1032 are common in rpmcli.h. */
+#define POPT_TARGETPLATFORM -1036
+#define POPT_TRUST -1037
+
/* ========== Query/Verify/Signature source args */
static void rpmQVSourceArgCallback( /*@unused@*/ poptContext con,
/*@unused@*/ enum poptCallbackReason reason,
@@ -87,6 +91,15 @@
qva->qva_source |= RPMQV_DBOFFSET;
qva->qva_sourceCount++;
break;
+
+ /* XXX perhaps POPT_ARG_INT instead of callback. */
+ case POPT_TRUST:
+ { char * end = NULL;
+ long trust = (int) strtol(arg, &end, 0);
+ /* XXX range checks on trust. */
+ /* XXX if (end && *end) argerror(_("non-numeric trust metric.")); */
+ qva->trust = trust;
+ } break;
}
}
@@ -376,14 +389,6 @@
N_("don't verify package signature(s)"), NULL },
#endif
-/** @todo Add --nogpg/--nopgp aliases to rpmpopt, eliminate. */
- { "nogpg", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
- &rpmQVKArgs.qva_flags, VERIFY_SIGNATURE,
- N_("don't verify GPG V3 DSA signature(s)"), NULL },
- { "nopgp", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
- &rpmQVKArgs.qva_flags, VERIFY_SIGNATURE,
- N_("don't verify PGP V3 RSA/MD5 signature(s)"), NULL },
-
POPT_TABLEEND
};
@@ -408,6 +413,15 @@
N_("sign package(s) (identical to --addsign)"), NULL },
{ "sign", '\0', POPT_ARGFLAG_DOC_HIDDEN, &rpmQVKArgs.sign, 0,
N_("generate signature"), NULL },
+ /* XXX perhaps POPT_ARG_INT instead of callback. */
+ { "trust", '\0', POPT_ARG_STRING|POPT_ARGFLAG_DOC_HIDDEN, 0, POPT_TRUST,
+ N_("specify trust metric"), "TRUST" },
+ { "trusted", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN,
+ &rpmQVKArgs.trust, 1,
+ N_("set ultimate trust when importing pubkey(s)"), NULL },
+ { "untrusted", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN,
+ &rpmQVKArgs.trust, -1,
+ N_("unset ultimate trust when importing pubkey(s)"), NULL },
{ "nodigest", '\0', POPT_BIT_SET, &rpmQVKArgs.qva_flags, VERIFY_DIGEST,
N_("don't verify package digest(s)"), NULL },
--- rpm-4.4.2/lib/rpmcli.h.trust 2006-04-24 17:42:28.000000000 -0400
+++ rpm-4.4.2/lib/rpmcli.h 2006-04-24 17:42:33.000000000 -0400
@@ -280,6 +280,7 @@
/*@only@*/ /*@null@*/
const char * qva_queryFormat;/*!< Format for headerSprintf(). */
int sign; /*!< Is a passphrase needed? */
+ int trust; /*!< Trust metric when importing pubkeys. */
/*@observer@*/
const char * passPhrase; /*!< Pass phrase. */
/*@observer@*/ /*@null@*/

View File

@ -20,7 +20,7 @@ Name: rpm
%define version 4.4.2
Version: %{version}
%{expand: %%define rpm_version %{version}}
Release: 18
Release: 19
Group: System Environment/Base
Source: ftp://wraptastic.org/pub/rpm-4.4.x/rpm-%{rpm_version}.tar.gz
Source1: mono-find-provides
@ -49,6 +49,7 @@ Patch20: rpm-4.4.2-netsharedpath.patch
Patch21: rpm-4.4.2-userlock.patch
Patch22: rpm-4.4.2-vercmp.patch
Patch23: rpm-4.4.2-doxy.patch
Patch24: rpm-4.4.2-trust.patch
License: GPL
Conflicts: patch < 2.5
%ifos linux
@ -182,6 +183,7 @@ shell-like rules.
%patch21 -p1 -b .userlock
%patch22 -p1 -b .vercmp
%patch23 -p1 -b .doxy
%patch24 -p1 -b .trust
%build
@ -574,6 +576,9 @@ exit 0
%{__includedir}/popt.h
%changelog
* Tue Apr 25 2006 Paul Nasrat <pnasrat@redhat.com> - 4.4.2-19
- Add --trusted stubs from upstream
* Wed Apr 12 2006 Paul Nasrat <pnasrat@redhat.com> - 4.4.2-18
- Resurrect doxygen (#187714)