Change manifest for new build.xml structure
authorZhuoX Li <zhuox.li@intel.com>
Wed, 14 May 2014 02:58:38 +0000 (10:58 +0800)
committerLin Yang <lin.a.yang@intel.com>
Wed, 14 May 2014 03:37:36 +0000 (11:37 +0800)
In current version, one repo of OBS project will generate one manifest file.
All archs from one repo will point to the same manifest file.
So change 'buildid'_'repo_name'_'arch_name'.xml name to 'buildid'_'repo_name'.xml
one example shows as below:
previous manifest file name: tizen_20140513.1_ia32-wayland_ia32.xml
current manifest file name: tizen_20140513.1_ia32-wayland.xml

Change-Id: I962062037f8af361b4e2a87bb928e8e8f0030ef8

common/manifest.py
common/repomaker.py

index 15a1563..813bf4a 100644 (file)
@@ -67,7 +67,7 @@ def get_repo_primary_md(path_snapshot_base, repo):
     """
 
     # return as dict in {'package_name': "VCS Tag"}
-    ret_data = {}
+    ret_data = None
 
     build_info = xml2obj(open(os.path.join(path_snapshot_base,
                                           'build.xml')))
@@ -80,7 +80,7 @@ def get_repo_primary_md(path_snapshot_base, repo):
                                                            repo.data,
                                                            'repodata')):
                         if md_file.endswith('primary.xml.gz'):
-                            ret_data[repo.arch] = \
+                            ret_data = \
                                 os.path.join(path_snapshot_base,
                                              repo.data,
                                              'repodata',
index cf0a9a5..241712a 100644 (file)
@@ -322,24 +322,23 @@ class RepoMaker(object):
         repo_primary = manifest.get_repo_primary_md(self.outdir, name)
 
         # Generate manifest for every repo arch
-        for arch in repo_primary.keys():
-            # package and vcs tag dict
-            package_vcs_tag =  manifest.get_package_vcs_tag(repo_primary[arch])
-            # tuple set in (gitprj, git_path, revision)
-            data = set([])
-
-            for pkg in package_vcs_tag.keys():
-                try:
-                    git_prj, commit_id = package_vcs_tag[pkg].split('#')
-                    data.add((git_prj, git_prj, commit_id))
-                except ValueError:
-                    # No vcs tag found
-                    data.add((pkg, '', ''))
-
-            manifest_string = manifest.gen_repo_manifest(sorted(data),
-                                                gerrit_fetch_url,
-                                                gerrit_review_url)
-            with open(os.path.join(manifest_dir,
-                                   "%s_%s_%s.xml"  %(self.build_id, name, arch)),
-                      'w') as manifest_fh:
-                manifest_fh.write(manifest_string)
+        # package and vcs tag dict
+        package_vcs_tag =  manifest.get_package_vcs_tag(repo_primary)
+        # tuple set in (gitprj, git_path, revision)
+        data = set([])
+
+        for pkg in package_vcs_tag.keys():
+            try:
+                git_prj, commit_id = package_vcs_tag[pkg].split('#')
+                data.add((git_prj, git_prj, commit_id))
+            except ValueError:
+                # No vcs tag found
+                data.add((pkg, '', ''))
+
+        manifest_string = manifest.gen_repo_manifest(sorted(data),
+                                            gerrit_fetch_url,
+                                            gerrit_review_url)
+        with open(os.path.join(manifest_dir,
+                               "%s_%s.xml"  %(self.build_id, name)),
+                  'w') as manifest_fh:
+            manifest_fh.write(manifest_string)