From 98c73906645364805fe512bec3856db6706f6a78 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 20 Nov 2011 01:29:10 +0100 Subject: //punani: fix bug when wget (+ set -e) GETs no OK --- punani/bin/punani | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'punani') diff --git a/punani/bin/punani b/punani/bin/punani index 7be91db4..b96539ff 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -9,7 +9,7 @@ if [ $# -ne 2 ];then fi ## find package manager -if ! :; then : # dummy, so the rest has a common format +if ! :; then : # dummy case, so the rest has a common format elif for PACKER_CMD in yum do type $PACKER_CMD 2>/dev/null 1>&2 && break; done; then @@ -36,14 +36,15 @@ else exit 23 fi - -# find the package name +## find package name PKG="$2" -RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null` +RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER_CMD/$PKG 2>/dev/null || :` if [ ! "$RESOLVED" ];then - echo "Could not resolve your requested package, bailing out!" + echo "Error 2: could not resolve '$PKG'; no punany for you!" >&2 exit 23 fi + +## dispatch case "$1" in install) exec $PACKER_CMD $INSTALL_PARAM $RESOLVED -- cgit v1.2.3