summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ship/lib/punani6
-rwxr-xr-xship/src/punani5
2 files changed, 10 insertions, 1 deletions
diff --git a/ship/lib/punani b/ship/lib/punani
index 264d1daf..33a62444 100644
--- a/ship/lib/punani
+++ b/ship/lib/punani
@@ -6,6 +6,11 @@ punani_has() {
eval "_punani_${PACKER}_has \"\$1\""
}
+## usage: punani_owner PACKAGE
+punani_owner() {
+ eval "_punani_${PACKER}_owner \"\$1\""
+}
+
## usage: punani_install PACKAGE
punani_install() {
eval "_punani_${PACKER}_install \"\$1\""
@@ -31,6 +36,7 @@ _punani_known_packers='pacman apt-get yum brew'
_punani_pacman_install(){ pacman --noconfirm -S --needed "$@" ;}
_punani_pacman_remove(){ pacman -Rcs "$@" ;}
_punani_pacman_has(){ pacman -Q "$1" >/dev/null;}
+_punani_pacman_owner() { pacman -Qo "$1"; }
_punani_aptget_install(){ apt-get -y install "$@" ;}
_punani_aptget_remove(){ apt-get -y remove "$@" ;}
_punani_aptget_has() { dpkg -s "$1" | grep -q "Status: install";}
diff --git a/ship/src/punani b/ship/src/punani
index 61043bc0..2c956f02 100755
--- a/ship/src/punani
+++ b/ship/src/punani
@@ -2,7 +2,7 @@
#@info
#@include punani
punani(){
- _punani_usage='punani {install,remove,has} PACKAGE...'
+ _punani_usage='punani {install,remove,has,owner} PACKAGE...'
_punani_select_packer || die 'no package manager found; no punani for you!'
ACTION="$1"; shift
@@ -38,6 +38,9 @@ punani(){
info "$RES is not installed"
fi
;;
+ owner)
+ punani_owner $RES
+ ;;
*)
error "bad action: $ACTION"
die "usage: $_punani_usage"