X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=functions.sh;h=8ef825431168896f839b84c23eaf89c1f46589ef;hb=5d2f462427acf38aafc0e2d3a203ce0197b3eafc;hp=cd0bdee3178f1ab41a8c52e0d337cb0318d4e9ec;hpb=ea01a241287a74a8a5b3576f6fdda3c801786cb7;p=carnet-upgrade.git diff --git a/functions.sh b/functions.sh index cd0bdee..8ef8254 100644 --- a/functions.sh +++ b/functions.sh @@ -232,7 +232,7 @@ cp_check_and_sed() { fi ret=0 done - [ "$ret" -eq 2 -a "$grepret" ] && ret=1 || true + [ "$ret" -eq 2 -a "$grepret" ] && ret=1 return $ret } @@ -261,8 +261,12 @@ cp_mail () { quiet=1 shift fi - [ -n "$1" ] && pkg="$1" # barf if no package - [ -n "$2" ] && version=" $2" || true + if [ -n "$1" ]; then + pkg="$1" + else + return 1 # must have at least the package name as argument + fi + [ -n "$2" ] && version=" $2" if [ "$(echo $CP_NOTICE|wc -w)" -gt 0 ]; then [ -n "$quiet" ] || echo "Mailing upgrade output to root." CP_NOTICE="From: $pkg postinst script