]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Adapt for changed pubring naming in gpg
authorMichael Schroeder <mls@suse.de>
Wed, 18 Jul 2018 19:52:17 +0000 (21:52 +0200)
committerMichael Schroeder <mls@suse.de>
Wed, 18 Jul 2018 19:52:17 +0000 (21:52 +0200)
examples/solv/checksig.c
examples/solv/solv.c

index ff60c66ccd0931b980e7d7cb4f32634267a20b89..44603d3637deedc2cd3e1c1077d72ad8cb8a1f48 100644 (file)
@@ -27,6 +27,12 @@ cleanupgpg(char *gpgdir)
   unlink(cmd);
   snprintf(cmd, sizeof(cmd), "%s/keys", gpgdir);
   unlink(cmd);
+  snprintf(cmd, sizeof(cmd), "%s/pubring.kbx", gpgdir);
+  unlink(cmd);
+  snprintf(cmd, sizeof(cmd), "%s/pubring.kbx~", gpgdir);
+  unlink(cmd);
+  snprintf(cmd, sizeof(cmd), "%s/private-keys-v1.d", gpgdir);
+  rmdir(cmd);
   rmdir(gpgdir);
 }
 
@@ -35,7 +41,7 @@ checksig(Pool *sigpool, FILE *fp, FILE *sigfp)
 {
   char *gpgdir;
   char *keysfile;
-  const char *pubkey;
+  const char *pubkey, *pubring;
   char cmd[256];
   FILE *kfp;
   Solvable *s;
@@ -83,7 +89,9 @@ checksig(Pool *sigpool, FILE *fp, FILE *sigfp)
   lseek(fileno(fp), 0, SEEK_SET);
   possigfp = lseek(fileno(sigfp), 0, SEEK_CUR);
   lseek(fileno(sigfp), 0, SEEK_SET);
-  snprintf(cmd, sizeof(cmd), "gpgv -q --homedir %s --keyring %s/pubring.gpg /dev/fd/%d /dev/fd/%d >/dev/null 2>&1", gpgdir, gpgdir, fileno(sigfp), fileno(fp));
+  snprintf(cmd, sizeof(cmd), "%s/pubring.kbx", gpgdir);
+  pubring = access(cmd, R_OK) == 0 ? "pubring.kbx" : "pubring.gpg";
+  snprintf(cmd, sizeof(cmd), "gpgv -q --homedir %s --keyring %s/%s /dev/fd/%d /dev/fd/%d >/dev/null 2>&1", gpgdir, gpgdir, pubring, fileno(sigfp), fileno(fp));
   fcntl(fileno(fp), F_SETFD, 0);       /* clear CLOEXEC */
   fcntl(fileno(sigfp), F_SETFD, 0);    /* clear CLOEXEC */
   r = system(cmd);
index 627c248017bfea7ba21de4c154ccad77b14cf63a..42ab751bf9f3be7a554bdc39c4fb980806c60ce9 100644 (file)
@@ -459,6 +459,10 @@ main(int argc, char **argv)
       dataiterator_free(&di);
       if (repofilter.count)
        selection_filter(pool, &sel, &repofilter);
+      if (archfilter.count)
+       selection_filter(pool, &sel, &archfilter);
+      if (kindfilter.count)
+       selection_filter(pool, &sel, &kindfilter);
        
       queue_init(&q);
       selection_solvables(pool, &sel, &q);