~extension-hackers/globalmenu-extension/3.5

« back to all changes in this revision

Viewing changes to config/JarMaker.py

  • Committer: Chris Coulson
  • Date: 2011-08-05 17:37:02 UTC
  • Revision ID: chrisccoulson@ubuntu.com-20110805173702-n11ykbt0tdp5u07q
Refresh build system from FIREFOX_6_0b5_BUILD1

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
from utils import pushback_iter, lockFile
57
57
from Preprocessor import Preprocessor
58
58
from buildlist import addEntriesToListFile
 
59
if sys.platform == "win32":
 
60
  from ctypes import windll, WinError
 
61
  CreateHardLink = windll.kernel32.CreateHardLinkA
59
62
 
60
63
__all__ = ['JarMaker']
61
64
 
406
409
      if (m.group('optOverwrite')
407
410
          or (getModTime(realsrc) >
408
411
              outHelper.getDestModTime(m.group('output')))):
409
 
        if self.outputFormat == 'symlink' and hasattr(os, 'symlink'):
 
412
        if self.outputFormat == 'symlink':
410
413
          outHelper.symlink(realsrc, out)
411
414
          return
412
415
        outf = outHelper.getOutput(out)
468
471
      except OSError, e:
469
472
        if e.errno != errno.ENOENT:
470
473
          raise
471
 
      os.symlink(src, out)
 
474
      if sys.platform != "win32":
 
475
        os.symlink(src, out)
 
476
      else:
 
477
        # On Win32, use ctypes to create a hardlink
 
478
        rv = CreateHardLink(out, src, None)
 
479
        if rv == 0:
 
480
          raise WinError()
472
481
 
473
482
def main():
474
483
  jm = JarMaker()