Add --verbose and --resume options

This commit is contained in:
Sam Stephenson 2011-10-17 18:02:22 -05:00
parent b5cc9ffb8b
commit 97a48518e5

View file

@ -23,12 +23,38 @@ abs_dirname() {
cd "$cwd" cd "$cwd"
} }
usage() {
echo "usage: ruby-package [-v | --verbose] [--resume] DEFINITION"
exit 1
}
bin_root="$(abs_dirname "$0")" bin_root="$(abs_dirname "$0")"
verbose=""
resume=""
while :; do
case "$1" in
"-v" | "--verbose" )
verbose="-v"
shift
;;
"--resume" )
resume=1
shift
;;
"-"* )
usage
;;
* )
break
;;
esac
done
definition="$1" definition="$1"
if [ -z "$definition" ]; then if [ -z "$definition" ]; then
echo "usage: ruby-package DEFINITION" usage
fi fi
package="${definition##*/}" package="${definition##*/}"
@ -36,7 +62,10 @@ prefix="/tmp/ruby-build/--------------------------------------------------------
package_dir="${package}.$(package_platform)" package_dir="${package}.$(package_platform)"
"${bin_root}/ruby-build" -v "$definition" "$prefix" if [ -z "$resume" ]; then
"${bin_root}/ruby-build" $verbose "$definition" "$prefix"
fi
cwd="$(pwd)" cwd="$(pwd)"
cd "${prefix}/.." cd "${prefix}/.."