X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-dev.git/blobdiff_plain/79d4cc01d27a879b047dba4f682d5f3795140f82..209f1da1f4b13941e75a41e1091e79bdda4c4f56:/invirtibuilder diff --git a/invirtibuilder b/invirtibuilder index e1c3d80..9198549 100755 --- a/invirtibuilder +++ b/invirtibuilder @@ -289,19 +289,31 @@ def build(): b.ensureValidPackage(package) db.commit = commit = b.canonicalize_commit(package, commit) src = b.validateBuild(pocket, package, commit) - - db.version = str(b.getVersion(package, commit)) + version = b.getVersion(package, commit) + db.version = str(version) b.runHook('pre-build', [str(db.build_id), db.pocket, db.package, db.commit, db.principal, db.version, str(db.inserted_at)]) + env = dict(os.environ) + env['GIT_COMMITTER_NAME'] = config.build.tagger.name + env['GIT_COMMITTER_EMAIL'] = config.build.tagger.email + # If validateBuild returns something other than True, then # it means we should copy from that pocket to our pocket. # # (If the validation failed, validateBuild would have # raised an exception) if src != True: + # TODO: cut out this code duplication + db.failed_stage = 'tagging submodule before copying package' + tagSubmodule(pocket, package, commit, principal, version, env) + db.failed_stage = 'updating submodule branches before copying package' + updateSubmoduleBranch(pocket, package, commit) + db.failed_stage = 'updating superproject before copying package' + updateSuperproject(pocket, package, commit, principal, version, env) db.failed_stage = 'copying package from another pocket' aptCopy(package, commit, pocket, src) + # If we can't copy the package from somewhere, but # validateBuild didn't raise an exception, then we need to # do the build ourselves @@ -333,14 +345,8 @@ def build(): for log in glob.glob(os.path.join(workdir, 'build-*.log')): os.copy(log, logdir) - db.failed_stage = 'processing metadata' - env = dict(os.environ) - env['GIT_COMMITTER_NAME'] = config.build.tagger.name - env['GIT_COMMITTER_EMAIL'] = config.build.tagger.email - version = b.getVersion(package, commit) - db.failed_stage = 'tagging submodule' - tagSubmodule(pocket, package, principal, version, env) + tagSubmodule(pocket, package, commit, principal, version, env) db.failed_stage = 'updating submodule branches' updateSubmoduleBranch(pocket, package, commit) db.failed_stage = 'updating superproject'