From a8d8127c73bbb5039897a9f3f3e69299e2e95aea Mon Sep 17 00:00:00 2001 From: monsieuremre <130907164+monsieuremre@users.noreply.github.com> Date: Sat, 28 Oct 2023 10:24:35 +0000 Subject: [PATCH] even more fix --- dists/partial.sh | 62 ++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/dists/partial.sh b/dists/partial.sh index 7050f3bb1..94288fba8 100644 --- a/dists/partial.sh +++ b/dists/partial.sh @@ -3,33 +3,39 @@ DESTDIR=/ for profile in "$@" do - echo "Installing profile $profile" - cp $BUILD/apparmor.d/$profile $DESTDIR/etc/apparmor.d/ - grep "rPx," "${BUILD}/apparmor.d/${profile}" | while read line - do - dep=$(echo "$l1" | awk '{print $1}') - dep=$(echo $dep | awk -F"/" '{print $NF}') - dep=$(eval "ls ${BUILD}/apparmor.d/${dep} 2>/dev/null") - for i in $dep + echo "Installing profile $profile" + cp $BUILD/apparmor.d/$profile $DESTDIR/etc/apparmor.d/ + grep "rPx," "${BUILD}/apparmor.d/${profile}" | while read line do - i=$(echo $i | awk -F"/" '{print $NF}') - if [ ! -f "$DESTDIR/etc/apparmor.d/$i" ]; then - bash "$0" "$i" - fi - done - done - grep "rPx -> " "${BUILD}/apparmor.d/${profile}" | while read line - do - dep=${line%%#*} - dep=$(echo $dep | awk '{print $NF}') - dep=${dep::-1} - dep=$(eval "ls ${BUILD}/apparmor.d/${dep} 2>/dev/null") - for i in $dep - do - i=$(echo $i | awk -F"/" '{print $NF}') - if [ ! -f "$DESTDIR/etc/apparmor.d/$i" ]; then - bash "$0" "$i" - fi - done - done + if [[ -z "$dep" ]]; then + continue + fi + dep=$(echo "$l1" | awk '{print $1}') + dep=$(echo $dep | awk -F"/" '{print $NF}') + dep=$(eval "ls ${BUILD}/apparmor.d/${dep} 2>/dev/null") + for i in $dep + do + i=$(echo $i | awk -F"/" '{print $NF}') + if [ ! -f "$DESTDIR/etc/apparmor.d/$i" ]; then + bash "$0" "$i" + fi + done + done + grep "rPx -> " "${BUILD}/apparmor.d/${profile}" | while read line + do + if [[ -z "$dep" ]]; then + continue + fi + dep=${line%%#*} + dep=$(echo $dep | awk '{print $NF}') + dep=${dep::-1} + dep=$(eval "ls ${BUILD}/apparmor.d/${dep} 2>/dev/null") + for i in $dep + do + i=$(echo $i | awk -F"/" '{print $NF}') + if [ ! -f "$DESTDIR/etc/apparmor.d/$i" ]; then + bash "$0" "$i" + fi + done + done done