[PATCH v2 2/3] query: print extended data when extra info is requested

Andrew Gregory andrew.gregory.8 at gmail.com
Sat Mar 12 22:52:52 UTC 2022


Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
---
 src/pacman/package.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/pacman/package.c b/src/pacman/package.c
index 61664f7d6..f2b6fa199 100644
--- a/src/pacman/package.c
+++ b/src/pacman/package.c
@@ -351,6 +351,19 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
 		dump_pkg_backups(pkg, cols);
 	}
 
+	if(extra) {
+		alpm_list_t *text = NULL, *pdata = alpm_pkg_get_xdata(pkg);
+		while(pdata) {
+			alpm_pkg_xdata_t *pd = pdata->data;
+			char *formatted = NULL;
+			pm_asprintf(&formatted, "%s=%s", pd->name, pd->value);
+			text = alpm_list_add(text, formatted);
+			pdata = pdata->next;
+		}
+		list_display_linebreak("Extended Data   :", text, cols);
+		FREELIST(text);
+	}
+
 	/* final newline to separate packages */
 	printf("\n");
 
-- 
2.35.1



More information about the pacman-dev mailing list