From fa0b7b6f8e45982f1e2317c386ef0cf49ee840c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Tue, 27 Dec 2011 20:07:08 -0600 Subject: libremakepkg: fixed conditionals toru: -p exit with 1 status if not found --- toru | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'toru') diff --git a/toru b/toru index a054ddf..5867bfe 100755 --- a/toru +++ b/toru @@ -280,11 +280,14 @@ where_is() { [ -n "${_path}" ] && break done + [ -z "$_path" ] && return 1 + echo ${_path} } # TODO: clean usage instructions function usage { + echo "" echo "$0 [options] repo1 ... repon" echo "" echo "Make a db containing PKGBUILD metadata." @@ -295,6 +298,7 @@ function usage { echo "-q : quiet" echo "-f : rebuild the db even if it is updated" echo "-p : return the path for pkgname" + echo "" exit 1 } @@ -306,13 +310,14 @@ force=false while getopts 'haqfpum' arg; do case $arg in h) usage; exit 0 ;; -# a) update_all_repos ;; +# TODO: Update all repos on $REPOS array +# a) update_all_repos ;; q) quiet=true ;; f) force=true ;; u) commands+=(update);; p) shift $(( OPTIND - 1 )) where_is "$1" - exit 0;; + exit $?;; m) commands+=(missing);; esac -- cgit v1.2.2