summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/package_manager.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index a9d216a88e..7ba2e4d332 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -1993,7 +1993,10 @@ class DpkgPM(OpkgDpkgPM):
1993 """ 1993 """
1994 def run_pre_post_installs(self, package_name=None): 1994 def run_pre_post_installs(self, package_name=None):
1995 info_dir = self.target_rootfs + "/var/lib/dpkg/info" 1995 info_dir = self.target_rootfs + "/var/lib/dpkg/info"
1996 suffixes = [(".preinst", "Preinstall"), (".postinst", "Postinstall")] 1996 ControlScript = collections.namedtuple("ControlScript", ["suffix", "name", "argument"])
1997 control_scripts = [
1998 ControlScript(".preinst", "Preinstall", "install"),
1999 ControlScript(".postinst", "Postinstall", "configure")]
1997 status_file = self.target_rootfs + "/var/lib/dpkg/status" 2000 status_file = self.target_rootfs + "/var/lib/dpkg/status"
1998 installed_pkgs = [] 2001 installed_pkgs = []
1999 2002
@@ -2016,16 +2019,18 @@ class DpkgPM(OpkgDpkgPM):
2016 2019
2017 failed_pkgs = [] 2020 failed_pkgs = []
2018 for pkg_name in installed_pkgs: 2021 for pkg_name in installed_pkgs:
2019 for suffix in suffixes: 2022 for control_script in control_scripts:
2020 p_full = os.path.join(info_dir, pkg_name + suffix[0]) 2023 p_full = os.path.join(info_dir, pkg_name + control_script.suffix)
2021 if os.path.exists(p_full): 2024 if os.path.exists(p_full):
2022 try: 2025 try:
2023 bb.note("Executing %s for package: %s ..." % 2026 bb.note("Executing %s for package: %s ..." %
2024 (suffix[1].lower(), pkg_name)) 2027 (control_script.name.lower(), pkg_name))
2025 subprocess.check_output(p_full, stderr=subprocess.STDOUT) 2028 subprocess.check_output([p_full, control_script.argument],
2029 stderr=subprocess.STDOUT)
2026 except subprocess.CalledProcessError as e: 2030 except subprocess.CalledProcessError as e:
2027 bb.note("%s for package %s failed with %d:\n%s" % 2031 bb.note("%s for package %s failed with %d:\n%s" %
2028 (suffix[1], pkg_name, e.returncode, e.output.decode("utf-8"))) 2032 (control_script.name, pkg_name, e.returncode,
2033 e.output.decode("utf-8")))
2029 failed_pkgs.append(pkg_name) 2034 failed_pkgs.append(pkg_name)
2030 break 2035 break
2031 2036