Bug 675691 - Get rid of mozconfig guesswork. r=ted

- MOZCONFIG is now the only environment variable we recognize. We used to
  recognize MOZ_MYCONFIG as well, but we now error out if that is set.

- $topsrcdir/.mozconfig is now the only implicit location we recognize. We used
  to recognize a number of other implicit locations, but we now error out where
  we would have used one of them.
This commit is contained in:
Siddharth Agarwal 2011-08-24 12:09:29 +05:30
parent 9877d798b0
commit 93d6cc55ea

View File

@ -42,7 +42,6 @@
# order:
# if $MOZCONFIG is set, use that.
# Otherwise, use $TOPSRCDIR/.mozconfig
# Otherwise, use $HOME/.mozconfig
#
topsrcdir=$1
@ -67,19 +66,29 @@ abspath() {
echo `pwd`/$1
}
if [ -n "$MOZCONFIG" ] && ! [ -f "$MOZCONFIG" ]; then
echo "Specified MOZCONFIG \"$MOZCONFIG\" does not exist!"
exit 1
fi
if [ -n "$MOZ_MYCONFIG" ]; then
echo "Your environment currently has the MOZ_MYCONFIG variable set to \"$MOZ_MYCONFIG\". MOZ_MYCONFIG is no longer supported. Please use MOZCONFIG instead."
exit 1
fi
for _config in "$MOZCONFIG" \
"$MOZ_MYCONFIG"
"$topsrcdir/.mozconfig"
do
if [ -n "$_config" ] && ! [ -f "$_config" ]; then
echo "Specified MOZCONFIG \"$_config\" does not exist!"
exit 1
if test -f "$_config"; then
echo `abspath $_config`
exit 0
fi
done
for _config in "$MOZCONFIG" \
"$MOZ_MYCONFIG" \
"$topsrcdir/.mozconfig" \
"$topsrcdir/mozconfig" \
# We used to support a number of other implicit .mozconfig locations. We now
# detect if we were about to use any of these locations and issue an error if we
# find any.
for _config in "$topsrcdir/mozconfig" \
"$topsrcdir/mozconfig.sh" \
"$topsrcdir/myconfig.sh" \
"$HOME/.mozconfig" \
@ -87,7 +96,7 @@ for _config in "$MOZCONFIG" \
"$HOME/.mozmyconfig.sh"
do
if test -f "$_config"; then
echo `abspath $_config`
exit 0
echo "You currently have a mozconfig at \"$_config\". This implicit location is no longer supported. Please move it to $topsrcdir/.mozconfig or specify it explicitly via \$MOZCONFIG.";
exit 1
fi
done