summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/package_manager/deb/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/package_manager/deb/__init__.py')
-rw-r--r--meta/lib/oe/package_manager/deb/__init__.py37
1 files changed, 28 insertions, 9 deletions
diff --git a/meta/lib/oe/package_manager/deb/__init__.py b/meta/lib/oe/package_manager/deb/__init__.py
index 2ee68fefb1..0c23c884c1 100644
--- a/meta/lib/oe/package_manager/deb/__init__.py
+++ b/meta/lib/oe/package_manager/deb/__init__.py
@@ -1,4 +1,6 @@
1# 1#
2# Copyright OpenEmbedded Contributors
3#
2# SPDX-License-Identifier: GPL-2.0-only 4# SPDX-License-Identifier: GPL-2.0-only
3# 5#
4 6
@@ -53,6 +55,7 @@ class DpkgIndexer(Indexer):
53 55
54 index_cmds = [] 56 index_cmds = []
55 deb_dirs_found = False 57 deb_dirs_found = False
58 index_sign_files = set()
56 for arch in arch_list: 59 for arch in arch_list:
57 arch_dir = os.path.join(self.deploy_dir, arch) 60 arch_dir = os.path.join(self.deploy_dir, arch)
58 if not os.path.isdir(arch_dir): 61 if not os.path.isdir(arch_dir):
@@ -62,7 +65,10 @@ class DpkgIndexer(Indexer):
62 65
63 cmd += "%s -fcn Packages > Packages.gz;" % gzip 66 cmd += "%s -fcn Packages > Packages.gz;" % gzip
64 67
65 with open(os.path.join(arch_dir, "Release"), "w+") as release: 68 release_file = os.path.join(arch_dir, "Release")
69 index_sign_files.add(release_file)
70
71 with open(release_file, "w+") as release:
66 release.write("Label: %s\n" % arch) 72 release.write("Label: %s\n" % arch)
67 73
68 cmd += "PSEUDO_UNLOAD=1 %s release . >> Release" % apt_ftparchive 74 cmd += "PSEUDO_UNLOAD=1 %s release . >> Release" % apt_ftparchive
@@ -77,7 +83,16 @@ class DpkgIndexer(Indexer):
77 83
78 oe.utils.multiprocess_launch(create_index, index_cmds, self.d) 84 oe.utils.multiprocess_launch(create_index, index_cmds, self.d)
79 if self.d.getVar('PACKAGE_FEED_SIGN') == '1': 85 if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
80 raise NotImplementedError('Package feed signing not implementd for dpkg') 86 signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
87 else:
88 signer = None
89 if signer:
90 for f in index_sign_files:
91 signer.detach_sign(f,
92 self.d.getVar('PACKAGE_FEED_GPG_NAME'),
93 self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'),
94 output_suffix="gpg",
95 use_sha256=True)
81 96
82class PMPkgsList(PkgsList): 97class PMPkgsList(PkgsList):
83 98
@@ -214,7 +229,7 @@ class DpkgPM(OpkgDpkgPM):
214 229
215 tmp_sf.write(status) 230 tmp_sf.write(status)
216 231
217 os.rename(status_file + ".tmp", status_file) 232 bb.utils.rename(status_file + ".tmp", status_file)
218 233
219 def run_pre_post_installs(self, package_name=None): 234 def run_pre_post_installs(self, package_name=None):
220 """ 235 """
@@ -276,14 +291,18 @@ class DpkgPM(OpkgDpkgPM):
276 291
277 self.deploy_dir_unlock() 292 self.deploy_dir_unlock()
278 293
279 def install(self, pkgs, attempt_only=False): 294 def install(self, pkgs, attempt_only=False, hard_depends_only=False):
280 if attempt_only and len(pkgs) == 0: 295 if attempt_only and len(pkgs) == 0:
281 return 296 return
282 297
283 os.environ['APT_CONFIG'] = self.apt_conf_file 298 os.environ['APT_CONFIG'] = self.apt_conf_file
284 299
285 cmd = "%s %s install --allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated --no-remove %s" % \ 300 extra_args = ""
286 (self.apt_get_cmd, self.apt_args, ' '.join(pkgs)) 301 if hard_depends_only:
302 extra_args = "--no-install-recommends"
303
304 cmd = "%s %s install --allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-unauthenticated --no-remove %s %s" % \
305 (self.apt_get_cmd, self.apt_args, extra_args, ' '.join(pkgs))
287 306
288 try: 307 try:
289 bb.note("Installing the following packages: %s" % ' '.join(pkgs)) 308 bb.note("Installing the following packages: %s" % ' '.join(pkgs))
@@ -299,13 +318,13 @@ class DpkgPM(OpkgDpkgPM):
299 for dir in dirs: 318 for dir in dirs:
300 new_dir = re.sub(r"\.dpkg-new", "", dir) 319 new_dir = re.sub(r"\.dpkg-new", "", dir)
301 if dir != new_dir: 320 if dir != new_dir:
302 os.rename(os.path.join(root, dir), 321 bb.utils.rename(os.path.join(root, dir),
303 os.path.join(root, new_dir)) 322 os.path.join(root, new_dir))
304 323
305 for file in files: 324 for file in files:
306 new_file = re.sub(r"\.dpkg-new", "", file) 325 new_file = re.sub(r"\.dpkg-new", "", file)
307 if file != new_file: 326 if file != new_file:
308 os.rename(os.path.join(root, file), 327 bb.utils.rename(os.path.join(root, file),
309 os.path.join(root, new_file)) 328 os.path.join(root, new_file))
310 329
311 330
@@ -422,7 +441,7 @@ class DpkgPM(OpkgDpkgPM):
422 multilib_variants = self.d.getVar("MULTILIB_VARIANTS"); 441 multilib_variants = self.d.getVar("MULTILIB_VARIANTS");
423 for variant in multilib_variants.split(): 442 for variant in multilib_variants.split():
424 localdata = bb.data.createCopy(self.d) 443 localdata = bb.data.createCopy(self.d)
425 variant_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + variant, False) 444 variant_tune = localdata.getVar("DEFAULTTUNE:virtclass-multilib-" + variant, False)
426 orig_arch = localdata.getVar("DPKG_ARCH") 445 orig_arch = localdata.getVar("DPKG_ARCH")
427 localdata.setVar("DEFAULTTUNE", variant_tune) 446 localdata.setVar("DEFAULTTUNE", variant_tune)
428 variant_arch = localdata.getVar("DPKG_ARCH") 447 variant_arch = localdata.getVar("DPKG_ARCH")