[pacman-dev] [PATCH] Put explicitly installed packages in bold during update/install/removal

Guillaume Bouchard guillaume.bouchard at liris.cnrs.fr
Fri Jan 24 06:36:14 EST 2014


Hello.

A really small change in pacman which, I hope, improves the feedback
about explicit packages on install/removal/update.

Have a nice day.

Output of git format-patch origin:

>From bd5c3aa7826c3c073cca691f0e30b5363487cd6f Mon Sep 17 00:00:00 2001
From: Guillaume Bouchard <guillaum.bouchard at gmail.com>
Date: Fri, 24 Jan 2014 12:20:16 +0100
Subject: [PATCH] Put explicitly installed packages in bold during
 update/install/removal

In extended table view, packages which are explicitly installed are
displayed as CELL_TITLE (i.e. in bold). This helps understanding why
packages are updated.

This helps the package managment workflow. During update, we can
quickly have a look at why packages are updated and easilly track and
remove the explicit packages which are not longer required. During
remove, it shows all the explicit packages which are also removed by a
cascade removal. During install, it provides a feedback on how your
action will affect the database.

This only affects "VerbosePkgLists" output. Patching the un-verbose
output appears more difficult and I think this information is only
interesting during verbose output.

Signed-off-by: Guillaume Bouchard <guillaum.bouchard at gmail.com>
---
 src/pacman/util.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/pacman/util.c b/src/pacman/util.c
index 58b0cec..a3ee5ee 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -808,7 +808,12 @@ static alpm_list_t *create_verbose_row(pm_target_t *target)
     } else {
         pm_asprintf(&str, "%s", alpm_pkg_get_name(target->remove));
     }
-    add_table_cell(&ret, str, CELL_NORMAL);
+    if(alpm_pkg_get_reason(target->remove ? target->remove :
target->install) == ALPM_PKG_REASON_EXPLICIT) {
+        /* put emphasis on the package name if it is an explicitly
installed package */
+        add_table_cell(&ret, str, CELL_TITLE);
+    } else {
+        add_table_cell(&ret, str, CELL_NORMAL);
+    }

     /* old and new versions */
     pm_asprintf(&str, "%s",
-- 
1.8.5.2

-- 
Guillaume


More information about the pacman-dev mailing list