1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

change gpg import message to resemble gpg --list-keys

Dan: const pointers, don't worry about bitfields.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Florian Pritz 2011-10-18 22:46:50 +02:00 committed by Dan McGee
parent 5ba8b83b8b
commit 2f96067fe7
3 changed files with 10 additions and 2 deletions

View File

@ -226,6 +226,8 @@ typedef struct _alpm_pgpkey_t {
char *email; char *email;
alpm_time_t created; alpm_time_t created;
alpm_time_t expires; alpm_time_t expires;
unsigned int length;
unsigned int revoked;
} alpm_pgpkey_t; } alpm_pgpkey_t;
/** Signature result. Contains the key, status, and validity of a given /** Signature result. Contains the key, status, and validity of a given

View File

@ -270,6 +270,8 @@ static int key_search(alpm_handle_t *handle, const char *fpr,
pgpkey->email = key->uids->email; pgpkey->email = key->uids->email;
pgpkey->created = key->subkeys->timestamp; pgpkey->created = key->subkeys->timestamp;
pgpkey->expires = key->subkeys->expires; pgpkey->expires = key->subkeys->expires;
pgpkey->length = key->subkeys->length;
pgpkey->revoked = key->subkeys->revoked;
ret = 1; ret = 1;
error: error:

View File

@ -347,10 +347,14 @@ void cb_question(alpm_question_t event, void *data1, void *data2,
{ {
alpm_pgpkey_t *key = data1; alpm_pgpkey_t *key = data1;
char created[12]; char created[12];
const char *revoked = "";
time_t time = (time_t)key->created; time_t time = (time_t)key->created;
strftime(created, 12, "%Y-%m-%d", localtime(&time)); strftime(created, 12, "%Y-%m-%d", localtime(&time));
*response = yesno(_(":: Import PGP key %s, \"%s\", created %s?"), if (key->revoked) {
key->fingerprint, key->uid, created); revoked = " (revoked)";
}
*response = yesno(_(":: Import PGP key %d/%s, \"%s\", created: %s%s?"),
key->length, key->fingerprint, key->uid, created, revoked);
} }
break; break;
} }