From ec1ab1b0d55a21b223485b27bbc6fa6610f1875a Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Dec 2013 17:53:31 +0100 Subject: punani ui is in lib/punani again --- ship/lib/_punani_db | 12 ++++++++++++ ship/lib/core | 11 +++++------ ship/lib/punani | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ ship/src/punani | 46 ---------------------------------------------- 4 files changed, 65 insertions(+), 52 deletions(-) diff --git a/ship/lib/_punani_db b/ship/lib/_punani_db index 9812aff7..721b5fa2 100644 --- a/ship/lib/_punani_db +++ b/ship/lib/_punani_db @@ -13,6 +13,18 @@ _punanidb_aptget_python2=python _punanidb_pacman_python3=python _punanidb_aptget_python3=python3 +_punanidb_pacman_pip2=python2-pip +_punanidb_aptget_pip2=python-pip + +_punanidb_pacman_virtualenv=python-virtualenv +_punanidb_aptget_virtualenv=python-virtualenv + +_punanidb_pacman_gpp=g++ +_punanidb_aptget_gpp=gcc + +_punanidb_pacman_python2_dev=python2 +_punanidb_aptget_python2_dev=python-dev + _punanidb_pacman_hostname=inetutils _punanidb_aptget_hostname=hostname diff --git a/ship/lib/core b/ship/lib/core index d6e01352..6ae87fa4 100644 --- a/ship/lib/core +++ b/ship/lib/core @@ -22,12 +22,11 @@ defer(){ } esudo(){ - # becomes root with sudo powers - # unless nosudo env is set - if test "${nosudo-false}" != true && ! is_root; then - echo "we're going sudo..." >&2 - exec sudo -E "$0" "$@" - exit 23 # go to hell + # weaksauce esudo, bail out if we are not root + if ! is_root; then + # for the records: + # exec sudo -E "$0" "$@" + die "You are not root enough to run this script" 2>&1 fi } diff --git a/ship/lib/punani b/ship/lib/punani index 34307c42..ea05a4ec 100644 --- a/ship/lib/punani +++ b/ship/lib/punani @@ -48,3 +48,51 @@ _punani_yum_owner(){ rpm -qf "$1" ;} _punani_brew_install(){ brew install "$@"; } _punani_brew_remove(){ brew remove "$@";} # TODO _punani_brew_has + +punani(){ + # punani UI + _punani_usage='punani {install,remove,has,owner} PACKAGE...' + _punani_select_packer || die 'no package manager found; no punani for you!' + + ACTION="$1"; shift + + if test $# = 0; then + error 'no PACKAGE specified.' + die "usage: $_punani_usage" + fi + + for PKG; do + RES="`_punani_resolve_package $PKG`" || + die "could not resolve '$PKG'; no punani for you!" + + case "$ACTION" in + install) + if punani_has $RES; then + info "$RES already installed, skipping" + else + punani_install $RES || error "cannot install $RES with $PACKER" + fi + ;; + remove) + if ! punani_has $RES; then + info "$RES not installed, skipping" + else + punani_remove $RES || error "cannot install $RES with $PACKER" + fi + ;; + has) + if punani_has $RES; then + info "$RES is installed" + else + info "$RES is not installed" + fi + ;; + owner) + punani_owner $RES + ;; + *) + error "bad action: $ACTION" + die "usage: $_punani_usage" + esac + done +} diff --git a/ship/src/punani b/ship/src/punani index 2c956f02..ceabd667 100755 --- a/ship/src/punani +++ b/ship/src/punani @@ -1,50 +1,4 @@ #! /bin/sh #@info #@include punani -punani(){ - _punani_usage='punani {install,remove,has,owner} PACKAGE...' - _punani_select_packer || die 'no package manager found; no punani for you!' - - ACTION="$1"; shift - - if test $# = 0; then - error 'no PACKAGE specified.' - die "usage: $_punani_usage" - fi - - for PKG; do - RES="`_punani_resolve_package $PKG`" || - die "could not resolve '$PKG'; no punani for you!" - - case "$ACTION" in - install) - if punani_has $RES; then - info "$RES already installed, skipping" - else - punani_install $RES || error "cannot install $RES with $PACKER" - fi - ;; - remove) - if ! punani_has $RES; then - info "$RES not installed, skipping" - else - punani_remove $RES || error "cannot install $RES with $PACKER" - fi - ;; - has) - if punani_has $RES; then - info "$RES is installed" - else - info "$RES is not installed" - fi - ;; - owner) - punani_owner $RES - ;; - *) - error "bad action: $ACTION" - die "usage: $_punani_usage" - esac - done -} punani "$@" -- cgit v1.2.3 From afb34a1551c3bfb0bdc15d7059de8c47f31b6700 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Dec 2013 19:34:28 +0100 Subject: esudo is now weaksauce --- ship/lib/core | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ship/lib/core b/ship/lib/core index 6ae87fa4..d6e01352 100644 --- a/ship/lib/core +++ b/ship/lib/core @@ -22,11 +22,12 @@ defer(){ } esudo(){ - # weaksauce esudo, bail out if we are not root - if ! is_root; then - # for the records: - # exec sudo -E "$0" "$@" - die "You are not root enough to run this script" 2>&1 + # becomes root with sudo powers + # unless nosudo env is set + if test "${nosudo-false}" != true && ! is_root; then + echo "we're going sudo..." >&2 + exec sudo -E "$0" "$@" + exit 23 # go to hell fi } -- cgit v1.2.3 From 80225e662c571e03559199006d85e7e4c696fd64 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Dec 2013 19:52:38 +0100 Subject: re-add core/esudo as weaksauce version --- ship/lib/core | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ship/lib/core b/ship/lib/core index d6e01352..7e8ac1ef 100644 --- a/ship/lib/core +++ b/ship/lib/core @@ -22,11 +22,11 @@ defer(){ } esudo(){ - # becomes root with sudo powers - # unless nosudo env is set - if test "${nosudo-false}" != true && ! is_root; then - echo "we're going sudo..." >&2 - exec sudo -E "$0" "$@" + # weaksauce esudo (expect sudo) + if ! is_root; then + # for the record: + # exec sudo -E "$0" "$@" + error "You are not root enough for this script" exit 23 # go to hell fi } -- cgit v1.2.3