]> code.ossystems Code Review - openembedded-core.git/commitdiff
opkg-utils: clear update-alternatives database on uninstall
authorAndré Draszik <adraszik@tycoint.com>
Thu, 10 Nov 2016 10:46:19 +0000 (10:46 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 23 Nov 2016 11:02:27 +0000 (11:02 +0000)
When uninstalling update-alternatives, it doesn't seem to
make much sense to keep the update-alternatives database
around.
In particular when removing packaging data, e.g. due to
read-only rootfs, update-alternatives is removed from
the target file system. Leaving its database around
serves no purpose in that case as there is no way to
use it afterwards anyway.

This frees close to 700KB of (uncompressed) space in
a busybox based environment.

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb

index a7aec45f8d3e1d274548bbfd9d69eb5f5a190816..19a852ec627e686f582808bdad77c2b6d4c38770 100644 (file)
@@ -43,4 +43,9 @@ RPROVIDES_update-alternatives-opkg = "update-alternatives update-alternatives-cw
 RREPLACES_update-alternatives-opkg = "update-alternatives-cworth"
 RCONFLICTS_update-alternatives-opkg = "update-alternatives-cworth"
 
+pkg_postrm_update-alternatives-opkg() {
+       rm -rf $OPKG_OFFLINE_ROOT${nonarch_libdir}/opkg/alternatives
+       rmdir --ignore-fail-on-non-empty $OPKG_OFFLINE_ROOT${nonarch_libdir}/opkg
+}
+
 BBCLASSEXTEND = "native nativesdk"