diff options
Diffstat (limited to 'tools/dependencies')
-rwxr-xr-x | tools/dependencies/dependencies | 18 | ||||
-rwxr-xr-x | tools/dependencies/dependencies-helper | 24 |
2 files changed, 21 insertions, 21 deletions
diff --git a/tools/dependencies/dependencies b/tools/dependencies/dependencies index 13d56f74..cc9b2b38 100755 --- a/tools/dependencies/dependencies +++ b/tools/dependencies/dependencies @@ -16,35 +16,35 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. arguments() { - tool_arguments_targets "${tool}" "$@" + tool_arguments_targets "$tool" "$@" } usage() { - tool_usage_actions "${tool}" 'print' - tool_usage_arguments "${tool}" "$@" + tool_usage_actions "$tool" 'print' + tool_usage_arguments "$tool" "$@" } print() { local distro="$1" local arch="$(uname -i || uname -m)" - local tool_path="$(tool_path "${tool}")" + local tool_path="$(tool_path "$tool")" - if [[ -z "${arch}" ]]; then + if [[ -z "$arch" ]]; then printf '\n%s\n' 'uname(1) produced no output. Exiting' 1>&2 return 1 fi - dependencies_host_supported "${distro}" "${arch}" || return + dependencies_host_supported "$distro" "$arch" || return local -a dependencies - for dependency_file in "${tool_path}/${CONFIGS}/${distro}/${arch}"/*; do + for dependency_file in "$tool_path/$CONFIGS/$distro/$arch"/*; do if [[ "${dependency_file##*/}" != 'README' ]]; then local -i origin="${#dependencies[@]}" - mapfile -tO "${origin}" dependencies < "${dependency_file}" + mapfile -tO "$origin" dependencies < "$dependency_file" else continue fi @@ -53,5 +53,5 @@ print() { local -a sorted mapfile -t sorted < <(printf '%s\n' "${dependencies[@]}" | sort | uniq) - dependencies_print "${distro}" "${sorted[@]}" + dependencies_print "$distro" "${sorted[@]}" } diff --git a/tools/dependencies/dependencies-helper b/tools/dependencies/dependencies-helper index 36d2f3ea..9e02ad3c 100755 --- a/tools/dependencies/dependencies-helper +++ b/tools/dependencies/dependencies-helper @@ -19,7 +19,7 @@ dependencies_print() { local distro="$1" shift - if [[ "${distro}" == 'parabola' ]]; then + if [[ "$distro" == 'parabola' ]]; then printf '\n%s\n' 'Enable the multilib repository in /etc/pacman.conf' printf '\n%s\n' 'Then, run the following command as root:' printf '\n%s%s\n' 'pacman -S --needed ' "$*" @@ -33,19 +33,19 @@ dependencies_host_supported() { local distro="$1" local arch="$2" - dependencies_distro_supported "${distro}" || return - dependencies_arch_supported "${distro}" "${arch}" || return + dependencies_distro_supported "$distro" || return + dependencies_arch_supported "$distro" "$arch" || return } dependencies_arch_supported() { local distro="$1" local arch="$2" - local tool_path="$(tool_path "${tool}")" - local distro_dir="${tool_path}/${CONFIGS}/${distro}" + local tool_path="$(tool_path "$tool")" + local distro_dir="$tool_path/$CONFIGS/$distro" - if ! [[ -d "${distro_dir}/${arch}" ]]; then - printf '\n%s\n' "Architecture \"${arch}\" is not supported" 1>&2 + if ! [[ -d "$distro_dir/$arch" ]]; then + printf '\n%s\n' "Architecture \"$arch\" is not supported" 1>&2 return 1 fi @@ -54,17 +54,17 @@ dependencies_arch_supported() { dependencies_distro_supported() { local distro="$1" - local tool_path="$(tool_path "${tool}")" - local targets_path="${tool_path}/${CONFIGS}/${TARGETS}" + local tool_path="$(tool_path "$tool")" + local targets_path="$tool_path/$CONFIGS/$TARGETS" local -a targets_list - mapfile -t targets_list < "${targets_path}" + mapfile -t targets_list < "$targets_path" # Necessary to properly format the string for extglob use below IFS='|' eval 'local distro_list="${targets_list[*]}"' - if [[ "${distro}" != @(${distro_list}) ]]; then - printf '\n%s' "Argument \"${distro}\" is not supported. " 1>&2 + if [[ "$distro" != @($distro_list) ]]; then + printf '\n%s' "Argument \"$distro\" is not supported. " 1>&2 printf '%s\n' 'Check spelling?' 1>&2 usage |