Bug 1255305 - Move the function finding a shell from old.configure to init.configure draft
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 11 Mar 2016 22:52:40 +0900
changeset 339512 fd508a5095bf67e57cc314695765a7a6130e2104
parent 339511 9e6332fab3de3a08aa65429be9e33c41e7934eb6
child 339513 d3a16649f3666e4edbb407f40b7b5c822e44ea72
push id12749
push userbmo:mh+mozilla@glandium.org
push dateFri, 11 Mar 2016 15:49:26 +0000
bugs1255305
milestone48.0a1
Bug 1255305 - Move the function finding a shell from old.configure to init.configure
build/moz.configure/init.configure
build/moz.configure/old.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -228,19 +228,35 @@ def mozconfig_options(mozconfig):
         # but at the moment, moz.configure has no knowledge of the options
         # that may appear there. We'll opt-in when we move things from
         # old-configure.in, which will be tedious but necessary until we
         # can discriminate what old-configure.in supports.
 
 del command_line_helper
 
 
+# Mozilla-Build
+# ==============================================================
 option(env='MOZILLABUILD', nargs=1,
        help='Path to Mozilla Build (Windows-only)')
 
+# It feels dirty replicating this from python/mozbuild/mozbuild/mozconfig.py,
+# but the end goal being that the configure script would go away...
+@depends('MOZILLABUILD')
+@advanced
+def shell(mozillabuild):
+    import sys
+
+    shell = 'sh'
+    if mozillabuild:
+        shell = mozillabuild[0] + '/msys/bin/sh'
+    if sys.platform == 'win32':
+        shell = shell + '.exe'
+    return shell
+
 
 option('--enable-application', nargs=1, env='MOZ_BUILD_APP',
        help='Application to build. Same as --enable-project.')
 
 @depends('--enable-application', '--help')
 def application(app, help):
     if app:
         imply_option(app.format('--enable-project'))
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -1,29 +1,14 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-# It feels dirty replicating this from python/mozbuild/mozbuild/mozconfig.py,
-# but the end goal being that the configure script would go away...
-@depends('MOZILLABUILD')
-@advanced
-def shell(mozillabuild):
-    import sys
-
-    shell = 'sh'
-    if mozillabuild:
-        shell = mozillabuild[0] + '/msys/bin/sh'
-    if sys.platform == 'win32':
-        shell = shell + '.exe'
-    return shell
-
-
 @template
 @advanced
 def encoded_open(path, mode):
     import codecs
     import sys
     encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
     return codecs.open(path, mode, encoding)