rootfs.py: fix uninstall uneeded pkgs failed
authorHongxu Jia <hongxu.jia@windriver.com>
Sun, 26 Jan 2014 10:09:47 +0000 (18:09 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 11 Feb 2014 11:53:41 +0000 (11:53 +0000)
commit70f5b7822c56977582d23a4b2676a4c3a1031415
tree085dc0243f6c1b1186b05223f5d874e7428c85b8
parentc3e5ac76c4e436f32aee8af2a11ed9fde9e21a69
rootfs.py: fix uninstall uneeded pkgs failed

The refactor of shell function rootfs_uninstall_unneeded is incorrect,
it should check and update the installed_pkgs.txt file for the existance
of the packages that were removed.
...
rootfs_uninstall_unneeded () {
    if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then
        if [ -z "$(delayed_postinsts)" ]; then
            # All packages were successfully configured.
            # update-rc.d, base-passwd, run-postinsts are no further
            # use, remove them now
            remove_run_postinsts=false
            if [ -e ${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts ]; then
                remove_run_postinsts=true
            fi

            # Remove package only if it's installed
            pkgs_to_remove="update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
            for pkg in $pkgs_to_remove; do
                # regexp for pkg, to be used in grep and sed
                pkg_regexp="^`echo $pkg | sed 's/\./\\\./'` "
                if grep -q "$pkg_regexp" ${WORKDIR}/installed_pkgs.txt; then
                rootfs_uninstall_packages $pkg
                sed -i "/$pkg_regexp/d" ${WORKDIR}/installed_pkgs.txt
                fi
            done
...

(From OE-Core rev: 9cdecb3935962653733705ad6313558bfd4fda29)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/rootfs.py