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
|
CHROOTED=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${1} == "--no-sync" || ${2} == "--no-sync" ]] ; then
|
while [[ $# -gt 0 ]]; do
|
||||||
echo "not syncing"
|
case $1 in
|
||||||
SYNC_COMMAND=""
|
--no-sync)
|
||||||
fi
|
echo "not syncing"
|
||||||
|
SYNC_COMMAND=""
|
||||||
if [[ ${1} == "--full" || ${2} == "--full" ]] ; then
|
shift
|
||||||
echo "Do a full upgrade including build dependencies"
|
;;
|
||||||
PORTAGE_UPGRADE_OPTIONS+=("--with-bdeps=y")
|
--full)
|
||||||
fi
|
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
|
if [[ $CHROOTED == 1 ]] ; then
|
||||||
SYNC_COMMAND="layman -S"
|
SYNC_COMMAND="layman -S"
|
||||||
|
|
Loading…
Add table
Reference in a new issue