Explicitly indicates that only bash is supported.
Remove all zsh compatibility code and related comments. Display a warning when other shell is used, to prevent the illusion that building under Zsh is supported when it's not. Change-Id: Ie6d43ace3a30bde99aad45b00d25007ac28d5155
This commit is contained in:
23
envsetup.sh
23
envsetup.sh
@@ -379,7 +379,7 @@ function choosevariant()
|
|||||||
export TARGET_BUILD_VARIANT=$default_value
|
export TARGET_BUILD_VARIANT=$default_value
|
||||||
elif (echo -n $ANSWER | grep -q -e "^[0-9][0-9]*$") ; then
|
elif (echo -n $ANSWER | grep -q -e "^[0-9][0-9]*$") ; then
|
||||||
if [ "$ANSWER" -le "${#VARIANT_CHOICES[@]}" ] ; then
|
if [ "$ANSWER" -le "${#VARIANT_CHOICES[@]}" ] ; then
|
||||||
export TARGET_BUILD_VARIANT=${VARIANT_CHOICES[$(($ANSWER-$_arrayoffset))]}
|
export TARGET_BUILD_VARIANT=${VARIANT_CHOICES[$(($ANSWER-1))]}
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if check_variant $ANSWER
|
if check_variant $ANSWER
|
||||||
@@ -483,7 +483,7 @@ function lunch()
|
|||||||
then
|
then
|
||||||
if [ $answer -le ${#LUNCH_MENU_CHOICES[@]} ]
|
if [ $answer -le ${#LUNCH_MENU_CHOICES[@]} ]
|
||||||
then
|
then
|
||||||
selection=${LUNCH_MENU_CHOICES[$(($answer-$_arrayoffset))]}
|
selection=${LUNCH_MENU_CHOICES[$(($answer-1))]}
|
||||||
fi
|
fi
|
||||||
elif (echo -n $answer | grep -q -e "^[^\-][^\-]*-[^\-][^\-]*$")
|
elif (echo -n $answer | grep -q -e "^[^\-][^\-]*-[^\-][^\-]*$")
|
||||||
then
|
then
|
||||||
@@ -1060,10 +1060,9 @@ function godir () {
|
|||||||
echo "Invalid choice"
|
echo "Invalid choice"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
pathname=${lines[$(($choice-$_arrayoffset))]}
|
pathname=${lines[$(($choice-1))]}
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
# even though zsh arrays are 1-based, $foo[0] is an alias for $foo[1]
|
|
||||||
pathname=${lines[0]}
|
pathname=${lines[0]}
|
||||||
fi
|
fi
|
||||||
cd $T/$pathname
|
cd $T/$pathname
|
||||||
@@ -1083,15 +1082,13 @@ function set_java_home() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# determine whether arrays are zero-based (bash) or one-based (zsh)
|
case `ps -o command -p $$` in
|
||||||
_xarray=(a b c)
|
*bash*)
|
||||||
if [ -z "${_xarray[${#_xarray[@]}]}" ]
|
;;
|
||||||
then
|
*)
|
||||||
_arrayoffset=1
|
echo "WARNING: Only bash is supported, use of other shell would lead to erroneous results"
|
||||||
else
|
;;
|
||||||
_arrayoffset=0
|
esac
|
||||||
fi
|
|
||||||
unset _xarray
|
|
||||||
|
|
||||||
# Execute the contents of any vendorsetup.sh files we can find.
|
# Execute the contents of any vendorsetup.sh files we can find.
|
||||||
for f in `/bin/ls vendor/*/vendorsetup.sh vendor/*/build/vendorsetup.sh device/*/*/vendorsetup.sh 2> /dev/null`
|
for f in `/bin/ls vendor/*/vendorsetup.sh vendor/*/build/vendorsetup.sh device/*/*/vendorsetup.sh 2> /dev/null`
|
||||||
|
Reference in New Issue
Block a user