use loop for option handling
This commit is contained in:
parent
b279399927
commit
9c5ca97ecc
1 changed files with 21 additions and 9 deletions
30
gentooup.sh
30
gentooup.sh
|
@ -39,15 +39,27 @@ if [ "$(stat -c %d:%i /)" != "$(stat -c %d:%i /proc/1/root/.)" ]; then
|
|||
CHROOTED=1
|
||||
fi
|
||||
|
||||
if [[ ${1} == "--no-sync" || ${2} == "--no-sync" ]] ; then
|
||||
echo "not syncing"
|
||||
SYNC_COMMAND=""
|
||||
fi
|
||||
|
||||
if [[ ${1} == "--full" || ${2} == "--full" ]] ; then
|
||||
echo "Do a full upgrade including build dependencies"
|
||||
PORTAGE_UPGRADE_OPTIONS+=("--with-bdeps=y")
|
||||
fi
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--no-sync)
|
||||
echo "not syncing"
|
||||
SYNC_COMMAND=""
|
||||
shift
|
||||
;;
|
||||
--full)
|
||||
echo "Do a full upgrade including build dependencies"
|
||||
PORTAGE_UPGRADE_OPTIONS+=("--with-bdeps=y")
|
||||
shift
|
||||
;;
|
||||
--*)
|
||||
echo "Unknown option $1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Positional arguments aren't supported"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ $CHROOTED == 1 ]] ; then
|
||||
SYNC_COMMAND="layman -S"
|
||||
|
|
Loading…
Add table
Reference in a new issue