[v2,23/26] package_manager.py: Move RpmPkgsList

Submitted by Fredrik Gustafsson on June 25, 2020, 10:21 a.m. | Patch ID: 173903

Details

Message ID 20200625102145.7139-24-fredrigu@axis.com
State New
Headers show

Commit Message

Fredrik Gustafsson June 25, 2020, 10:21 a.m.
Let the code that is only used by rpm package manager live in that
package manager owned directory.

Signed-off-by: Fredrik Gustafsson <fredrigu@axis.com>
---
 meta/lib/oe/package_manager.py                      | 5 -----
 meta/lib/oe/package_managers/rpm/package_manager.py | 4 ++++
 meta/lib/oe/rootfs.py                               | 1 +
 meta/lib/oe/sdk.py                                  | 1 +
 4 files changed, 6 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index bfddbce93c..20c3400def 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -158,11 +158,6 @@  class PkgsList(object, metaclass=ABCMeta):
     def list_pkgs(self):
         pass
 
-class RpmPkgsList(PkgsList):
-    def list_pkgs(self):
-        from oe.package_managers.rpm.package_manager import PkgPM
-        return PkgPM(self.d, self.rootfs_dir, self.d.getVar('TARGET_VENDOR'), needfeed=False).list_installed()
-
 class OpkgPkgsList(PkgsList):
     def __init__(self, d, rootfs_dir, config_file):
         super(OpkgPkgsList, self).__init__(d, rootfs_dir)
diff --git a/meta/lib/oe/package_managers/rpm/package_manager.py b/meta/lib/oe/package_managers/rpm/package_manager.py
index e781676183..57a5c9ec38 100644
--- a/meta/lib/oe/package_managers/rpm/package_manager.py
+++ b/meta/lib/oe/package_managers/rpm/package_manager.py
@@ -400,3 +400,7 @@  class PkgIndexer(RpmIndexer):
                         self.do_write_index(dir_path)
 
 
+class RpmPkgsList(PkgsList):
+    def list_pkgs(self):
+        return PkgPM(self.d, self.rootfs_dir, self.d.getVar('TARGET_VENDOR'), needfeed=False).list_installed()
+
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index fdfb8efafc..b9891455fb 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -371,6 +371,7 @@  def image_list_installed_packages(d, rootfs_dir=None):
         rootfs_dir = d.getVar('IMAGE_ROOTFS')
 
     img_type = d.getVar('IMAGE_PKGTYPE')
+    from oe.package_managers.rpm.package_manager import RpmPkgsList
     if img_type == "rpm":
         return RpmPkgsList(d, rootfs_dir).list_pkgs()
     elif img_type == "ipk":
diff --git a/meta/lib/oe/sdk.py b/meta/lib/oe/sdk.py
index 3b7869f071..619ab57caf 100644
--- a/meta/lib/oe/sdk.py
+++ b/meta/lib/oe/sdk.py
@@ -116,6 +116,7 @@  def sdk_list_installed_packages(d, target, rootfs_dir=None):
 
         rootfs_dir = [sdk_output, os.path.join(sdk_output, target_path)][target is True]
 
+    from oe.package_managers.rpm.package_manager import RpmPkgsList
     img_type = d.getVar('IMAGE_PKGTYPE')
     if img_type == "rpm":
         arch_var = ["SDK_PACKAGE_ARCHS", None][target is True]