Reapplied changeset 31ff9550fba6 (bug 870073)
authorMatt Brubeck <mbrubeck@mozilla.com>
Fri, 10 May 2013 15:49:57 -0700
changeset 142566 69185af5841eadaaf3aec249d63fef687b9f1dd4
parent 142565 d852d10691a4e080a1880878baa7a1c1f278526c
child 142567 8e8ebb9fc99f03dcd578e74b800740221879e7e5
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs870073
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Reapplied changeset 31ff9550fba6 (bug 870073)
config/tests/unit-writemozinfo.py
config/writemozinfo.py
--- a/config/tests/unit-writemozinfo.py
+++ b/config/tests/unit-writemozinfo.py
@@ -170,22 +170,26 @@ class TestWriteJson(unittest.TestCase):
         os.unlink(self.f)
 
     def testBasic(self):
         """
         Test that writing to a file produces correct output.
         """
         write_json(self.f, env={'OS_TARGET':'WINNT',
                                 'TARGET_CPU':'i386',
+                                'TOPSRCDIR':'/tmp',
+                                'MOZCONFIG':'foo',
                                 'MOZ_WIDGET_TOOLKIT':'windows'})
         with open(self.f) as f:
             d = json.load(f)
             self.assertEqual('win', d['os'])
             self.assertEqual('x86', d['processor'])
             self.assertEqual('windows', d['toolkit'])
+            self.assertEqual('/tmp', d['topsrcdir'])
+            self.assertEqual(os.path.normpath('/tmp/foo'), d['mozconfig'])
             self.assertEqual(32, d['bits'])
 
     def testFileObj(self):
         """
         Test that writing to a file-like object produces correct output.
         """
         s = StringIO()
         write_json(s, env={'OS_TARGET':'WINNT',
--- a/config/writemozinfo.py
+++ b/config/writemozinfo.py
@@ -25,17 +25,20 @@ def build_dict(env=os.environ):
     # Check that all required variables are present first.
     required = ["TARGET_CPU", "OS_TARGET", "MOZ_WIDGET_TOOLKIT"]
     missing = [r for r in required if r not in env]
     if missing:
         raise Exception("Missing required environment variables: %s" %
                         ', '.join(missing))
 
     if 'MOZCONFIG' in env:
-        d["mozconfig"] = env["MOZCONFIG"]
+        mozconfig = env["MOZCONFIG"]
+        if 'TOPSRCDIR' in env:
+            mozconfig = os.path.join(env["TOPSRCDIR"], mozconfig)
+        d['mozconfig'] = os.path.normpath(mozconfig)
 
     if 'TOPSRCDIR' in env:
         d["topsrcdir"] = env["TOPSRCDIR"]
 
     # os
     o = env["OS_TARGET"]
     known_os = {"Linux": "linux",
                 "WINNT": "win",