diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2013-09-22 09:34:18 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-24 17:24:12 +0100 |
commit | 80203494aa4ac9a1c6b724f8ad7f50a533895138 (patch) | |
tree | 3bc08448414f7a4e55afdd8afa006c8c16611d9e /meta/classes | |
parent | 8c5f3454971074d3f1de7bcde9481e881221e076 (diff) | |
download | poky-80203494aa4ac9a1c6b724f8ad7f50a533895138.tar.gz |
image.bbclass: uninstall package only if it's already installed
Remove a package from rootfs only if it's already installed. Also,
if a package is uninstalled, remove it from installed_pkgs.txt.
[YOCTO #5169]
(From OE-Core rev: b86dc63bc87763119fce8286f37f44361da824d0)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/image.bbclass | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 246a4db7fc..7650594f8c 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
@@ -513,7 +513,17 @@ rootfs_uninstall_unneeded () { | |||
513 | if [ -e ${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts ]; then | 513 | if [ -e ${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts ]; then |
514 | remove_run_postinsts=true | 514 | remove_run_postinsts=true |
515 | fi | 515 | fi |
516 | rootfs_uninstall_packages update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL} | 516 | |
517 | # Remove package only if it's installed | ||
518 | pkgs_to_remove="update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}" | ||
519 | for pkg in $pkgs_to_remove; do | ||
520 | # regexp for pkg, to be used in grep and sed | ||
521 | pkg_regexp="^`echo $pkg | sed 's/\./\\\./'` " | ||
522 | if grep -q "$pkg_regexp" ${WORKDIR}/installed_pkgs.txt; then | ||
523 | rootfs_uninstall_packages $pkg | ||
524 | sed -i "/$pkg_regexp/d" ${WORKDIR}/installed_pkgs.txt | ||
525 | fi | ||
526 | done | ||
517 | 527 | ||
518 | # Need to remove rc.d files for run-postinsts by hand since opkg won't | 528 | # Need to remove rc.d files for run-postinsts by hand since opkg won't |
519 | # call postrm scripts in offline root mode. | 529 | # call postrm scripts in offline root mode. |