aboutsummaryrefslogtreecommitdiff
path: root/old/lspkg.old
diff options
context:
space:
mode:
Diffstat (limited to 'old/lspkg.old')
-rwxr-xr-xold/lspkg.old31
1 files changed, 31 insertions, 0 deletions
diff --git a/old/lspkg.old b/old/lspkg.old
new file mode 100755
index 0000000..fe28a65
--- /dev/null
+++ b/old/lspkg.old
@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+# lspkg
+# feedback: rhatto at riseup.net | gpl
+#
+# todo:
+#
+# -r, --remove: remove matching packages
+# -d, --description: show matching packages' descriptions
+# -s, --search: search a file under the matching packages
+# -p, --print: print the contents of a package file
+#
+
+function usage {
+ echo usage: $0 [-v|-d|-s|-p expression]
+ exit 1
+}
+
+if [[ "$1" == "-v" ]]; then
+ if [[ ! -z "$2" ]]; then
+ less $(ls /var/log/packages/$2*)
+ else
+ usage
+ fi
+elif [[ $1 = -p ]]; then
+ if [ -f $2 ]; then
+ tar ztvf $2
+ fi
+else
+ ls /var/log/packages/$1*
+fi