diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index c4494da..4e68562 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -41,7 +41,7 @@ get_dependencies() { package=$1 prefix=$2 list_deps="$(grep "${package#*-}" "${script_dir:?}"/../lists/linux-deps | cut -d '=' -f 2 | grep -Eo "$prefix.*")" - package_deps="$(sed -e '/Package:\s'"$package$"'/,/^\s*$/!d' /tmp/Packages | grep -Eo "^Depends.*" | tr ',' '\n' | awk -v ORS='' '/^\s'"$prefix"'/{print$0}' | sed -e 's/([^()]*)//g' | sort | uniq | xargs echo -n)" + IFS=$'\n' read -d '' -r -a package_deps < <(sed -n '/Package:\s'"$package"'/,/^$/p' /tmp/Packages | grep '^Depends:' | cut -d ':' -f2- | tr ',' '\n' | grep -E '^\s*'"$prefix" | cut -d '(' -f1 | sed 's/^\s*//;s/\s*$//' | sort -u); deps=() [[ -n "${list_deps[*]}" ]] && deps+=("${list_deps[@]}") [[ -n "${package_deps[*]}" ]] && deps+=("${package_deps[@]}")