summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-02-03 12:46:22 +0200
committerPanu Matilainen <pmatilai@redhat.com>2012-02-03 12:47:19 +0200
commit93de6ca72c2622cce7aab305c55ffc0b358b709f (patch)
treefc1cc786e7bfe3a683d33f6e260ea6a027c0fa22
parentc25894e3b9a4cf9a1268f4e6ea947ed5ec6c1419 (diff)
downloadrpm-93de6ca72c2622cce7aab305c55ffc0b358b709f.tar.gz
rpm-93de6ca72c2622cce7aab305c55ffc0b358b709f.tar.bz2
rpm-93de6ca72c2622cce7aab305c55ffc0b358b709f.zip
Add --test option to rpmkeys
- Allows, well, testing whether a key could be imported before actually doing it
-rw-r--r--rpmkeys.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/rpmkeys.c b/rpmkeys.c
index b91bb276b..fa4e4d865 100644
--- a/rpmkeys.c
+++ b/rpmkeys.c
@@ -17,12 +17,15 @@ enum modes {
};
static int mode = 0;
+static int test = 0;
static struct poptOption keyOptsTable[] = {
{ "checksig", 'K', (POPT_ARG_VAL|POPT_ARGFLAG_OR), &mode, MODE_CHECKSIG,
N_("verify package signature(s)"), NULL },
{ "import", '\0', (POPT_ARG_VAL|POPT_ARGFLAG_OR), &mode, MODE_IMPORTKEY,
N_("import an armored public key"), NULL },
+ { "test", '\0', POPT_ARG_NONE, &test, 0,
+ N_("don't import, but tell if it would work or not"), NULL },
#if 0
{ "delete-key", '\0', (POPT_ARG_VAL|POPT_ARGFLAG_OR), &mode, MODE_DELKEY,
N_("list keys from RPM keyring"), NULL },
@@ -67,6 +70,8 @@ int main(int argc, char *argv[])
ec = rpmcliVerifySignatures(ts, args);
break;
case MODE_IMPORTKEY:
+ if (test)
+ rpmtsSetFlags(ts, (rpmtsFlags(ts)|RPMTRANS_FLAG_TEST));
ec = rpmcliImportPubkeys(ts, args);
break;
/* XXX TODO: actually implement these... */