diff options
author | classabbyamp <void@placeviolette.net> | 2023-07-28 02:29:06 -0400 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2023-07-31 22:16:41 +0200 |
commit | 2ca7afbfc5e003bc9812f32c3129a580706bb7a3 (patch) | |
tree | c1c7ffcffbf32d71c1dd68f519ee417b8a3bd7cb /xnews | |
parent | 6982e53238234099420b9767abcc9d73254573f8 (diff) | |
download | xtools-2ca7afbfc5e003bc9812f32c3129a580706bb7a3.tar.gz xtools-2ca7afbfc5e003bc9812f32c3129a580706bb7a3.tar.xz xtools-2ca7afbfc5e003bc9812f32c3129a580706bb7a3.zip |
new tool: xnews
employs a mechanism similar to xilog to get packages in installed order, then gets the install message for each in that order. can be filtered by a pattern in the same method as xilog. maybe there's a bit more efficient way to do this than a subshell + loop + file i/o, but I don't see it
Diffstat (limited to 'xnews')
-rwxr-xr-x | xnews | 14 |
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 |