blob: 8dac78b29f9f47c81d7ca4cd76de9d292cd860d3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/bin/bash
# xpkg [-rRamOHDLvV] - convenient package lister
flags=
filter0='/^.[^i*].\? /d'
filter1='s/^...\? //'
filter2='s/-[^- ]* .*//'
mode="--search="
while getopts R:r:vVmOHDLa flag; do
case "$flag" in
D) exec comm -23 <(xpkg | sort) <(xpkg -a | sort);;
L) mode="--regex -p repository -s /"; filter0='/:\/\//d';;
r) flags="$flags -r $OPTARG";;
R) flags="$flags -i --repository=$OPTARG";;
m|O|H) mode="-$flag"; filter0=; filter1=; filter2='s/-[^-]*$//';;
a) flags="$flags -R"; filter0=;;
v) filter2='s/:\? .*//';;
V) filter2=;;
?) printf "Usage: %s [-rRamOHvV]
-r ROOTDIR specifies a full path for the target root directory
-R REPO consider only packages from REPO
-a list all packages (default: only installed)
-m list manual packages
-O list orphaned packages
-H list packages on hold
-D list installed packages not in repo
-L list installed packages not from remote repos
-v show version numbers
-V show version numbers and description
" $0 >&2
exit 1;;
esac
done
xbps-query $flags $mode | sed "$filter0;$filter1;$filter2"
|