From: Peter Iannucci Date: Mon, 15 Jul 2013 18:56:26 +0000 (-0400) Subject: Better new-pocket affordances in invirtibuilder and build submission script X-Git-Tag: 0.1.25^0 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-dev.git/commitdiff_plain/ddfae2e7744dde1196eeeebf0746397e8bfb3cf8 Better new-pocket affordances in invirtibuilder and build submission script --- diff --git a/debian/changelog b/debian/changelog index 05878d4..ac05680 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +invirt-dev (0.1.25) unstable; urgency=low + + * invirt-submit-build allows builds in new pockets + * invirtibuilder warns if super-repository does not contain the pocket + branch + + -- Peter Iannucci Mon, 15 Jul 2013 14:46:00 -0400 + invirt-dev (0.1.25~glasgall1) unstable; urgency=low * Build source packages in a chroot as well so that they can take diff --git a/invirtibuilder b/invirtibuilder index 4e73484..699ce07 100755 --- a/invirtibuilder +++ b/invirtibuilder @@ -220,6 +220,9 @@ def updateSuperproject(pocket, package, commit, principal, version, env): pushes to the superproject. """ superproject = os.path.join(b._REPO_DIR, 'invirt/packages.git') + if not b.pocketExists(pocket, superproject): + raise Exception("Super-repository does not contain pocket branch '%s'. Create it first." % pocket) + branch = b.pocketToGit(pocket) tree = logAndRun(['git', 'ls-tree', branch], cwd=superproject).strip() diff --git a/python/invirt/builder.py b/python/invirt/builder.py index f864feb..8e24faf 100644 --- a/python/invirt/builder.py +++ b/python/invirt/builder.py @@ -106,6 +106,13 @@ def getVersion(package, ref): """Get the version of a given package at a particular ref.""" return getChangelog(package, ref).get_version() +def pocketExists(pocket, repo): + branch = pocketToGit(pocket) + try: + c.captureOutput(['git', 'rev-parse', branch], cwd=repo) + except subprocess.CalledProcessError: + return False + return True def validateBuild(pocket, package, commit): """Given the parameters of a new build, validate that build. @@ -167,6 +174,9 @@ def validateBuild(pocket, package, commit): (new_version, package, p, current_commit)) if not config.build.pockets[pocket].get('allow_backtracking', False): + if not pocketExists(pocket, package_repo): + return True + branch = pocketToGit(pocket) current_version = getVersion(package, branch) if new_version <= current_version: