summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-12-27 20:07:08 -0600
committerJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-12-27 20:07:08 -0600
commitfa0b7b6f8e45982f1e2317c386ef0cf49ee840c7 (patch)
tree2573cfa613140509351277a59d3f30eb98107d82
parentc4eecdae6106541bfd94c17302c7c55b20754adb (diff)
libremakepkg: fixed conditionals
toru: -p exit with 1 status if not found
-rwxr-xr-xlibremakepkg7
-rwxr-xr-xtoru9
2 files changed, 11 insertions, 5 deletions
diff --git a/libremakepkg b/libremakepkg
index 7885f1e..9af487f 100755
--- a/libremakepkg
+++ b/libremakepkg
@@ -53,6 +53,7 @@ MAKEPKG_ARGS=""
function usage {
+ echo ''
echo 'cd to a dir containing a PKGBUILD and run:'
echo '$0 [options] [-- makechrootpkg args] [-- makepkg args]'
echo 'This script will build your package on a chroot.'
@@ -95,7 +96,7 @@ if [ ! -e PKGBUILD ]; then # Check if we are actually on a build directory. Do
fi
msg "Checking PKGBUILD for non-free issues"
-if (( CHECKNONFREE )); then
+if "$CHECKNONFREE"; then
if ! pkgbuild-check-nonfree; then
if [[ $? -eq 15 ]]; then # other errors mean fail, not nonfree
@@ -107,11 +108,11 @@ if (( CHECKNONFREE )); then
fi
fi
-if (( CLEANFIRST )); then
+if "$CLEANFIRST"; then
librechroot -c "$LIBRECHROOT_ARGS" "$CHROOT"
fi
-if (( UPDATEFIRST )); then
+if "$UPDATEFIRST"; then
librechroot -u "$LIBRECHROOT_ARGS" "$CHROOT"
fi
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 <pkgname>: 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