From 9a2e2eac565d80ef6d23370655b82f5561e87ee4 Mon Sep 17 00:00:00 2001 From: monsieuremre <130907164+monsieuremre@users.noreply.github.com> Date: Thu, 26 Oct 2023 14:27:51 +0000 Subject: [PATCH] partial.sh --- dists/partial.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 dists/partial.sh diff --git a/dists/partial.sh b/dists/partial.sh new file mode 100644 index 000000000..53a1158da --- /dev/null +++ b/dists/partial.sh @@ -0,0 +1,27 @@ +BUILD=.build +DESTDIR=/ +for profile in "$@" +do + cp $BUILD/apparmor.d/$profile $DESTDIR/etc/apparmor.d/$profile + grep "rPx," "$BUILD/apparmor.d/$profile" | while read l1 + do + dep=$(echo "$l1" | awk '{print $1}') + dep=$(echo $dep | awk -F"/" '{print $NF}') + find . -type f -name $dep | while read l2 + do + if [ ! -f "$DESTDIR/etc/apparmor.d/$dep" ]; then + install_seperate_with_depends $dep + fi + done + done + grep "rPx -> " $BUILD/apparmor.d/$profile | while read l1 + do + dep=$(echo $l1 | awk '{print $NF}' | awk '{if (NR!=1) {print substr($2, 1, length($2)-1)}}') + find . -type f -name $dep | while read l2 + do + if [ ! -f "$DESTDIR/etc/apparmor.d/$dep" ]; then + install_seperate_with_depends $dep + fi + done + done +done