Skip to content

Commit 1c84dd0

Browse files
committed
Adapt for changed pubring naming in gpg
1 parent dccf275 commit 1c84dd0

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

examples/solv/checksig.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ cleanupgpg(char *gpgdir)
2727
unlink(cmd);
2828
snprintf(cmd, sizeof(cmd), "%s/keys", gpgdir);
2929
unlink(cmd);
30+
snprintf(cmd, sizeof(cmd), "%s/pubring.kbx", gpgdir);
31+
unlink(cmd);
32+
snprintf(cmd, sizeof(cmd), "%s/pubring.kbx~", gpgdir);
33+
unlink(cmd);
34+
snprintf(cmd, sizeof(cmd), "%s/private-keys-v1.d", gpgdir);
35+
rmdir(cmd);
3036
rmdir(gpgdir);
3137
}
3238

@@ -35,7 +41,7 @@ checksig(Pool *sigpool, FILE *fp, FILE *sigfp)
3541
{
3642
char *gpgdir;
3743
char *keysfile;
38-
const char *pubkey;
44+
const char *pubkey, *pubring;
3945
char cmd[256];
4046
FILE *kfp;
4147
Solvable *s;
@@ -83,7 +89,9 @@ checksig(Pool *sigpool, FILE *fp, FILE *sigfp)
8389
lseek(fileno(fp), 0, SEEK_SET);
8490
possigfp = lseek(fileno(sigfp), 0, SEEK_CUR);
8591
lseek(fileno(sigfp), 0, SEEK_SET);
86-
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));
92+
snprintf(cmd, sizeof(cmd), "%s/pubring.kbx", gpgdir);
93+
pubring = access(cmd, R_OK) == 0 ? "pubring.kbx" : "pubring.gpg";
94+
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));
8795
fcntl(fileno(fp), F_SETFD, 0); /* clear CLOEXEC */
8896
fcntl(fileno(sigfp), F_SETFD, 0); /* clear CLOEXEC */
8997
r = system(cmd);

examples/solv/solv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,10 @@ main(int argc, char **argv)
459459
dataiterator_free(&di);
460460
if (repofilter.count)
461461
selection_filter(pool, &sel, &repofilter);
462+
if (archfilter.count)
463+
selection_filter(pool, &sel, &archfilter);
464+
if (kindfilter.count)
465+
selection_filter(pool, &sel, &kindfilter);
462466

463467
queue_init(&q);
464468
selection_solvables(pool, &sel, &q);

0 commit comments

Comments
 (0)