summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2016-05-24 12:44:12 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-30 15:58:11 +0100
commit6a7138ebb6b18bbfb91f743ebd64c3bfc009f75f (patch)
tree9fffc8973a173c44d6c9222988768fb1e13d1105 /meta/lib/oeqa/utils
parentdaf0cc3745bc309e5e9566f737d113c744c5ffb3 (diff)
downloadpoky-6a7138ebb6b18bbfb91f743ebd64c3bfc009f75f.tar.gz
oeqa/utils/package_manager.py: Add get_package_manager()
This new file just contain one function to return an OE package manager, this depends in the current packaging method. [YOCTO #8694] (From OE-Core rev: 9b4b150ccbcd2f7a0b27d083eb406578584af3fa) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r--meta/lib/oeqa/utils/package_manager.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/package_manager.py b/meta/lib/oeqa/utils/package_manager.py
new file mode 100644
index 0000000000..099ecc9728
--- /dev/null
+++ b/meta/lib/oeqa/utils/package_manager.py
@@ -0,0 +1,29 @@
1def get_package_manager(d, root_path):
2 """
3 Returns an OE package manager that can install packages in root_path.
4 """
5 from oe.package_manager import RpmPM, OpkgPM, DpkgPM
6
7 pkg_class = d.getVar("IMAGE_PKGTYPE", True)
8 if pkg_class == "rpm":
9 pm = RpmPM(d,
10 root_path,
11 d.getVar('TARGET_VENDOR', True))
12 pm.create_configs()
13
14 elif pkg_class == "ipk":
15 pm = OpkgPM(d,
16 root_path,
17 d.getVar("IPKGCONF_TARGET", True),
18 d.getVar("ALL_MULTILIB_PACKAGE_ARCHS", True))
19
20 elif pkg_class == "deb":
21 pm = DpkgPM(d,
22 root_path,
23 d.getVar('PACKAGE_ARCHS', True),
24 d.getVar('DPKG_ARCH', True))
25
26 pm.write_index()
27 pm.update()
28
29 return pm