Move RepoManifest to gbp
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 27 Sep 2013 08:34:26 +0000 (11:34 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 12 Dec 2013 14:35:52 +0000 (16:35 +0200)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
bootstrap.py

index 71db04eddde56bbc5b73e76e7cb0de58f94cc813..5e42d7d29a58b63b88c6dc3a7733009f526b3d3b 100755 (executable)
@@ -28,7 +28,8 @@ import shutil
 import subprocess
 import sys
 import tempfile
-from xml.dom import minidom
+
+from tests.component.rpm import RepoManifest
 
 LOG = logging.getLogger(os.path.basename(sys.argv[0]))
 TEST_PKGS = {'gbp-test-native': {'build_branches': ['master']},
@@ -135,28 +136,6 @@ def build_test_pkg(pkg_name, branch, outdir, silent_build=False):
         shutil.rmtree(builddir)
 
 
-class RepoManifest(object):
-    """Class representing a test repo manifest file"""
-    def __init__(self):
-        self._doc = minidom.Document()
-        self._doc.appendChild(self._doc.createElement("gbp-test-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 write(self, filename):
-        """Write to file"""
-        with open(filename, 'w') as fileobj:
-            fileobj.write(self._doc.toprettyxml())
-
 def update_testrepo_manifest(manifest, pkg_name, branches):
     """
     Update a manifest file describing the branches/sha1s of a test git repo