[pacman-dev] [PATCH 1/2] Make folders appear in bold when listing files owned by a package.

Bill Kolokithas freestyler7 at gmail.com
Wed Nov 6 20:07:57 EST 2013


It's a trivial patch to make folders stand out more when -l is passed on Query without the -q(uiet) flag.
Right now is using the same color as the pkgname (config->colstr.title), which is bold.

Signed-off-by: Bill Kolokithas <kolokithas.b at gmail.com>
---
 src/pacman/package.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/pacman/package.c b/src/pacman/package.c
index 78bfb50..1485889 100644
--- a/src/pacman/package.c
+++ b/src/pacman/package.c
@@ -322,6 +322,11 @@ void dump_pkg_files(alpm_pkg_t *pkg, int quiet)
 		 */
 		if(!quiet) {
 			printf("%s%s%s ", config->colstr.title, pkgname, config->colstr.nocolor);
+			/* Make folders appear in bold */
+			if (file->name[strlen(file->name) - 1] == '/') {
+				printf("%s%s%s%s\n", config->colstr.title, root, file->name, config->colstr.nocolor);
+				continue;
+			}
 		}
 		printf("%s%s\n", root, file->name);
 	}
-- 
1.8.4.2



More information about the pacman-dev mailing list