about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-12-17 17:35:00 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2015-12-17 17:35:00 +0100
commit16529ff2fba610212b3e2dce225fb7248dcdca90 (patch)
treeb34d7f5b485a9ceef8806ed61f4ac48995a62f57
parentde21325de3c510d62e454b6ffe2620dfa52faa1f (diff)
downloadxtools-16529ff2fba610212b3e2dce225fb7248dcdca90.tar.gz
xtools-16529ff2fba610212b3e2dce225fb7248dcdca90.tar.xz
xtools-16529ff2fba610212b3e2dce225fb7248dcdca90.zip
add xpkg v0.32
-rw-r--r--README1
-rwxr-xr-xxpkg30
2 files changed, 31 insertions, 0 deletions
diff --git a/README b/README
index e0bdfe3..ed21973 100644
--- a/README
+++ b/README
@@ -28,6 +28,7 @@ https://github.com/voidlinux/xbps
   xnew PKG - create XBPS template template
   xnodev - list not installed -devel packages for installed packages
   xoptdiff [-q] [PKGS...] - show template options which differ from binary package
+  xpkg [-RamOHvV] - convenient package lister
   xpstree - display tree view of xbps-src processes
   xq [-R] PKGS... - query information about XBPS package
   xrecent [REPOURL|XBPS_ARCH] - list packages in repo ordered by build date
diff --git a/xpkg b/xpkg
new file mode 100755
index 0000000..40e6ed1
--- /dev/null
+++ b/xpkg
@@ -0,0 +1,30 @@
+#!/bin/sh
+# xpkg [-RamOHvV] - convenient package lister
+
+flags=
+filter0='/^.[^i*].\? /d'
+filter1='s/^...\? //'
+filter2='s/-[^- ]* .*//'
+mode="--search="
+
+while getopts R:vVmOHa flag; do
+	case "$flag" in
+		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 [-RamOHvV]
+  -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
+  -v       show version numbers
+  -V       show version numbers and description
+" $0 1>&2
+		exit 1;;
+	esac
+done
+
+xbps-query $flags $mode | sed "$filter0;$filter1;$filter2"