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