[pacman-dev] [PATCH] Removed installed optional dependencies from post-installation listing
Drew DeVault
sircmpwn at gmail.com
Fri Jul 12 16:33:43 EDT 2013
Per feedback on prior patch. My only concern here is that I'm not
particularly familiar with how localization works, and I don't know if
my changes will affect that.
---
src/pacman/util.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 23c4009..ab94629 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -1243,14 +1243,16 @@ void display_optdepends(alpm_pkg_t *pkg)
optdeps = alpm_pkg_get_optdepends(pkg);
- /* turn optdepends list into a text list */
+ /* turn uninstalled optdepends list into a text list */
for(i = optdeps; i; i = alpm_list_next(i)) {
alpm_depend_t *optdep = i->data;
- optstrings = alpm_list_add(optstrings, make_optstring(optdep));
+ if(alpm_db_get_pkg(alpm_get_localdb(config->handle),
optdep->name) == 0) {
+ optstrings = alpm_list_add(optstrings, make_optstring(optdep));
+ }
}
if(optstrings) {
- printf(_("Optional dependencies for %s\n"),
alpm_pkg_get_name(pkg));
+ printf(_("Remaining optional dependencies for %s:\n"),
alpm_pkg_get_name(pkg));
unsigned short cols = getcols(fileno(stdout));
list_display_linebreak(" ", optstrings, cols);
}
--
1.8.3.2
More information about the pacman-dev
mailing list