diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-02-03 12:46:22 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-02-03 12:47:19 +0200 |
commit | 93de6ca72c2622cce7aab305c55ffc0b358b709f (patch) | |
tree | fc1cc786e7bfe3a683d33f6e260ea6a027c0fa22 /rpmkeys.c | |
parent | c25894e3b9a4cf9a1268f4e6ea947ed5ec6c1419 (diff) | |
download | librpm-tizen-93de6ca72c2622cce7aab305c55ffc0b358b709f.tar.gz librpm-tizen-93de6ca72c2622cce7aab305c55ffc0b358b709f.tar.bz2 librpm-tizen-93de6ca72c2622cce7aab305c55ffc0b358b709f.zip |
Add --test option to rpmkeys
- Allows, well, testing whether a key could be imported before actually
doing it
Diffstat (limited to 'rpmkeys.c')
-rw-r--r-- | rpmkeys.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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... */ |