Superproject, not superrepo, is git's term for a repo that contains
[invirt/packages/invirt-dev.git] / invirtibuilder
index 61efa9f..32744ae 100755 (executable)
@@ -7,7 +7,7 @@ attempts to build a particular package.
 
 If the build succeeds, the new version of the package is uploaded to
 the apt repository, tagged in its git repository, and the Invirt
 
 If the build succeeds, the new version of the package is uploaded to
 the apt repository, tagged in its git repository, and the Invirt
-superrepo is updated to point at the new version.
+superproject is updated to point at the new version.
 
 If the build fails, the Invirtibuilder sends mail with the build log.
 
 
 If the build fails, the Invirtibuilder sends mail with the build log.
 
@@ -20,7 +20,7 @@ Each queue file contains a file of the form
     pocket package hash principal
 
 where pocket is one of the pockets globally configured in
     pocket package hash principal
 
 where pocket is one of the pockets globally configured in
-git.pockets. For instance, the pockets in XVM are "prod" and "dev".
+build.pockets. For instance, the pockets in XVM are "prod" and "dev".
 
 principal is the Kerberos principal that requested the build.
 """
 
 principal is the Kerberos principal that requested the build.
 """
@@ -137,13 +137,13 @@ def tagSubmodule(pocket, package, ref, principal):
     I'm sure that long description gives you great confidence in teh
     legitimacy of my reasoning.
     """
     I'm sure that long description gives you great confidence in teh
     legitimacy of my reasoning.
     """
-    if config.git.pockets[pocket].get('allow_backtracking', False):
+    if config.build.pockets[pocket].get('allow_backtracking', False):
         env = dict(os.environ)
         branch = b.pocketToGit(pocket)
         version = b.getVersion(package, ref)
 
         env = dict(os.environ)
         branch = b.pocketToGit(pocket)
         version = b.getVersion(package, ref)
 
-        env['GIT_COMMITTER_NAME'] = config.git.tagger.name
-        env['GIT_COMMITTER_EMAIL'] = config.git.tagger.email
+        env['GIT_COMMITTER_NAME'] = config.build.tagger.name
+        env['GIT_COMMITTER_EMAIL'] = config.build.tagger.email
         tag_msg = ('Tag %s of %s\n\n'
                    'Requested by %s' % (version.full_version,
                                         package,
         tag_msg = ('Tag %s of %s\n\n'
                    'Requested by %s' % (version.full_version,
                                         package,
@@ -173,19 +173,19 @@ def uploadBuild(pocket, workdir):
                        changes])
 
 
                        changes])
 
 
-def updateSuperrepo(pocket, package, commit, principal):
-    """Update the superrepo.
+def updateSuperproject(pocket, package, commit, principal):
+    """Update the superproject.
 
     This will create a new commit on the branch for the given pocket
     that sets the commit for the package submodule to commit.
 
     Note that there's no locking issue here, because we disallow all
 
     This will create a new commit on the branch for the given pocket
     that sets the commit for the package submodule to commit.
 
     Note that there's no locking issue here, because we disallow all
-    pushes to the superrepo.
+    pushes to the superproject.
     """
     """
-    superrepo = os.path.join(b._REPO_DIR, 'invirt/packages.git')
+    superproject = os.path.join(b._REPO_DIR, 'invirt/packages.git')
     branch = b.pocketToGit(pocket)
     tree = c.captureOutput(['git', 'ls-tree', branch],
     branch = b.pocketToGit(pocket)
     tree = c.captureOutput(['git', 'ls-tree', branch],
-                         cwd=superrepo)
+                         cwd=superproject)
 
     new_tree = re.compile(
         r'^(160000 commit )[0-9a-f]*(\t%s)$' % package, re.M).sub(
 
     new_tree = re.compile(
         r'^(160000 commit )[0-9a-f]*(\t%s)$' % package, re.M).sub(
@@ -193,7 +193,7 @@ def updateSuperrepo(pocket, package, commit, principal):
         tree)
 
     new_tree_id = c.captureOutput(['git', 'mktree'],
         tree)
 
     new_tree_id = c.captureOutput(['git', 'mktree'],
-                                cwd=superrepo,
+                                cwd=superproject,
                                 stdin_str=new_tree)
 
     commit_msg = ('Update %s to version %s\n\n'
                                 stdin_str=new_tree)
 
     commit_msg = ('Update %s to version %s\n\n'
@@ -202,13 +202,13 @@ def updateSuperrepo(pocket, package, commit, principal):
                                        principal))
     new_commit = c.captureOutput(
         ['git', 'commit-tree', new_tree_hash, '-p', branch],
                                        principal))
     new_commit = c.captureOutput(
         ['git', 'commit-tree', new_tree_hash, '-p', branch],
-        cwd=superrepo,
+        cwd=superproject,
         env=env,
         stdin_str=commit_msg)
 
     c.captureOutput(
         ['git', 'update-ref', 'refs/heads/%s' % branch, new_commit],
         env=env,
         stdin_str=commit_msg)
 
     c.captureOutput(
         ['git', 'update-ref', 'refs/heads/%s' % branch, new_commit],
-        cwd=superrepo)
+        cwd=superproject)
 
 
 @contextlib.contextmanager
 
 
 @contextlib.contextmanager
@@ -329,8 +329,8 @@ def build():
                     tagSubmodule(pocket, package, commit, principal)
                     db.failed_stage = 'updating submodule branches'
                     updateSubmoduleBranch(pocket, package, commit)
                     tagSubmodule(pocket, package, commit, principal)
                     db.failed_stage = 'updating submodule branches'
                     updateSubmoduleBranch(pocket, package, commit)
-                    db.failed_stage = 'updating superrepo'
-                    updateSuperrepo(pocket, package, commit, principal)
+                    db.failed_stage = 'updating superproject'
+                    updateSuperproject(pocket, package, commit, principal)
                     db.failed_stage = 'uploading packages to apt repo'
                     uploadBuild(pocket, workdir)
 
                     db.failed_stage = 'uploading packages to apt repo'
                     uploadBuild(pocket, workdir)