summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2021-01-16 11:49:11 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-16 22:39:17 +0000
commit9ec65b77c9a4a0ba240117edee0e84208c58328e (patch)
tree8dcf5ec802a36b8e2efcdb9023da0fbdcbc80508 /meta
parenta69eee72b25411880146821fe4ec07be4704afee (diff)
downloadopenembedded-core-contrib-9ec65b77c9a4a0ba240117edee0e84208c58328e.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 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/package_manager/deb/__init__.py13
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):
try:
bb.note("Installing the following packages: %s" % ' '.join(pkgs))
- subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+ output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+ bb.note(output.decode("utf-8"))
except subprocess.CalledProcessError as e:
(bb.fatal, bb.warn)[attempt_only]("Unable to install packages. "
"Command '%s' returned %d:\n%s" %
@@ -343,8 +344,12 @@ class DpkgPM(OpkgDpkgPM):
if feed_uris == "":
return
+
sources_conf = os.path.join("%s/etc/apt/sources.list"
% self.target_rootfs)
+ if not os.path.exists(os.path.dirname(sources_conf)):
+ return
+
arch_list = []
if feed_archs is None:
@@ -362,11 +367,11 @@ class DpkgPM(OpkgDpkgPM):
if arch_list:
for arch in arch_list:
bb.note('Adding dpkg channel at (%s)' % uri)
- sources_file.write("deb %s/%s ./\n" %
+ sources_file.write("deb [trusted=yes] %s/%s ./\n" %
(uri, arch))
else:
bb.note('Adding dpkg channel at (%s)' % uri)
- sources_file.write("deb %s ./\n" % uri)
+ sources_file.write("deb [trusted=yes] %s ./\n" % uri)
def _create_configs(self, archs, base_archs):
base_archs = re.sub(r"_", r"-", base_archs)
@@ -406,7 +411,7 @@ class DpkgPM(OpkgDpkgPM):
with open(os.path.join(self.apt_conf_dir, "sources.list"), "w+") as sources_file:
for arch in arch_list:
- sources_file.write("deb file:%s/ ./\n" %
+ sources_file.write("deb [trusted=yes] file:%s/ ./\n" %
os.path.join(self.deploy_dir, arch))
base_arch_list = base_archs.split()