summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2019-10-17 15:21:40 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-10-17 15:45:28 (GMT)
commit2c5af52109bca8c0452b1539589cf073f6f0064a (patch)
treeff8362e1a1792f6074bce3c6980482f7f85137e1
parent47925dc5f93c19d44dcecacb3afb5893a851a4e4 (diff)
downloadpoky-2c5af52109bca8c0452b1539589cf073f6f0064a.tar.gz
Revert "OpkgPM: use --add-ignore-recommends to process BAD_RECOMMENDATIONS"
This reverts commit e8cd30ba6cec854d85c7ad47edc208107858a5d7. This backport introduced an issue not seen the AB QA. Issue can be seen if BAD_RECOMMENDATIONS_append = " udev-hwdb" is used (From OE-Core rev: 5110080fbecd3f1cf43797c7eeb742951d88d1a8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oe/package_manager.py41
-rw-r--r--meta/lib/oe/rootfs.py2
2 files changed, 41 insertions, 2 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 7d88048..882e7c4 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -1329,8 +1329,6 @@ class OpkgPM(OpkgDpkgPM):
1329 cmd = "%s %s" % (self.opkg_cmd, self.opkg_args) 1329 cmd = "%s %s" % (self.opkg_cmd, self.opkg_args)
1330 for exclude in (self.d.getVar("PACKAGE_EXCLUDE") or "").split(): 1330 for exclude in (self.d.getVar("PACKAGE_EXCLUDE") or "").split():
1331 cmd += " --add-exclude %s" % exclude 1331 cmd += " --add-exclude %s" % exclude
1332 for bad_recommendation in (self.d.getVar("BAD_RECOMMENDATIONS") or "").split():
1333 cmd += " --add-ignore-recommends %s" % bad_recommendation
1334 cmd += " install " 1332 cmd += " install "
1335 cmd += " ".join(pkgs) 1333 cmd += " ".join(pkgs)
1336 1334
@@ -1399,6 +1397,45 @@ class OpkgPM(OpkgDpkgPM):
1399 def list_installed(self): 1397 def list_installed(self):
1400 return OpkgPkgsList(self.d, self.target_rootfs, self.config_file).list_pkgs() 1398 return OpkgPkgsList(self.d, self.target_rootfs, self.config_file).list_pkgs()
1401 1399
1400 def handle_bad_recommendations(self):
1401 bad_recommendations = self.d.getVar("BAD_RECOMMENDATIONS") or ""
1402 if bad_recommendations.strip() == "":
1403 return
1404
1405 status_file = os.path.join(self.opkg_dir, "status")
1406
1407 # If status file existed, it means the bad recommendations has already
1408 # been handled
1409 if os.path.exists(status_file):
1410 return
1411
1412 cmd = "%s %s info " % (self.opkg_cmd, self.opkg_args)
1413
1414 with open(status_file, "w+") as status:
1415 for pkg in bad_recommendations.split():
1416 pkg_info = cmd + pkg
1417
1418 try:
1419 output = subprocess.check_output(pkg_info.split(), stderr=subprocess.STDOUT).strip().decode("utf-8")
1420 except subprocess.CalledProcessError as e:
1421 bb.fatal("Cannot get package info. Command '%s' "
1422 "returned %d:\n%s" % (pkg_info, e.returncode, e.output.decode("utf-8")))
1423
1424 if output == "":
1425 bb.note("Ignored bad recommendation: '%s' is "
1426 "not a package" % pkg)
1427 continue
1428
1429 for line in output.split('\n'):
1430 if line.startswith("Status:"):
1431 status.write("Status: deinstall hold not-installed\n")
1432 else:
1433 status.write(line + "\n")
1434
1435 # Append a blank line after each package entry to ensure that it
1436 # is separated from the following entry
1437 status.write("\n")
1438
1402 def dummy_install(self, pkgs): 1439 def dummy_install(self, pkgs):
1403 """ 1440 """
1404 The following function dummy installs pkgs and returns the log of output. 1441 The following function dummy installs pkgs and returns the log of output.
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index aa9fb2e..e5512d0 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -879,6 +879,8 @@ class OpkgRootfs(DpkgOpkgRootfs):
879 879
880 self.pm.update() 880 self.pm.update()
881 881
882 self.pm.handle_bad_recommendations()
883
882 if self.progress_reporter: 884 if self.progress_reporter:
883 self.progress_reporter.next_stage() 885 self.progress_reporter.next_stage()
884 886