about summary refs log tree commit diff
path: root/xnews
diff options
context:
space:
mode:
Diffstat (limited to 'xnews')
-rwxr-xr-xxnews14
1 files changed, 14 insertions, 0 deletions
diff --git a/xnews b/xnews
new file mode 100755
index 0000000..74e2fe8
--- /dev/null
+++ b/xnews
@@ -0,0 +1,14 @@
+#!/bin/sh
+# xnews [PATTERN] - list news messages for recently installed packages
+#
+if type less >/dev/null; then
+	: "${PAGER:=less}"
+else
+	: "${PAGER:=cat}"
+fi
+
+for pkg in $(xbps-query -p install-date -s '' |
+	sort -t: -k2 -r | cut -d: -f1 | grep -e "${1:-.}"); do
+	xbps-query -p install-msg "$pkg" |
+		awk -v pkg="$pkg" 'NR == 1 { print pkg ":" } { print "  " $0 }'
+done | $PAGER