From b41729958ac419db4b527804101d14d4fc826b40 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 13 Oct 2014 20:11:42 +0100 Subject: [PATCH] Clean up duplicate AppArmor cache entries between rootfs and custom. --- .../hooks/90-precompile-apparmor-policies.chroot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/live-build/ubuntu-touch/hooks/90-precompile-apparmor-policies.chroot b/live-build/ubuntu-touch/hooks/90-precompile-apparmor-policies.chroot index f17a937b..664379b0 100755 --- a/live-build/ubuntu-touch/hooks/90-precompile-apparmor-policies.chroot +++ b/live-build/ubuntu-touch/hooks/90-precompile-apparmor-policies.chroot @@ -29,10 +29,10 @@ for manifest in /var/lib/apparmor/clicks/*; do version="${pkgdir##*/}" pkgdir_noversion="${pkgdir%/*}" name="${pkgdir_noversion##*/}" + profile="$(basename "$manifest" .json)" if [ -d "/custom/click/$name/$version" ]; then # Clone into custom. ln -nsf "/custom/click/$name/$version$manifest_tail" "/custom/lib/apparmor/clicks/${manifest##*/}" - profile="$(basename "$manifest" .json)" cp -a "/var/lib/apparmor/profiles/click_$profile" /custom/lib/apparmor/profiles/ if [ -d "/usr/share/click/preinstalled/$name/$version" ]; then # Ensure that the version in the rootfs points to @@ -42,6 +42,10 @@ for manifest in /var/lib/apparmor/clicks/*; do # Remove from the rootfs. rm -f "$manifest" rm -f "/var/lib/apparmor/profiles/click_$profile" + rm -f "/var/cache/apparmor/click_$profile" fi + else + # Remove from custom. + rm -f "/custom/cache/apparmor/click_$profile" fi done