summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2015-11-04 07:50:47 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-11-24 15:55:42 +0000
commitace895d162a5c0c913e38dbadb9e95ec70adabeb (patch)
treeaa4334eeda6e1e1f35908a9eb97b34546ed6fb64 /meta/lib
parentccb1616e5459dd31d6a1ba70dc39136b581463ac (diff)
downloadpoky-ace895d162a5c0c913e38dbadb9e95ec70adabeb.tar.gz
rootfs.py: Stop using installed_pkgs.txt
The method _uninstall_unneeded uses the file installed_pkgs.txt, this file is left after the build and can cause confusion. This changes allow to get the installed packages using functions of rootfs instead of the installed_pkgs.txt file. With this change now is possible to remove the file without breaking anything. [YOCTO #8444] (From OE-Core rev: bf935ac16f6175673417dda92a619946b52fac87) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/rootfs.py24
1 files changed, 9 insertions, 15 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 18df22d9a7..c004a5b5dd 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -243,25 +243,19 @@ class Rootfs(object):
243 # Remove components that we don't need if we're not going to install 243 # Remove components that we don't need if we're not going to install
244 # additional packages at runtime 244 # additional packages at runtime
245 if delayed_postinsts is None: 245 if delayed_postinsts is None:
246 installed_pkgs_dir = self.d.expand('${WORKDIR}/installed_pkgs.txt') 246 pkgs_installed = image_list_installed_packages(self.d)
247 pkgs_to_remove = list() 247 pkgs_to_remove = list()
248 with open(installed_pkgs_dir, "r+") as installed_pkgs: 248 for pkg in pkgs_installed.split():
249 pkgs_installed = installed_pkgs.read().splitlines() 249 if pkg in ["update-rc.d",
250 for pkg_installed in pkgs_installed[:]: 250 "base-passwd",
251 pkg = pkg_installed.split()[0] 251 "shadow",
252 if pkg in ["update-rc.d", 252 "update-alternatives", pkg_to_remove,
253 "base-passwd", 253 self.d.getVar("ROOTFS_BOOTSTRAP_INSTALL", True)
254 "shadow", 254 ]:
255 "update-alternatives", pkg_to_remove, 255 pkgs_to_remove.append(pkg)
256 self.d.getVar("ROOTFS_BOOTSTRAP_INSTALL", True)
257 ]:
258 pkgs_to_remove.append(pkg)
259 pkgs_installed.remove(pkg_installed)
260 256
261 if len(pkgs_to_remove) > 0: 257 if len(pkgs_to_remove) > 0:
262 self.pm.remove(pkgs_to_remove, False) 258 self.pm.remove(pkgs_to_remove, False)
263 # Update installed_pkgs.txt
264 open(installed_pkgs_dir, "w+").write('\n'.join(pkgs_installed))
265 259
266 else: 260 else:
267 self._save_postinsts() 261 self._save_postinsts()