From: "Fredrik Gustafsson" <fredrik.gustafsson@axis.com>
To: <openembedded-core@lists.openembedded.org>
Cc: <tools-cfpbuild-internal@axis.com>, <hugo.cedervall@axis.com>,
Fredrik Gustafsson <fredrigu@axis.com>
Subject: [PATCH v2 08/26] sdk.py: Move DpkgSdk
Date: Thu, 25 Jun 2020 12:21:27 +0200 [thread overview]
Message-ID: <20200625102145.7139-9-fredrigu@axis.com> (raw)
In-Reply-To: <20200625102145.7139-1-fredrigu@axis.com>
Let the sdk only used by the dpkg package manager live in the dpkg
directory.
Signed-off-by: Fredrik Gustafsson <fredrigu@axis.com>
---
meta/lib/oe/package_managers/deb/sdk.py | 94 +++++++++++++++++++++++++
meta/lib/oe/sdk.py | 86 +---------------------
2 files changed, 95 insertions(+), 85 deletions(-)
create mode 100644 meta/lib/oe/package_managers/deb/sdk.py
diff --git a/meta/lib/oe/package_managers/deb/sdk.py b/meta/lib/oe/package_managers/deb/sdk.py
new file mode 100644
index 0000000000..154ec5ab17
--- /dev/null
+++ b/meta/lib/oe/package_managers/deb/sdk.py
@@ -0,0 +1,94 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from oe.sdk import *
+from oe.package_managers.deb.manifest import *
+
+class DpkgSdk(Sdk):
+ def __init__(self, d, manifest_dir=None):
+ super(DpkgSdk, self).__init__(d, manifest_dir)
+
+ self.target_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET"), "apt")
+ self.host_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET"), "apt-sdk")
+
+ self.target_manifest = PkgManifest(d, self.manifest_dir,
+ Manifest.MANIFEST_TYPE_SDK_TARGET)
+ self.host_manifest = PkgManifest(d, self.manifest_dir,
+ Manifest.MANIFEST_TYPE_SDK_HOST)
+
+ deb_repo_workdir = "oe-sdk-repo"
+ if "sdk_ext" in d.getVar("BB_RUNTASK"):
+ deb_repo_workdir = "oe-sdk-ext-repo"
+
+ self.target_pm = DpkgPM(d, self.sdk_target_sysroot,
+ self.d.getVar("PACKAGE_ARCHS"),
+ self.d.getVar("DPKG_ARCH"),
+ self.target_conf_dir,
+ deb_repo_workdir=deb_repo_workdir)
+
+ self.host_pm = DpkgPM(d, self.sdk_host_sysroot,
+ self.d.getVar("SDK_PACKAGE_ARCHS"),
+ self.d.getVar("DEB_SDK_ARCH"),
+ self.host_conf_dir,
+ deb_repo_workdir=deb_repo_workdir)
+
+ def _copy_apt_dir_to(self, dst_dir):
+ staging_etcdir_native = self.d.getVar("STAGING_ETCDIR_NATIVE")
+
+ self.remove(dst_dir, True)
+
+ shutil.copytree(os.path.join(staging_etcdir_native, "apt"), dst_dir)
+
+ def _populate_sysroot(self, pm, manifest):
+ pkgs_to_install = manifest.parse_initial_manifest()
+
+ pm.write_index()
+ pm.update()
+
+ for pkg_type in self.install_order:
+ if pkg_type in pkgs_to_install:
+ pm.install(pkgs_to_install[pkg_type],
+ [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
+
+ def _populate(self):
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_PRE_TARGET_COMMAND"))
+
+ bb.note("Installing TARGET packages")
+ self._populate_sysroot(self.target_pm, self.target_manifest)
+
+ self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
+
+ self.target_pm.run_intercepts(populate_sdk='target')
+
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
+
+ self._copy_apt_dir_to(os.path.join(self.sdk_target_sysroot, "etc", "apt"))
+
+ if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
+ self.target_pm.remove_packaging_data()
+
+ bb.note("Installing NATIVESDK packages")
+ self._populate_sysroot(self.host_pm, self.host_manifest)
+ self.install_locales(self.host_pm)
+
+ self.host_pm.run_intercepts(populate_sdk='host')
+
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
+
+ self._copy_apt_dir_to(os.path.join(self.sdk_output, self.sdk_native_path,
+ "etc", "apt"))
+
+ if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
+ self.host_pm.remove_packaging_data()
+
+ native_dpkg_state_dir = os.path.join(self.sdk_output, self.sdk_native_path,
+ "var", "lib", "dpkg")
+ self.mkdirhier(native_dpkg_state_dir)
+ for f in glob.glob(os.path.join(self.sdk_output, "var", "lib", "dpkg", "*")):
+ self.movefile(f, native_dpkg_state_dir)
+ self.remove(os.path.join(self.sdk_output, "var"), True)
+
+
+
+
diff --git a/meta/lib/oe/sdk.py b/meta/lib/oe/sdk.py
index 3df0d2f091..a52055a505 100644
--- a/meta/lib/oe/sdk.py
+++ b/meta/lib/oe/sdk.py
@@ -192,91 +192,6 @@ class OpkgSdk(Sdk):
self.remove(os.path.join(self.sdk_output, "var"), True)
-class DpkgSdk(Sdk):
- def __init__(self, d, manifest_dir=None):
- super(DpkgSdk, self).__init__(d, manifest_dir)
-
- self.target_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET"), "apt")
- self.host_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET"), "apt-sdk")
-
- import importlib
- self.target_manifest = importlib.import_module('oe.package_managers.deb.manifest').PkgManifest(d, self.manifest_dir, Manifest.MANIFEST_TYPE_SDK_TARGET)
- self.host_manifest = importlib.import_module('oe.package_managers.deb.manifest').PkgManifest(d, self.manifest_dir, Manifest.MANIFEST_TYPE_SDK_HOST)
-
- deb_repo_workdir = "oe-sdk-repo"
- if "sdk_ext" in d.getVar("BB_RUNTASK"):
- deb_repo_workdir = "oe-sdk-ext-repo"
-
- self.target_pm = DpkgPM(d, self.sdk_target_sysroot,
- self.d.getVar("PACKAGE_ARCHS"),
- self.d.getVar("DPKG_ARCH"),
- self.target_conf_dir,
- deb_repo_workdir=deb_repo_workdir)
-
- self.host_pm = DpkgPM(d, self.sdk_host_sysroot,
- self.d.getVar("SDK_PACKAGE_ARCHS"),
- self.d.getVar("DEB_SDK_ARCH"),
- self.host_conf_dir,
- deb_repo_workdir=deb_repo_workdir)
-
- def _copy_apt_dir_to(self, dst_dir):
- staging_etcdir_native = self.d.getVar("STAGING_ETCDIR_NATIVE")
-
- self.remove(dst_dir, True)
-
- shutil.copytree(os.path.join(staging_etcdir_native, "apt"), dst_dir)
-
- def _populate_sysroot(self, pm, manifest):
- pkgs_to_install = manifest.parse_initial_manifest()
-
- pm.write_index()
- pm.update()
-
- for pkg_type in self.install_order:
- if pkg_type in pkgs_to_install:
- pm.install(pkgs_to_install[pkg_type],
- [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
-
- def _populate(self):
- execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_PRE_TARGET_COMMAND"))
-
- bb.note("Installing TARGET packages")
- self._populate_sysroot(self.target_pm, self.target_manifest)
-
- self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
-
- self.target_pm.run_intercepts(populate_sdk='target')
-
- execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
-
- self._copy_apt_dir_to(os.path.join(self.sdk_target_sysroot, "etc", "apt"))
-
- if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
- self.target_pm.remove_packaging_data()
-
- bb.note("Installing NATIVESDK packages")
- self._populate_sysroot(self.host_pm, self.host_manifest)
- self.install_locales(self.host_pm)
-
- self.host_pm.run_intercepts(populate_sdk='host')
-
- execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
-
- self._copy_apt_dir_to(os.path.join(self.sdk_output, self.sdk_native_path,
- "etc", "apt"))
-
- if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
- self.host_pm.remove_packaging_data()
-
- native_dpkg_state_dir = os.path.join(self.sdk_output, self.sdk_native_path,
- "var", "lib", "dpkg")
- self.mkdirhier(native_dpkg_state_dir)
- for f in glob.glob(os.path.join(self.sdk_output, "var", "lib", "dpkg", "*")):
- self.movefile(f, native_dpkg_state_dir)
- self.remove(os.path.join(self.sdk_output, "var"), True)
-
-
-
def sdk_list_installed_packages(d, target, rootfs_dir=None):
if rootfs_dir is None:
sdk_output = d.getVar('SDK_OUTPUT')
@@ -301,6 +216,7 @@ def populate_sdk(d, manifest_dir=None):
img_type = d.getVar('IMAGE_PKGTYPE')
from oe.package_managers.rpm.sdk import RpmSdk
+ from oe.package_managers.deb.sdk import DpkgSdk
if img_type == "rpm":
RpmSdk(d, manifest_dir).populate()
elif img_type == "ipk":
--
2.20.1
next prev parent reply other threads:[~2020-06-25 10:22 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-25 10:21 Add package managers as a plugin Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 01/26] nopackages.bbclass: Get tasks from variable Fredrik Gustafsson
2020-06-25 10:41 ` [OE-core] " Paul Barker
2020-06-25 10:21 ` [PATCH v2 02/26] package_managers: Add directory structure Fredrik Gustafsson
2020-06-25 10:41 ` [OE-core] " Paul Barker
2020-06-25 10:21 ` [PATCH v2 03/26] manifest: Move RpmManifest Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 04/26] manifest: Move DpkgManifest Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 05/26] manifest: Move OpkgManifest Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 06/26] manifest.py: Dynamic load of manifest Fredrik Gustafsson
2020-06-25 10:41 ` [OE-core] " Paul Barker
2020-06-25 10:21 ` [PATCH v2 07/26] sdk.py: Move RpmSdk Fredrik Gustafsson
2020-06-25 10:21 ` Fredrik Gustafsson [this message]
2020-06-25 10:21 ` [PATCH v2 09/26] sdk.py: Move OpkgSdk Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 10/26] sdk.py: Dynamic load of sdk Fredrik Gustafsson
2020-06-25 10:41 ` [OE-core] " Paul Barker
2020-06-25 10:21 ` [PATCH v2 11/26] rootfs.py: Move RpmRootfs Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 12/26] rootfs.py: Move DpkgRootfs Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 13/26] rootfs.py: Move OpkgRootfs Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 14/26] rootfs.py: Dynamic load of rootfs Fredrik Gustafsson
2020-06-25 10:42 ` [OE-core] " Paul Barker
2020-06-25 10:21 ` [PATCH v2 15/26] package_manager.py: Move RpmPM Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 16/26] package_manager.py: Move DpkgPM Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 17/26] package_manager.py: Move OpkgPM Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 18/26] package_manager: Rename RpmPM to PkgPM, etc Fredrik Gustafsson
2020-06-25 10:42 ` [OE-core] " Paul Barker
2020-06-25 10:21 ` [PATCH v2 19/26] package_manager.py: Move RpmIndexer Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 20/26] package_manager.py: Move OpkgIndexer Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 21/26] package_manager.py: Move DpkgIndexer Fredrik Gustafsson
2020-06-25 10:42 ` [OE-core] " Paul Barker
2020-06-25 10:21 ` [PATCH v2 22/26] package_manager: Rename Indexer classes Fredrik Gustafsson
2020-06-25 10:42 ` [OE-core] " Paul Barker
2020-06-25 10:21 ` [PATCH v2 23/26] package_manager.py: Move RpmPkgsList Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 24/26] package_manager.py: Move OpkgPkgsList Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 25/26] package_manager.py: Move DpkgPkgsList Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 26/26] package_manager: Rename PkgsList classes Fredrik Gustafsson
2020-06-25 10:43 ` [OE-core] " Paul Barker
2020-06-25 10:40 ` [OE-core] Add package managers as a plugin Paul Barker
2020-06-30 18:39 ` Fredrik Gustafsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200625102145.7139-9-fredrigu@axis.com \
--to=fredrik.gustafsson@axis.com \
--cc=fredrigu@axis.com \
--cc=hugo.cedervall@axis.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=tools-cfpbuild-internal@axis.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox