diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2021-01-16 11:49:11 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-01-16 22:39:36 +0000 |
commit | 57706c0fb3278aeb880c18f6f8b6fe5839afa8db (patch) | |
tree | 59f139a89729c761e95822e98056b5759909fb6f /meta/lib | |
parent | c0211ff9f0a73f99caec37d90691dd0e4de9d843 (diff) | |
download | poky-57706c0fb3278aeb880c18f6f8b6fe5839afa8db.tar.gz |
deb: do not insert feed uris if apt not installed
- The dir /etc/apt was created in package apt, if package apt was not
installed, there is no need to insert package feed. Otherwise, it
will fail with no such dir
- Output the result of apt install
- Explicitly trust the deb package repository from build
This could avoid apt install warning:
...
WARNING: The following packages cannot be authenticated!
...
- Also trust the inserted deb package repository from PACKAGE_FEED_URIS
(From OE-Core rev: 9ec65b77c9a4a0ba240117edee0e84208c58328e)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/package_manager/deb/__init__.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/meta/lib/oe/package_manager/deb/__init__.py b/meta/lib/oe/package_manager/deb/__init__.py index 10ad707c23..7fdfdaa4fa 100644 --- a/meta/lib/oe/package_manager/deb/__init__.py +++ b/meta/lib/oe/package_manager/deb/__init__.py | |||
@@ -287,7 +287,8 @@ class DpkgPM(OpkgDpkgPM): | |||
287 | 287 | ||
288 | try: | 288 | try: |
289 | bb.note("Installing the following packages: %s" % ' '.join(pkgs)) | 289 | bb.note("Installing the following packages: %s" % ' '.join(pkgs)) |
290 | subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT) | 290 | output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT) |
291 | bb.note(output.decode("utf-8")) | ||
291 | except subprocess.CalledProcessError as e: | 292 | except subprocess.CalledProcessError as e: |
292 | (bb.fatal, bb.warn)[attempt_only]("Unable to install packages. " | 293 | (bb.fatal, bb.warn)[attempt_only]("Unable to install packages. " |
293 | "Command '%s' returned %d:\n%s" % | 294 | "Command '%s' returned %d:\n%s" % |
@@ -343,8 +344,12 @@ class DpkgPM(OpkgDpkgPM): | |||
343 | if feed_uris == "": | 344 | if feed_uris == "": |
344 | return | 345 | return |
345 | 346 | ||
347 | |||
346 | sources_conf = os.path.join("%s/etc/apt/sources.list" | 348 | sources_conf = os.path.join("%s/etc/apt/sources.list" |
347 | % self.target_rootfs) | 349 | % self.target_rootfs) |
350 | if not os.path.exists(os.path.dirname(sources_conf)): | ||
351 | return | ||
352 | |||
348 | arch_list = [] | 353 | arch_list = [] |
349 | 354 | ||
350 | if feed_archs is None: | 355 | if feed_archs is None: |
@@ -362,11 +367,11 @@ class DpkgPM(OpkgDpkgPM): | |||
362 | if arch_list: | 367 | if arch_list: |
363 | for arch in arch_list: | 368 | for arch in arch_list: |
364 | bb.note('Adding dpkg channel at (%s)' % uri) | 369 | bb.note('Adding dpkg channel at (%s)' % uri) |
365 | sources_file.write("deb %s/%s ./\n" % | 370 | sources_file.write("deb [trusted=yes] %s/%s ./\n" % |
366 | (uri, arch)) | 371 | (uri, arch)) |
367 | else: | 372 | else: |
368 | bb.note('Adding dpkg channel at (%s)' % uri) | 373 | bb.note('Adding dpkg channel at (%s)' % uri) |
369 | sources_file.write("deb %s ./\n" % uri) | 374 | sources_file.write("deb [trusted=yes] %s ./\n" % uri) |
370 | 375 | ||
371 | def _create_configs(self, archs, base_archs): | 376 | def _create_configs(self, archs, base_archs): |
372 | base_archs = re.sub(r"_", r"-", base_archs) | 377 | base_archs = re.sub(r"_", r"-", base_archs) |
@@ -406,7 +411,7 @@ class DpkgPM(OpkgDpkgPM): | |||
406 | 411 | ||
407 | with open(os.path.join(self.apt_conf_dir, "sources.list"), "w+") as sources_file: | 412 | with open(os.path.join(self.apt_conf_dir, "sources.list"), "w+") as sources_file: |
408 | for arch in arch_list: | 413 | for arch in arch_list: |
409 | sources_file.write("deb file:%s/ ./\n" % | 414 | sources_file.write("deb [trusted=yes] file:%s/ ./\n" % |
410 | os.path.join(self.deploy_dir, arch)) | 415 | os.path.join(self.deploy_dir, arch)) |
411 | 416 | ||
412 | base_arch_list = base_archs.split() | 417 | base_arch_list = base_archs.split() |