def buildDistributionImage(mode, options): p = options.platformID s = p if 'osx' in options.platformID: p = 'osx' s = options.platformID elif options.platformID == 'linux': if options.platformSubID in ['gutsy', 'hardy', 'intrepid', 'jaunty']: s = 'gutsy' if mode == 'release': manifestFile = os.path.join(options.sourceDir, 'distrib', p, 'manifest.%s' % s) else: manifestFile = os.path.join(options.sourceDir, 'distrib', p, 'manifest.debug.%s' % s) options.distribName = buildDistribName(mode, options) options.distribDir = os.path.join(options.buildDir, options.distribName) # yep - we are removing the directory we are # about ready to create - but we want to ensure # it's truly empty if os.access(options.distribDir, os.F_OK): rmdirs(options.distribDir) os.makedirs(options.distribDir) # when we make an osx distribution, we actually need to put it # in a subdirectory (which has a .app extension). So we set # distribDir locally to that .app dir so that handleManifest() # puts things in the right place. if 'osx' in options.platformID: distribDir = os.path.join(options.distribDir, '%s.app' % options.distribName) else: distribDir = options.distribDir result = handleManifest(options.buildDir, options.outputDir, distribDir, manifestFile, options.platformID) if result and options.platformID == 'win': convertLineEndings(distribDir) return result
if build == 'tarball': options.distribFiles[mode].append(buildTarball(mode, options)) if build == 'dmg': options.distribFiles[mode].append(buildDMG(mode, options)) if build == 'exe': options.distribFiles[mode].append(buildEXE(mode, options)) if build == 'rpm': options.distribFiles[mode].append(buildRPM(mode, options)) if build == 'deb': options.distribFiles[mode].append(buildDEB(mode, options)) if options.outputDir <> options.buildDir: generateTinderboxOutput(mode, options.distribFiles[mode]) if os.access(options.distribDir, os.F_OK): rmdirs(options.distribDir) if _debug: log(options.distribFiles[mode]) else: log('Skipping %s because the directory is not present' % mode, error=True) except DistributionError: success = False # revert the contents of version.py to clear any previously generated values runCommand([ findInPath(os.environ['PATH'], 'svn'), 'revert', os.path.join(options.sourceDir, 'version.py') ]) if not success: sys.exit('Failed to create distributions')