Skip to content

Commit 106ba63

Browse files
committed
tree-wide: Indent .bash files like .sh
1 parent 54b3f32 commit 106ba63

File tree

5 files changed

+74
-74
lines changed

5 files changed

+74
-74
lines changed

maintainers/scripts/bootstrap-files/refresh-tarballs.bash

+43-43
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ Synopsis:
3535
This is usually done in the following cases:
3636
3737
1. Single target fix: current bootstrap files for a single target
38-
are problematic for some reason (target-specific bug). In this
39-
case we can refresh just that target as:
38+
are problematic for some reason (target-specific bug). In this
39+
case we can refresh just that target as:
4040
41-
\$ $0 --commit --targets=i686-unknown-linux-gnu
41+
\$ $0 --commit --targets=i686-unknown-linux-gnu
4242
4343
2. Routine refresh: all bootstrap files should be refreshed to avoid
44-
debugging problems that only occur on very old binaries.
44+
debugging problems that only occur on very old binaries.
4545
46-
\$ $0 --commit --all-targets
46+
\$ $0 --commit --all-targets
4747
4848
To get help on uploading refreshed binaries to 'tarballs.nixos.org'
4949
please have a look at <maintainers/scripts/bootstrap-files/README.md>.
@@ -232,50 +232,50 @@ for target in "${targets[@]}"; do
232232
# - build time: ${build_time}
233233
{
234234
EOF
235-
for p in "${outpath}/on-server"/*; do
236-
fname=$(basename "$p")
237-
fnames+=("$fname")
238-
case "$fname" in
239-
bootstrap-tools.tar.xz) attr=bootstrapTools ;;
240-
busybox) attr=$fname ;;
241-
unpack.nar.xz) attr=unpack ;;
242-
*) die "Don't know how to map '$fname' to attribute name. Please update me."
243-
esac
244-
245-
executable_arg=
246-
executable_nix=
247-
if [[ -x "$p" ]]; then
248-
executable_arg="--executable"
249-
executable_nix="executable = true;"
250-
fi
251-
unpack_nix=
252-
name_nix=
253-
if [[ $fname = *.nar.xz ]]; then
254-
unpack_nix="unpack = true;"
255-
name_nix="name = \"${fname%.nar.xz}\";"
256-
sri=$(nar_sri_get "$p" "${fname%.nar.xz}")
257-
[[ $? -ne 0 ]] && die "Failed to get hash of '$p'"
258-
else
259-
sha256=$(nix-prefetch-url $executable_arg --name "$fname" "file://$p")
260-
[[ $? -ne 0 ]] && die "Failed to get the hash for '$p'"
261-
sri=$(nix-hash --to-sri "sha256:$sha256")
262-
[[ $? -ne 0 ]] && die "Failed to convert '$sha256' hash to an SRI form"
263-
fi
264-
265-
# individual file entries
266-
cat <<EOF
267-
$attr = import <nix/fetchurl.nix> {
235+
for p in "${outpath}/on-server"/*; do
236+
fname=$(basename "$p")
237+
fnames+=("$fname")
238+
case "$fname" in
239+
bootstrap-tools.tar.xz) attr=bootstrapTools ;;
240+
busybox) attr=$fname ;;
241+
unpack.nar.xz) attr=unpack ;;
242+
*) die "Don't know how to map '$fname' to attribute name. Please update me."
243+
esac
244+
245+
executable_arg=
246+
executable_nix=
247+
if [[ -x "$p" ]]; then
248+
executable_arg="--executable"
249+
executable_nix="executable = true;"
250+
fi
251+
unpack_nix=
252+
name_nix=
253+
if [[ $fname = *.nar.xz ]]; then
254+
unpack_nix="unpack = true;"
255+
name_nix="name = \"${fname%.nar.xz}\";"
256+
sri=$(nar_sri_get "$p" "${fname%.nar.xz}")
257+
[[ $? -ne 0 ]] && die "Failed to get hash of '$p'"
258+
else
259+
sha256=$(nix-prefetch-url $executable_arg --name "$fname" "file://$p")
260+
[[ $? -ne 0 ]] && die "Failed to get the hash for '$p'"
261+
sri=$(nix-hash --to-sri "sha256:$sha256")
262+
[[ $? -ne 0 ]] && die "Failed to convert '$sha256' hash to an SRI form"
263+
fi
264+
265+
# individual file entries
266+
cat <<EOF
267+
$attr = import <nix/fetchurl.nix> {
268268
url = "http://tarballs.nixos.org/${s3_prefix}/${nixpkgs_revision}/$fname";
269269
hash = "${sri}";$(
270270
[[ -n ${executable_nix} ]] && printf "\n %s" "${executable_nix}"
271271
[[ -n ${name_nix} ]] && printf "\n %s" "${name_nix}"
272272
[[ -n ${unpack_nix} ]] && printf "\n %s" "${unpack_nix}"
273-
)
274-
};
273+
)
274+
};
275275
EOF
276-
done
277-
# footer
278-
cat <<EOF
276+
done
277+
# footer
278+
cat <<EOF
279279
}
280280
EOF
281281
} > "${target_file}"

pkgs/build-support/php/builders/v1/hooks/php-script-utils.bash

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ checkComposerValidate() {
2424
setComposerRootVersion
2525

2626
if [ "1" == "${composerGlobal-}" ]; then
27-
global="global";
27+
global="global";
2828
else
29-
global="";
29+
global="";
3030
fi
3131

3232
command="composer ${global} validate --strict --quiet --no-interaction --no-check-all --no-check-lock"

pkgs/build-support/php/builders/v2/hooks/php-script-utils.bash

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ setComposerEnvVariables() {
2222

2323
checkComposerValidate() {
2424
if [ "1" == "${composerGlobal-}" ]; then
25-
global="global";
25+
global="global";
2626
else
27-
global="";
27+
global="";
2828
fi
2929

3030
command="composer ${global} validate --strict --quiet --no-interaction --no-check-all --no-check-lock"

pkgs/development/compilers/dotnet/completions/dotnet.bash

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
function _dotnet_bash_complete()
44
{
5-
local cur="${COMP_WORDS[COMP_CWORD]}" IFS=$'\n' # On Windows you may need to use use IFS=$'\r\n'
6-
local candidates
5+
local cur="${COMP_WORDS[COMP_CWORD]}" IFS=$'\n' # On Windows you may need to use use IFS=$'\r\n'
6+
local candidates
77

8-
read -d '' -ra candidates < <(dotnet complete --position "${COMP_POINT}" "${COMP_LINE}" 2>/dev/null)
8+
read -d '' -ra candidates < <(dotnet complete --position "${COMP_POINT}" "${COMP_LINE}" 2>/dev/null)
99

10-
read -d '' -ra COMPREPLY < <(compgen -W "${candidates[*]:-}" -- "$cur")
10+
read -d '' -ra COMPREPLY < <(compgen -W "${candidates[*]:-}" -- "$cur")
1111
}
1212

1313
complete -f -F _dotnet_bash_complete dotnet

pkgs/development/python-modules/av/update-test-samples.bash

+23-23
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,40 @@ set -o errexit
44
set -o nounset
55

66
if test "$#" != 1; then
7-
printf >&2 'usage: update-test-samples.bash /path/to/PyAV/source\n'
8-
exit 2
7+
printf >&2 'usage: update-test-samples.bash /path/to/PyAV/source\n'
8+
exit 2
99
fi
1010

1111
pyav_source=$1
1212

1313
exec > "$(dirname "$(readlink -f "$0")")/test-samples.toml"
1414

1515
fetch() {
16-
path=$1
17-
url=$2
18-
prefetch_json=$(nix store prefetch-file --json "${url}")
19-
sri_hash=$(jq -r .hash <<< "${prefetch_json}")
20-
printf '"%s" = { url = "%s", hash = "%s" }\n' "${path}" "${url}" "${sri_hash}"
16+
path=$1
17+
url=$2
18+
prefetch_json=$(nix store prefetch-file --json "${url}")
19+
sri_hash=$(jq -r .hash <<< "${prefetch_json}")
20+
printf '"%s" = { url = "%s", hash = "%s" }\n' "${path}" "${url}" "${sri_hash}"
2121
}
2222

2323
fetch_all() {
24-
function=$1
25-
base_path=$2
26-
base_url=$3
27-
28-
samples=$(
29-
rg \
30-
--only-matching \
31-
--no-filename \
32-
"\\b${function}\\([\"']([^\"']+)[\"']\\)" \
33-
--replace '$1' \
34-
"${pyav_source}"
35-
)
36-
unique_samples=$(sort -u <<< "${samples}")
37-
38-
while IFS= read -r sample; do
24+
function=$1
25+
base_path=$2
26+
base_url=$3
27+
28+
samples=$(
29+
rg \
30+
--only-matching \
31+
--no-filename \
32+
"\\b${function}\\([\"']([^\"']+)[\"']\\)" \
33+
--replace '$1' \
34+
"${pyav_source}"
35+
)
36+
unique_samples=$(sort -u <<< "${samples}")
37+
38+
while IFS= read -r sample; do
3939
fetch "${base_path}/${sample}" "${base_url}/${sample}"
40-
done <<< "${unique_samples}"
40+
done <<< "${unique_samples}"
4141
}
4242

4343
fetch_all fate_suite fate-suite "http://fate.ffmpeg.org/fate-suite"

0 commit comments

Comments
 (0)