about summary refs log tree commit diff
path: root/xnews
blob: 74e2fe8252a922b534d586bd8c7bfbedf622fc48 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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