This commit is contained in:
monsieuremre 2023-10-27 17:36:55 +00:00 committed by GitHub
parent 46fef2a5ee
commit 9f89cf35e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,27 +1,35 @@
BUILD=.build BUILD=.build
DESTDIR=/ DESTDIR=/
for profile in "$@" for profile in "$@"
do do
cp $BUILD/apparmor.d/$profile $DESTDIR/etc/apparmor.d/$profile echo "Installing profile $profile"
grep "rPx," "$BUILD/apparmor.d/$profile" | while read l1 cp $BUILD/apparmor.d/$profile $DESTDIR/etc/apparmor.d/
grep "rPx," "${BUILD}/apparmor.d/${profile}" | while read line
do do
dep=$(echo "$l1" | awk '{print $1}') dep=$(echo "$l1" | awk '{print $1}')
dep=$(echo $dep | awk -F"/" '{print $NF}') dep=$(echo $dep | awk -F"/" '{print $NF}')
find . -type f -name $dep | while read l2 dep=$(eval "ls ${BUILD}/apparmor.d/${dep} 2>/dev/null")
do for i in $dep
if [ ! -f "$DESTDIR/etc/apparmor.d/$dep" ]; then do
install_seperate_with_depends $dep i=$(echo $i | awk -F"/" '{print $NF}')
if [ ! -f "$DESTDIR/etc/apparmor.d/$i" ]; then
bash "$0" "$i"
fi fi
done done
done done
grep "rPx -> " $BUILD/apparmor.d/$profile | while read l1 grep "rPx -> " "${BUILD}/apparmor.d/${profile}" | while read line
do do
dep=$(echo $l1 | awk '{print $NF}' | awk '{if (NR!=1) {print substr($2, 1, length($2)-1)}}') dep=${line%%#*}
find . -type f -name $dep | while read l2 dep=$(echo $dep | awk '{print $NF}')
do dep=${dep::-1}
if [ ! -f "$DESTDIR/etc/apparmor.d/$dep" ]; then dep=$(eval "ls ${BUILD}/apparmor.d/${dep} 2>/dev/null")
install_seperate_with_depends $dep for i in $dep
fi do
i=$(echo $i | awk -F"/" '{print $NF}')
if [ ! -f "$DESTDIR/etc/apparmor.d/$i" ]; then
bash "$0" "$i"
fi
done done
done done
done done