mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1417264 - Write objdir .mozconfig from Python; r=nalexander
This is a pretty straightforward port of the logic. But we even go a step further: we delete the file in the objdir if there is no source mozconfig! MozReview-Commit-ID: AHFFzy6mXRY --HG-- extra : rebase_source : 1b9387bd72f5a8e9bf8274f5764b0db0176fdba2 extra : source : 0cab9a382d817e6fbab9daa37db0f23e7f73e71f
This commit is contained in:
parent
c4869e52d7
commit
f269a93370
@ -138,7 +138,6 @@ configure-files: $(CONFIGURES)
|
||||
|
||||
configure-preqs = \
|
||||
configure-files \
|
||||
save-mozconfig \
|
||||
$(OBJDIR)/.mozconfig.json \
|
||||
$(NULL)
|
||||
|
||||
@ -151,11 +150,6 @@ endif
|
||||
|
||||
$(OBJDIR)/.mozconfig.json: ;
|
||||
|
||||
save-mozconfig: $(FOUND_MOZCONFIG)
|
||||
ifdef FOUND_MOZCONFIG
|
||||
-cp $(FOUND_MOZCONFIG) $(OBJDIR)/.mozconfig
|
||||
endif
|
||||
|
||||
configure:: $(configure-preqs)
|
||||
$(call BUILDSTATUS,TIERS configure)
|
||||
$(call BUILDSTATUS,TIER_START configure)
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import errno
|
||||
import getpass
|
||||
import io
|
||||
import json
|
||||
@ -1371,6 +1372,19 @@ class BuildDriver(MozbuildObject):
|
||||
with FileAvoidWrite(mozconfig_mk) as fh:
|
||||
fh.write(b'\n'.join(mozconfig_filtered_lines))
|
||||
|
||||
# Copy the original mozconfig to the objdir.
|
||||
mozconfig_objdir = os.path.join(self.topobjdir, '.mozconfig')
|
||||
if mozconfig['path']:
|
||||
with open(mozconfig['path'], 'rb') as ifh:
|
||||
with FileAvoidWrite(mozconfig_objdir) as ofh:
|
||||
ofh.write(ifh.read())
|
||||
else:
|
||||
try:
|
||||
os.unlink(mozconfig_objdir)
|
||||
except OSError as e:
|
||||
if e.errno != errno.ENOENT:
|
||||
raise
|
||||
|
||||
if mozconfig_make_lines:
|
||||
self.log(logging.WARNING, 'mozconfig_content', {
|
||||
'path': mozconfig['path'],
|
||||
|
Loading…
Reference in New Issue
Block a user