summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2013-09-22 09:34:18 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-24 11:46:48 +0100
commitb86dc63bc87763119fce8286f37f44361da824d0 (patch)
treedc54f3995059f5df8a52c40105c1d0ee562ee1bd /meta/classes
parentfad604b719e00b03e09da5fdb485e72332275b4a (diff)
downloadopenembedded-core-b86dc63bc87763119fce8286f37f44361da824d0.tar.gz
openembedded-core-b86dc63bc87763119fce8286f37f44361da824d0.tar.bz2
openembedded-core-b86dc63bc87763119fce8286f37f44361da824d0.zip
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] 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.bbclass12
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 () {
if [ -e ${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts ]; then
remove_run_postinsts=true
fi
- rootfs_uninstall_packages update-rc.d base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}
+
+ # 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
# Need to remove rc.d files for run-postinsts by hand since opkg won't
# call postrm scripts in offline root mode.