From: Steven Valdez Date: Fri, 19 Jul 2013 16:42:13 +0000 (-0400) Subject: Merged with invirtibuilder fixes X-Git-Tag: 0.1.28~1 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-dev.git/commitdiff_plain/4bb46daa9fd2acf86b90b8626f1835a7581ea424?hp=0c857359c16cba2d7da62e7db7a75df92f265281 Merged with invirtibuilder fixes --- diff --git a/debian/changelog b/debian/changelog index 84d8bd5..1528521 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,65 +1,75 @@ -invirt-dev (0.1.24~glasgall7adehnert1achernya1) unstable; urgency=low +invirt-dev (0.1.27) unstable; urgency=low * Switch to dh7 * Bump standards version -- Alexander Chernyakhovsky Fri, 31 May 2013 03:40:11 -0400 -invirt-dev (0.1.24~glasgall7adehnert1) unstable; urgency=low - - * Use opcode "auto" for build zephyrs - - -- Alex Dehnert Wed, 24 Apr 2013 23:05:15 -0400 - -invirt-dev (0.1.24~glasgall7) precise; urgency=low +invirt-dev (0.1.26~glasgall7) precise; urgency=low * Actually invoke sbuild correctly. Oops. -- Adam Glasgall Thu, 18 Apr 2013 23:21:47 -0400 -invirt-dev (0.1.24~glasgall6) precise; urgency=low +invirt-dev (0.1.26~glasgall6) precise; urgency=low * Specify a maintainer when building packages (sbuild behavior changed) -- Adam Glasgall Thu, 18 Apr 2013 22:19:51 -0400 -invirt-dev (0.1.24~glasgall5) precise; urgency=low +invirt-dev (0.1.26~glasgall5) precise; urgency=low * more API updates -- Adam Glasgall Thu, 18 Apr 2013 18:42:55 -0400 -invirt-dev (0.1.24~glasgall4) precise; urgency=low +invirt-dev (0.1.26~glasgall4) precise; urgency=low * Replace calls to session.save_or_update with session.add (removal of deprecated API use) -- Adam Glasgall Thu, 18 Apr 2013 18:32:24 -0400 -invirt-dev (0.1.24~glasgall3ubuntu1) precise; urgency=low +invirt-dev (0.1.26~glasgall3ubuntu1) precise; urgency=low * Change Depends on emacs21 to emacs, now that emacs22 and up are a thing. -- Adam Glasgall Tue, 16 Apr 2013 21:51:40 -0400 -invirt-dev (0.1.24~glasgall3) precise; urgency=low +invirt-dev (0.1.26~glasgall3) precise; urgency=low * Port packaging to dh_python2 -- Adam Glasgall Tue, 16 Apr 2013 21:46:24 -0400 -invirt-dev (0.1.24~glasgall2) precise; urgency=low +invirt-dev (0.1.26) unstable; urgency=low + + * invirtibuilder creates missing pocket branches in super-repository + * invirtibuilder no longer overwrites submodules with .gitmodules blob in + tree + + -- Peter Iannucci Tue, 16 Jul 2013 17:07:00 -0400 - * No-change rebuild to see if it'll help invirtibuilder pick up the - pieces. +invirt-dev (0.1.25) unstable; urgency=low - -- Adam Glasgall Tue, 16 Apr 2013 20:16:38 -0400 + * invirt-submit-build allows builds in new pockets + * invirtibuilder warns if super-repository does not contain the pocket + branch -invirt-dev (0.1.24~glasgall1) precise; urgency=low + -- Peter Iannucci Mon, 15 Jul 2013 14:46:00 -0400 - * Bump version for rebuild for precise +invirt-dev (0.1.25~glasgall1) unstable; urgency=low - -- Adam Glasgall Mon, 15 Apr 2013 18:35:16 -0400 + * Build source packages in a chroot as well so that they can take + advantage of newer debhelper et al versions. + + -- Adam Glasgall Fri, 12 Jul 2013 23:48:06 -0400 + +invirt-dev (0.1.24) unstable; urgency=low + + * Use opcode "auto" for build zephyrs + + -- Alex Dehnert Wed, 24 Apr 2013 23:05:15 -0400 invirt-dev (0.1.23) unstable; urgency=low diff --git a/invirtibuilder b/invirtibuilder index 4aff352..598820c 100755 --- a/invirtibuilder +++ b/invirtibuilder @@ -221,7 +221,31 @@ def updateSuperproject(pocket, package, commit, principal, version, env): pushes to the superproject. """ superproject = os.path.join(b._REPO_DIR, 'invirt/packages.git') + branch = b.pocketToGit(pocket) + + if not b.pocketExists(pocket, superproject): + gitmodules = "\n" + gitmodules_hash = logAndRun(['git', 'hash-object', '-w', '--stdin'], + cwd=superproject, + stdin_str=gitmodules).strip() + tree_items = {'.gitmodules': "100644 blob "+gitmodules_hash} + new_tree = "\n".join("%s\t%s" % (v, k) for (k, v) in tree_items.iteritems()) + new_tree_id = logAndRun(['git', 'mktree', '--missing'], + cwd=superproject, + stdin_str=new_tree).strip() + env2 = dict(os.environ) + env2['GIT_AUTHOR_NAME'] = config.build.tagger.name + env2['GIT_AUTHOR_EMAIL'] = config.build.tagger.email + env2['GIT_COMMITTER_NAME'] = config.build.tagger.name + env2['GIT_COMMITTER_EMAIL'] = config.build.tagger.email + new_commit = logAndRun(['git', 'commit-tree', new_tree_id], + cwd=superproject, + env=env2, + stdin_str="Create new pocket").strip() + logAndRun(['git', 'update-ref', 'refs/heads/%s' % branch, new_commit], + cwd=superproject) + tree = logAndRun(['git', 'ls-tree', branch], cwd=superproject).strip() @@ -244,7 +268,7 @@ def updateSuperproject(pocket, package, commit, principal, version, env): gitmodules_hash = logAndRun(['git', 'hash-object', '-w', '--stdin'], cwd=superproject, stdin_str=gitmodules).strip() - tree_items[package] = "100644 blob "+gitmodules_hash + tree_items['.gitmodules'] = "100644 blob "+gitmodules_hash new_tree = "\n".join("%s\t%s" % (v, k) for (k, v) in tree_items.iteritems()) @@ -357,6 +381,8 @@ def build(): env = dict(os.environ) env['GIT_COMMITTER_NAME'] = config.build.tagger.name env['GIT_COMMITTER_EMAIL'] = config.build.tagger.email + env['GIT_AUTHOR_NAME'] = principal.split('@')[0] + env['GIT_AUTHOR_EMAIL'] = principal # If validateBuild returns something other than True, then # it means we should copy from that pocket to our pocket. @@ -390,7 +416,9 @@ def build(): # If we were, we could use debuild and get nice # environment scrubbing. Since we're not, debuild # complains about not having an orig.tar.gz - logAndRun(['dpkg-buildpackage', '-us', '-uc', '-S'], + logAndRun(['schroot', '-c', + '%s-amd64-sbuild' % (b.pocketToDistro(pocket),), + '--', 'dpkg-buildpackage', '-us', '-uc', '-S'], cwd=packagedir) db.failed_stage = 'building binary packages' 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: