--priority option of *.ks file in mic does not apply
authorGyeoungmin Kim <g5.kim@samsung.com>
Wed, 20 May 2015 00:43:10 +0000 (09:43 +0900)
committeradmin <yuhuan.yang@samsung.com>
Thu, 4 Feb 2016 10:33:04 +0000 (18:33 +0800)
I confirm that  --priority option of *.ks file in mic does not apply
When creating an image file using ks file, Priority is determined by repo name

If you check the logs of the mic by applying the repo name below to see what the results are different

repo --name=mobile-wayland_arm64 ...
repo --name=prerelease ... --priority 1
..............................................
repo --name=2mobile-wayland_arm64 ...
repo --name=1prerelease ... --priority 1

Change-Id: I53bb8e96bc8eb06e8075294e56b0cbb4f35afd6b

plugins/backend/zypppkgmgr.py

index 3590edc..9358cbe 100644 (file)
@@ -301,12 +301,15 @@ class Zypp(BackendPlugin):
         self.to_deselect.append(pkg)
 
     def selectGroup(self, grp, include = ksparser.GROUP_DEFAULT):
+        def compareGroup(pitem):
+            item = zypp.asKindPattern(pitem)
+            return item.repoInfo().priority()
         if not self.Z:
             self.__initialize_zypp()
         found = False
         q = zypp.PoolQuery()
         q.addKind(zypp.ResKind.pattern)
-        for pitem in q.queryResults(self.Z.pool()):
+        for pitem in sorted(q.queryResults(self.Z.pool()), key=compareGroup):
             item = zypp.asKindPattern(pitem)
             summary = "%s" % item.summary()
             name = "%s" % item.name()