aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-06-10 15:51:09 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-06-10 15:53:50 +0300
commit45efe171e6510d06217d83bc28e0f4b9d85fe4ba (patch)
tree9bb260aad7e74308dbdd97798eb30235878d5613
parent854a1ab17a77831a2bde71f5b4a58616588f7bed (diff)
bootstrap: add manifest subclass
Move add_project() functionality from gbp back to the test data repo. This functionality is only used here so it makes sense to maintain it here, too. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-xbootstrap.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/bootstrap.py b/bootstrap.py
index ec6c321..08506be 100755
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -48,6 +48,20 @@ class GitError(Exception):
pass
+class TestDataRepoManifest(RepoManifest):
+ """Test repo manifest"""
+ def add_project(self, name, branches):
+ """Add new project to the manifest"""
+ prj_e = self._doc.createElement('project')
+ prj_e.setAttribute('name', name)
+ for branch, revision in branches.iteritems():
+ br_e = self._doc.createElement('branch')
+ br_e.setAttribute('name', branch)
+ br_e.setAttribute('revision', revision)
+ prj_e.appendChild(br_e)
+ self._doc.firstChild.appendChild(prj_e)
+
+
def run_cmd(cmd, opts=None, capture_stdout=False, capture_stderr=False):
"""Run command"""
args = [cmd] + opts if opts else [cmd]
@@ -206,7 +220,7 @@ def main(argv=None):
if args.update_branches != 'no':
force = True if args.update_branches == 'force' else False
update_from_remote('origin', force=force)
- test_manifest = RepoManifest()
+ test_manifest = TestDataRepoManifest()
for pkg, pkgconf in TEST_PKGS.iteritems():
if 'export_branches' in pkgconf:
update_testrepo_manifest(test_manifest, pkg,