summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2012-02-18 16:31:37 +1000
committerDan McGee <dan@archlinux.org>2012-03-08 17:58:04 -0600
commit5c404268d965d9ca012e4819ac0c2f289a4c768c (patch)
treeec83d7e1d7c88886fc4cf8438ba42ccb9627c8e2 /src
parentbc311a24ce536fbf30cc2356a62b08a6c0938ea9 (diff)
downloadpacman-5c404268d965d9ca012e4819ac0c2f289a4c768c.tar.xz
Add information on how an installed package was validated
When installing a package, store information on which validation method was used and output this on "pacman -Qi" operations. e.g. Validated By : SHA256 Sum Possible values are Unknown, None, MD5 Sum, SHA256 Sum, Signature. Dan: just a few very minor tweaks. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/package.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/pacman/package.c b/src/pacman/package.c
index 54c035c3..6e4901d1 100644
--- a/src/pacman/package.c
+++ b/src/pacman/package.c
@@ -77,6 +77,7 @@ static void optdeplist_display(const char *title,
void dump_pkg_full(alpm_pkg_t *pkg, int extra)
{
const char *reason;
+ alpm_list_t *validation = NULL;
time_t bdate, idate;
char bdatestr[50] = "", idatestr[50] = "";
const char *label;
@@ -108,6 +109,27 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
break;
}
+ if(from == PKG_FROM_LOCALDB) {
+ alpm_pkgvalidation_t v = alpm_pkg_get_validation(pkg);
+ if(v) {
+ if(v & ALPM_PKG_VALIDATION_NONE) {
+ validation = alpm_list_add(validation, _("None"));
+ } else {
+ if(v & ALPM_PKG_VALIDATION_MD5SUM) {
+ validation = alpm_list_add(validation, _("MD5 Sum"));
+ }
+ if(v & ALPM_PKG_VALIDATION_SHA256SUM) {
+ validation = alpm_list_add(validation, _("SHA256 Sum"));
+ }
+ if(v & ALPM_PKG_VALIDATION_SIGNATURE) {
+ validation = alpm_list_add(validation, _("Signature"));
+ }
+ }
+ } else {
+ validation = alpm_list_add(validation, _("Unknown"));
+ }
+ }
+
if(extra || from == PKG_FROM_LOCALDB) {
/* compute this here so we don't get a pause in the middle of output */
requiredby = alpm_pkg_compute_requiredby(pkg);
@@ -173,6 +195,9 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
}
alpm_siglist_cleanup(&siglist);
}
+ if(from == PKG_FROM_LOCALDB) {
+ list_display(_("Validated By :"), validation);
+ }
string_display(_("Description :"), alpm_pkg_get_desc(pkg));
/* Print additional package info if info flag passed more than once */
@@ -184,6 +209,7 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
printf("\n");
FREELIST(requiredby);
+ alpm_list_free(validation);
}
static const char *get_backup_file_status(const char *root,