diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/rpms2solv.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/tools/rpms2solv.c b/tools/rpms2solv.c index 93ee8c3..57c3697 100644 --- a/tools/rpms2solv.c +++ b/tools/rpms2solv.c @@ -22,6 +22,7 @@ #include "repo_rpmdb.h" #ifdef ENABLE_PUBKEY #include "repo_pubkey.h" +#include "solv_xfopen.h" #endif #include "repo_solv.h" #include "common_write.h" @@ -65,7 +66,7 @@ main(int argc, char **argv) int pubkeys = 0; #endif - while ((c = getopt(argc, argv, "0kb:m:")) >= 0) + while ((c = getopt(argc, argv, "0kKb:m:")) >= 0) { switch(c) { @@ -82,6 +83,9 @@ main(int argc, char **argv) case 'k': pubkeys = 1; break; + case 'K': + pubkeys = 2; + break; #endif default: exit(1); @@ -127,15 +131,32 @@ main(int argc, char **argv) for (i = 0; i < nrpms; i++) { #ifdef ENABLE_PUBKEY - if (pubkeys) - { + if (pubkeys == 2) + { + FILE *fp = solv_xfopen(rpms[i], "r"); + if (!fp) + { + perror(rpms[i]); + res = 1; + continue; + } + if (repo_add_keyring(repo, fp, REPO_REUSE_REPODATA|REPO_NO_INTERNALIZE)) + { + fprintf(stderr, "rpms2solv: %s\n", pool_errstr(pool)); + res = 1; + } + fclose(fp); + continue; + } + if (pubkeys) + { if (repo_add_pubkey(repo, rpms[i], REPO_REUSE_REPODATA|REPO_NO_INTERNALIZE) == 0) { fprintf(stderr, "rpms2solv: %s\n", pool_errstr(pool)); res = 1; } continue; - } + } #endif if (repo_add_rpm(repo, rpms[i], REPO_REUSE_REPODATA|REPO_NO_INTERNALIZE) == 0) { |