[OE-core] [PATCH 2/5] package_manager.py: tweak handle_bad_recommendations for ipk incremental image generation
Hongxu Jia
hongxu.jia at windriver.com
Tue Feb 18 09:42:25 UTC 2014
Let opkg_dir be configurable in handle_bad_recommendations,
so it could work on other root fs.
Invoke handle_bad_recommendations in dump_install_solution
which simulates package install on other root fs.
[YOCTO #1894]
Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
---
meta/lib/oe/package_manager.py | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 4ea9677..3cfd4af 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -1157,12 +1157,19 @@ class OpkgPM(PackageManager):
return output
- def handle_bad_recommendations(self):
- bad_recommendations = self.d.getVar("BAD_RECOMMENDATIONS", True)
- if bad_recommendations is None:
+ def handle_bad_recommendations(self, opkg_dir=""):
+ bad_recommendations = self.d.getVar("BAD_RECOMMENDATIONS", True) or ""
+ if bad_recommendations.strip() == "":
return
- status_file = os.path.join(self.opkg_dir, "status")
+ if opkg_dir == "":
+ opkg_dir = self.opkg_dir
+ status_file = os.path.join(opkg_dir, "status")
+
+ # If status file existed, it means the bad recommendations has already
+ # been handled
+ if os.path.exists(status_file):
+ return
cmd = "%s %s info " % (self.opkg_cmd, self.opkg_args)
@@ -1177,7 +1184,7 @@ class OpkgPM(PackageManager):
"returned %d:\n%s" % (pkg_info, e.returncode, e.output))
if output == "":
- bb.note("Requested ignored recommendation $i is "
+ bb.note("Requested ignored recommendation %s is "
"not a package" % pkg)
continue
@@ -1204,6 +1211,7 @@ class OpkgPM(PackageManager):
temp_rootfs = self.d.expand('${T}/opkg')
temp_opkg_dir = os.path.join(temp_rootfs, 'var/lib/opkg')
bb.utils.mkdirhier(temp_opkg_dir)
+ self.handle_bad_recommendations(temp_opkg_dir)
opkg_args = "-f %s -o %s " % (self.config_file, temp_rootfs)
opkg_args += self.d.getVar("OPKG_ARGS", True)
--
1.8.1.2
More information about the Openembedded-core
mailing list