summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/package_manager/ipk
diff options
context:
space:
mode:
authorFredrik Gustafsson <fredrik.gustafsson@axis.com>2020-09-08 12:53:07 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-11-24 15:53:07 +0000
commite51345b50784572602a09a233b9d6f4847fe1f16 (patch)
treed65d4d5d4e06f3d0a014a634c03ced594d6c1dc7 /meta/lib/oe/package_manager/ipk
parent8c28435258ea28dadbbbe9506beae700c226c379 (diff)
downloadpoky-e51345b50784572602a09a233b9d6f4847fe1f16.tar.gz
package management: Allow dynamic loading of PM
Dynamic loading of package managers will allow other layers to simply add their package manager code in package_manager/ and have bitbake find it according to the package manager configuration. This is useful for adding new (faster) package managers to Open Embedded while not increasing the test scope or require Open Embedded to support more package managers. How this is tested: * Build core-image-minimal with all three package managers * Build the sdk with all three package managers. dpkg fails, but it fails on master as well. * Run the complete test suite, all tests passed except 16 * Run those 16 tests on master and verify that they fail there as well * Fix errors making tests works on master but not with this patch. (From OE-Core rev: 02670501dea192879ddf9f8048eea57a94719fc1) Signed-off-by: Fredrik Gustafsson <fredrigu@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/package_manager/ipk')
-rw-r--r--meta/lib/oe/package_manager/ipk/__init__.py9
-rw-r--r--meta/lib/oe/package_manager/ipk/manifest.py2
-rw-r--r--meta/lib/oe/package_manager/ipk/rootfs.py8
-rw-r--r--meta/lib/oe/package_manager/ipk/sdk.py10
4 files changed, 15 insertions, 14 deletions
diff --git a/meta/lib/oe/package_manager/ipk/__init__.py b/meta/lib/oe/package_manager/ipk/__init__.py
index 9603993a59..416ed23d47 100644
--- a/meta/lib/oe/package_manager/ipk/__init__.py
+++ b/meta/lib/oe/package_manager/ipk/__init__.py
@@ -59,9 +59,10 @@ class OpkgIndexer(Indexer):
59 self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'), 59 self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'),
60 armor=is_ascii_sig) 60 armor=is_ascii_sig)
61 61
62class OpkgPkgsList(PkgsList): 62class PMPkgsList(PkgsList):
63 def __init__(self, d, rootfs_dir, config_file): 63 def __init__(self, d, rootfs_dir):
64 super(OpkgPkgsList, self).__init__(d, rootfs_dir) 64 super(PMPkgsList, self).__init__(d, rootfs_dir)
65 config_file = d.getVar("IPKGCONF_TARGET")
65 66
66 self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg") 67 self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg")
67 self.opkg_args = "-f %s -o %s " % (config_file, rootfs_dir) 68 self.opkg_args = "-f %s -o %s " % (config_file, rootfs_dir)
@@ -416,7 +417,7 @@ class OpkgPM(OpkgDpkgPM):
416 bb.utils.remove(os.path.join(self.opkg_dir, "lists"), True) 417 bb.utils.remove(os.path.join(self.opkg_dir, "lists"), True)
417 418
418 def list_installed(self): 419 def list_installed(self):
419 return OpkgPkgsList(self.d, self.target_rootfs, self.config_file).list_pkgs() 420 return PMPkgsList(self.d, self.target_rootfs).list_pkgs()
420 421
421 def dummy_install(self, pkgs): 422 def dummy_install(self, pkgs):
422 """ 423 """
diff --git a/meta/lib/oe/package_manager/ipk/manifest.py b/meta/lib/oe/package_manager/ipk/manifest.py
index 69676903ab..ee4b57bcb0 100644
--- a/meta/lib/oe/package_manager/ipk/manifest.py
+++ b/meta/lib/oe/package_manager/ipk/manifest.py
@@ -4,7 +4,7 @@
4 4
5from oe.manifest import Manifest 5from oe.manifest import Manifest
6 6
7class OpkgManifest(Manifest): 7class PkgManifest(Manifest):
8 """ 8 """
9 Returns a dictionary object with mip and mlp packages. 9 Returns a dictionary object with mip and mlp packages.
10 """ 10 """
diff --git a/meta/lib/oe/package_manager/ipk/rootfs.py b/meta/lib/oe/package_manager/ipk/rootfs.py
index 63b4a59c40..26dbee6f6a 100644
--- a/meta/lib/oe/package_manager/ipk/rootfs.py
+++ b/meta/lib/oe/package_manager/ipk/rootfs.py
@@ -8,7 +8,7 @@ import shutil
8from oe.rootfs import Rootfs 8from oe.rootfs import Rootfs
9from oe.manifest import Manifest 9from oe.manifest import Manifest
10from oe.utils import execute_pre_post_process 10from oe.utils import execute_pre_post_process
11from oe.package_manager.ipk.manifest import OpkgManifest 11from oe.package_manager.ipk.manifest import PkgManifest
12from oe.package_manager.ipk import OpkgPM 12from oe.package_manager.ipk import OpkgPM
13 13
14class DpkgOpkgRootfs(Rootfs): 14class DpkgOpkgRootfs(Rootfs):
@@ -121,12 +121,12 @@ class DpkgOpkgRootfs(Rootfs):
121 121
122 num += 1 122 num += 1
123 123
124class OpkgRootfs(DpkgOpkgRootfs): 124class PkgRootfs(DpkgOpkgRootfs):
125 def __init__(self, d, manifest_dir, progress_reporter=None, logcatcher=None): 125 def __init__(self, d, manifest_dir, progress_reporter=None, logcatcher=None):
126 super(OpkgRootfs, self).__init__(d, progress_reporter, logcatcher) 126 super(PkgRootfs, self).__init__(d, progress_reporter, logcatcher)
127 self.log_check_regex = '(exit 1|Collected errors)' 127 self.log_check_regex = '(exit 1|Collected errors)'
128 128
129 self.manifest = OpkgManifest(d, manifest_dir) 129 self.manifest = PkgManifest(d, manifest_dir)
130 self.opkg_conf = self.d.getVar("IPKGCONF_TARGET") 130 self.opkg_conf = self.d.getVar("IPKGCONF_TARGET")
131 self.pkg_archs = self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS") 131 self.pkg_archs = self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS")
132 132
diff --git a/meta/lib/oe/package_manager/ipk/sdk.py b/meta/lib/oe/package_manager/ipk/sdk.py
index 47c0a92c1b..37af0344eb 100644
--- a/meta/lib/oe/package_manager/ipk/sdk.py
+++ b/meta/lib/oe/package_manager/ipk/sdk.py
@@ -6,20 +6,20 @@ import glob
6import shutil 6import shutil
7from oe.utils import execute_pre_post_process 7from oe.utils import execute_pre_post_process
8from oe.sdk import Sdk 8from oe.sdk import Sdk
9from oe.package_manager.ipk.manifest import PkgManifest
9from oe.manifest import Manifest 10from oe.manifest import Manifest
10from oe.package_manager.ipk import OpkgPM 11from oe.package_manager.ipk import OpkgPM
11 12
12class OpkgSdk(Sdk): 13class PkgSdk(Sdk):
13 def __init__(self, d, manifest_dir=None): 14 def __init__(self, d, manifest_dir=None):
14 super(OpkgSdk, self).__init__(d, manifest_dir) 15 super(PkgSdk, self).__init__(d, manifest_dir)
15 16
16 self.target_conf = self.d.getVar("IPKGCONF_TARGET") 17 self.target_conf = self.d.getVar("IPKGCONF_TARGET")
17 self.host_conf = self.d.getVar("IPKGCONF_SDK") 18 self.host_conf = self.d.getVar("IPKGCONF_SDK")
18 19
19 from oe.package_manager.ipk.manifest import OpkgManifest 20 self.target_manifest = PkgManifest(d, self.manifest_dir,
20 self.target_manifest = OpkgManifest(d, self.manifest_dir,
21 Manifest.MANIFEST_TYPE_SDK_TARGET) 21 Manifest.MANIFEST_TYPE_SDK_TARGET)
22 self.host_manifest = OpkgManifest(d, self.manifest_dir, 22 self.host_manifest = PkgManifest(d, self.manifest_dir,
23 Manifest.MANIFEST_TYPE_SDK_HOST) 23 Manifest.MANIFEST_TYPE_SDK_HOST)
24 24
25 ipk_repo_workdir = "oe-sdk-repo" 25 ipk_repo_workdir = "oe-sdk-repo"