Bug 675691 - Get rid of mozconfig guesswork. r=ted
authorSiddharth Agarwal <sid.bugzilla@gmail.com>
Wed, 24 Aug 2011 12:09:29 +0530
changeset 75807 c3657f68bd662048665ec788d1975bb1366bc410
parent 75806 011569fdc55597714e413d17d25e1ca801ac9a11
child 75808 2921dbf1def9fce7fcc6abd9615c9d2e4113c34f
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersted
bugs675691
milestone9.0a1
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.
build/autoconf/mozconfig-find
--- a/build/autoconf/mozconfig-find
+++ b/build/autoconf/mozconfig-find
@@ -37,17 +37,16 @@
 #
 # ***** END LICENSE BLOCK *****
 
 # mozconfigfind - Loads options from .mozconfig onto configure's
 #    command-line. The .mozconfig file is searched for in the 
 #    order:
 #       if $MOZCONFIG is set, use that.
 #       Otherwise, use $TOPSRCDIR/.mozconfig
-#       Otherwise, use $HOME/.mozconfig
 #
 topsrcdir=$1
 
 abspath() {
   if uname -s | grep -q MINGW; then
     # We have no way to figure out whether we're in gmake or pymake right
     # now. gmake gives us Unix-style paths while pymake gives us Windows-style
     # paths, so attempt to handle both.
@@ -62,32 +61,42 @@ abspath() {
       exit 0
     fi
   done
 
   # If we're at this point, we have a relative path
   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" \
                "$HOME/.mozconfig.sh" \
                "$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