Merged with invirtibuilder fixes
authorSteven Valdez <dvorak42@mit.edu>
Fri, 19 Jul 2013 16:42:13 +0000 (12:42 -0400)
committerSteven Valdez <dvorak42@mit.edu>
Fri, 19 Jul 2013 16:42:13 +0000 (12:42 -0400)
debian/changelog
invirtibuilder
python/invirt/builder.py

index 84d8bd5..1528521 100644 (file)
@@ -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 <achernya@mit.edu>  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 <adehnert@mit.edu>  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 <glasgall@mit.edu>  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 <glasgall@mit.edu>  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 <glasgall@mit.edu>  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 <glasgall@mit.edu>  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 <glasgall@mit.edu>  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 <glasgall@mit.edu>  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 <iannucci@mit.edu>  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 <glasgall@mit.edu>  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 <iannucci@mit.edu>  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 <glasgall@mit.edu>  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 <glasgall@mit.edu>  Fri, 12 Jul 2013 23:48:06 -0400
+
+invirt-dev (0.1.24) unstable; urgency=low
+
+  *  Use opcode "auto" for build zephyrs
+
+ -- Alex Dehnert <adehnert@mit.edu>  Wed, 24 Apr 2013 23:05:15 -0400
 
 invirt-dev (0.1.23) unstable; urgency=low
 
index 4aff352..598820c 100755 (executable)
@@ -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'
index f864feb..8e24faf 100644 (file)
@@ -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: