def register_package_header (self, package_hdr, branch_dict): if self.verbose: gub_log.info ('reading package header: %s\n' % package_hdr.__repr__ ()) str = open (package_hdr).read () header_name = os.path.basename (package_hdr) d = dict (pickle.loads (str)) name = d['basename'] vc_branch = d.get ('vc_branch', '') if name in branch_dict: branch = branch_dict[name] if ':' in branch: (remote_branch, branch) = tuple (branch.split (':')) if branch != vc_branch: gub_log.error ('package of branch: %(vc_branch)s, expecting: %(branch)s\n' % locals ()) gub_log.error ('ignoring header: %(header_name)s\n' % locals ()) return elif d['vc_branch']: gub_log.error ('no branch for package: %(name)s\n' % locals ()) gub_log.error ('ignoring header: %(header_name)s\n' % locals ()) gub_log.error ('available branch: %(vc_branch)s\n' % locals ()) return name = d['split_name'] if 0: ## FIXME ? if name in self._package_dict_db: if str != self._package_dict_db[name]: gub_log.info ("package header changed for %s\n" % name) return self.register_package_dict (d)
def register_package_dict (self, d): nm = d['name'] if 'split_name' in d: nm = d['split_name'] if 0 and (nm in self._packages): if self._packages[nm]['spec_checksum'] != d['spec_checksum']: gub_log.info ('******** checksum of %s changed!\n\n' % nm) if self._packages[nm]['cross_checksum'] != d['cross_checksum']: gub_log.info ('******** checksum of cross changed for %s\n' % nm) return self._packages[nm] = d
def get_cross_module (settings): platform = settings.platform if platform in cross_module_cache: return cross_module_cache[platform] base = re.sub ('[-0-9].*', '', platform) gubdir = settings.gubdir for name in platform, base: file_name = '%(gubdir)s/gub/%(name)s.py' % locals () if os.path.exists (file_name): break gub_log.info ('module name: ' + name + '\n') module = misc.load_module (file_name, base) cross_module_checksums[platform] = md5.md5 (open (file_name).read ()).hexdigest () cross_module_cache[platform] = module return module
def get_cross_module(settings): platform = settings.platform if platform in cross_module_cache: return cross_module_cache[platform] base = re.sub('[-0-9].*', '', platform) gubdir = settings.gubdir for name in platform, base: file_name = '%(gubdir)s/gub/%(name)s.py' % locals() if os.path.exists(file_name): break gub_log.info('module name: ' + name + '\n') module = misc.load_module(file_name, base) cross_module_checksums[platform] = md5.md5( open(file_name).read()).hexdigest() cross_module_cache[platform] = module return module
def main (): (options, args) = parse_options () # FIXME: local/system; wow that's from two layout changes ago! # os.environ['PATH']= os.getcwd () + '/target/local/system/usr/bin:' + os.environ['PATH'] # printf (os.environ['PATH']) os.system ('mkdir -p log') if options.dry_run: options.verbosity = gub_log.get_numeric_loglevel ('command') gub_log.set_default_log ('log/cron-builder.log', options.verbosity) logger = gub_log.default_logger gub_log.info (' *** Starting cron-builder:\n %s ' % '\n '.join (args)) if options.clean: # FIXME: what if user changes ~/.gubrc? should use gubb.Settings! loggedos.system (logger, 'rm -rf log/ target/ uploads/ buildnumber-* downloads/lilypond-*') make_cmd = 'make -f lilypond.make %s ' % options.make_options python_cmd = sys.executable + ' ' branch = options.branch local_branch = options.local_branch branch_sep = ':' # FIXME: what happened to branch juggling? if 1: local_branch = '' branch_sep = '' if 0: #FIXME: use if 1: when --stage download is fixed # cannot do this now, --stage=dowload of fontconfig depends on # tools freetype-config # must build bootstrap first # FIXME: use gub-tester's download facility # can't have these in gub-tester, since these # will always usually result in "release already tested" for platform in args: loggedos.system (logger, python_cmd + 'bin/gub --branch=lilypond=%(local_branch)s%(branch_sep)s:%(branch)s --platform=%(platform)s --stage=download lilypond' % locals ()) loggedos.system (logger, 'rm -f target/%(platform)s/status/lilypond-%(branch)s*' % locals ()) else: loggedos.system (logger, make_cmd + 'bootstrap') test_cmds = [] if 1: test_cmds.append (make_cmd + 'bootstrap') if options.build_package: test_cmds += [python_cmd + 'bin/gub --branch=lilypond=%(branch)s%(branch_sep)s%(local_branch)s --skip-if-locked --platform=%(platform)s lilypond' % locals () for platform in args] if options.build_installer: version_options = '' # installer-builder does not need remote-branch test_cmds += [python_cmd + 'bin/gib --skip-if-locked %(version_options)s --branch=lilypond=%(branch)s%(branch_sep)s%(local_branch)s --platform=%(platform)s build-all lilypond' % locals () for platform in args] if options.build_docs: test_cmds += [make_cmd + 'doc-build', make_cmd + 'doc-export'] options.test_options += ' --dependent' if options.build_tarball: test_cmds += [make_cmd + 'dist-check'] loggedos.system (logger, python_cmd + 'bin/gub-tester %s %s' % (options.test_options, ' '.join (["'%s'" % c for c in test_cmds])))