diff options
author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2015-11-04 07:50:47 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-11-24 15:55:29 +0000 |
commit | bf935ac16f6175673417dda92a619946b52fac87 (patch) | |
tree | 1719270515fe7014aa9575df3ea1e9f144d5fdbe /meta/lib | |
parent | 2d91290ab5608dd1297d1c26ab807fc4574a8a6b (diff) | |
download | openembedded-core-bf935ac16f6175673417dda92a619946b52fac87.tar.gz openembedded-core-bf935ac16f6175673417dda92a619946b52fac87.tar.bz2 openembedded-core-bf935ac16f6175673417dda92a619946b52fac87.zip |
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]
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/rootfs.py | 24 |
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): # Remove components that we don't need if we're not going to install # additional packages at runtime if delayed_postinsts is None: - installed_pkgs_dir = self.d.expand('${WORKDIR}/installed_pkgs.txt') + pkgs_installed = image_list_installed_packages(self.d) pkgs_to_remove = list() - with open(installed_pkgs_dir, "r+") as installed_pkgs: - pkgs_installed = installed_pkgs.read().splitlines() - for pkg_installed in pkgs_installed[:]: - pkg = pkg_installed.split()[0] - if pkg in ["update-rc.d", - "base-passwd", - "shadow", - "update-alternatives", pkg_to_remove, - self.d.getVar("ROOTFS_BOOTSTRAP_INSTALL", True) - ]: - pkgs_to_remove.append(pkg) - pkgs_installed.remove(pkg_installed) + for pkg in pkgs_installed.split(): + if pkg in ["update-rc.d", + "base-passwd", + "shadow", + "update-alternatives", pkg_to_remove, + self.d.getVar("ROOTFS_BOOTSTRAP_INSTALL", True) + ]: + pkgs_to_remove.append(pkg) if len(pkgs_to_remove) > 0: self.pm.remove(pkgs_to_remove, False) - # Update installed_pkgs.txt - open(installed_pkgs_dir, "w+").write('\n'.join(pkgs_installed)) else: self._save_postinsts() |