aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAndrew Robbins <contact@andrewrobbins.info>2017-09-20 22:33:02 -0400
committerAndrew Robbins <contact@andrewrobbins.info>2017-09-21 13:26:12 -0400
commit7851c7656b66afd78cfb1c6b784b0cf89e350872 (patch)
treee9bb75e48ae1345873d886c9931fbddc2e9ecb5e /tools
parentd0577f0ab582ec32a792dc0da3b5cbe286f6f8fb (diff)
downloadlibrebootfr-7851c7656b66afd78cfb1c6b784b0cf89e350872.tar.gz
librebootfr-7851c7656b66afd78cfb1c6b784b0cf89e350872.zip
Remove braces from parameter expansions
* tools/dependencies/dependencies * tools/dependencies/dependencies-helper ditto
Diffstat (limited to 'tools')
-rwxr-xr-xtools/dependencies/dependencies18
-rwxr-xr-xtools/dependencies/dependencies-helper24
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