Bug 457113: source files altered when building with symlinked chrome; r=pike
authorKarsten Düsterloh <mnyromyr@tprac.de>
Sun, 28 Sep 2008 21:42:38 +0200
changeset 19850 15ae5842b50362cf30717700920fb635aced0cc7
parent 19849 a2d84821ea714b0ad2706345fdd0795cb6b992b8
child 19851 48f9681b965c125d442de3fd752da3a11c5dc006
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspike
bugs457113
milestone1.9.1b1pre
Bug 457113: source files altered when building with symlinked chrome; r=pike
config/JarMaker.py
--- a/config/JarMaker.py
+++ b/config/JarMaker.py
@@ -375,16 +375,22 @@ class JarMaker(object):
     the symlink subclass.
     '''
     def __init__(self, basepath):
       self.basepath = basepath
     def getDestModTime(self, aPath):
       return getModTime(os.path.join(self.basepath, aPath))
     def getOutput(self, name):
       out = self.ensureDirFor(name)
+      # remove previous link or file
+      try:
+        os.remove(out)
+      except OSError, e:
+        if e.errno != 2:
+          raise
       return open(out, 'wb')
     def ensureDirFor(self, name):
       out = os.path.join(self.basepath, name)
       outdir = os.path.dirname(out)
       if not os.path.isdir(outdir):
         os.makedirs(outdir)
       return out