summaryrefslogtreecommitdiff
path: root/tools/rpmdb2solv.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2013-04-15 17:57:43 +0200
committerMichael Schroeder <mls@suse.de>2013-04-15 17:57:43 +0200
commit83145da7966e63a78a5065ec2c186d182488e494 (patch)
treea8294b0ce66efe7e8c08074e2a03ddfe39307910 /tools/rpmdb2solv.c
parent691ceb7b85618205fe6de61f712dd6ab6faf4088 (diff)
downloadlibsolv-83145da7966e63a78a5065ec2c186d182488e494.tar.gz
libsolv-83145da7966e63a78a5065ec2c186d182488e494.tar.bz2
libsolv-83145da7966e63a78a5065ec2c186d182488e494.zip
split ugly pubkey handling into separate repo_rpmdb_pubkey.c
Diffstat (limited to 'tools/rpmdb2solv.c')
-rw-r--r--tools/rpmdb2solv.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/tools/rpmdb2solv.c b/tools/rpmdb2solv.c
index 0d00331..1a63755 100644
--- a/tools/rpmdb2solv.c
+++ b/tools/rpmdb2solv.c
@@ -25,6 +25,9 @@
#include "pool.h"
#include "repo.h"
#include "repo_rpmdb.h"
+#ifdef ENABLE_RPMDB_PUBKEY
+#include "repo_rpmdb_pubkey.h"
+#endif
#include "repo_products.h"
#include "repo_solv.h"
#include "common_write.h"
@@ -61,12 +64,15 @@ main(int argc, char **argv)
char *proddir = 0;
#endif
char *outfile = 0;
+#ifdef ENABLE_RPMDB_PUBKEY
+ int pubkeys = 0;
+#endif
/*
* parse arguments
*/
- while ((c = getopt(argc, argv, "Phnxb:r:p:o:")) >= 0)
+ while ((c = getopt(argc, argv, "Phnkxb:r:p:o:")) >= 0)
switch (c)
{
case 'h':
@@ -95,6 +101,12 @@ main(int argc, char **argv)
case 'o':
outfile = optarg;
break;
+#ifdef ENABLE_RPMDB_PUBKEY
+ case 'k':
+ nopacks = 1;
+ pubkeys = 1;
+ break;
+#endif
default:
usage(1);
}
@@ -160,6 +172,16 @@ main(int argc, char **argv)
exit(1);
}
}
+#ifdef ENABLE_RPMDB_PUBKEY
+ if (pubkeys)
+ {
+ if (repo_add_rpmdb_pubkeys(repo, REPO_USE_ROOTDIR | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE))
+ {
+ fprintf(stderr, "rpmdb2solv: %s\n", pool_errstr(pool));
+ exit(1);
+ }
+ }
+#endif
#ifdef ENABLE_SUSEREPO
if (proddir && *proddir)