verify: report only bad packages with -q

fixes #1010
cute-signatures
Timo Teräs 2012-02-24 09:00:27 +02:00
parent e145738ace
commit 426954fc7b
1 changed files with 7 additions and 2 deletions

View File

@ -28,7 +28,10 @@ static int verify_main(void *ctx, struct apk_database *db, int argc, char **argv
is = apk_bstream_gunzip_mpart(apk_bstream_from_file(AT_FDCWD, argv[i]),
apk_sign_ctx_mpart_cb, &sctx);
if (is == NULL) {
apk_error("%s: %s", strerror(errno), argv[i]);
if (apk_verbosity >= 1)
apk_error("%s: %s", argv[i], strerror(errno));
else
printf("%s\n", argv[i]);
apk_sign_ctx_free(&sctx);
rc++;
continue;
@ -39,7 +42,9 @@ static int verify_main(void *ctx, struct apk_database *db, int argc, char **argv
if (apk_verbosity >= 1)
apk_message("%s: %d - %s", argv[i], r,
ok ? "OK" :
sctx.data_verified ? "UNTRUSTED" : "FAILED");
!sctx.control_verified ? "UNTRUSTED" : "FAILED");
else if (!ok)
printf("%s\n", argv[i]);
if (!ok)
rc++;
apk_sign_ctx_free(&sctx);