.editorconfig: Format .bash files like .sh (#354885)

authored by scrumplex.net and committed by GitHub 2115f02b 3915d872

+72 -72
+2 -2
.editorconfig
··· 24 24 # see https://nixos.org/nixpkgs/manual/#chap-conventions 25 25 26 26 # Match json/lockfiles/markdown/nix/perl/python/ruby/shell/docbook files, set indent to spaces 27 - [*.{json,lock,md,nix,pl,pm,py,rb,sh,xml}] 27 + [*.{bash,json,lock,md,nix,pl,pm,py,rb,sh,xml}] 28 28 indent_style = space 29 29 30 30 # Match docbook files, set indent width of one ··· 36 36 indent_size = 2 37 37 38 38 # Match perl/python/shell scripts, set indent width of four 39 - [*.{pl,pm,py,sh}] 39 + [*.{bash,pl,pm,py,sh}] 40 40 indent_size = 4 41 41 42 42 # Match gemfiles, set indent to spaces with width of two
+41 -41
maintainers/scripts/bootstrap-files/refresh-tarballs.bash
··· 35 35 This is usually done in the following cases: 36 36 37 37 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: 40 40 41 - \$ $0 --commit --targets=i686-unknown-linux-gnu 41 + \$ $0 --commit --targets=i686-unknown-linux-gnu 42 42 43 43 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. 45 45 46 - \$ $0 --commit --all-targets 46 + \$ $0 --commit --all-targets 47 47 48 48 To get help on uploading refreshed binaries to 'tarballs.nixos.org' 49 49 please have a look at <maintainers/scripts/bootstrap-files/README.md>. ··· 232 232 # - build time: ${build_time} 233 233 { 234 234 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 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 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 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 264 265 - # individual file entries 266 - cat <<EOF 267 - $attr = import <nix/fetchurl.nix> { 265 + # individual file entries 266 + cat <<EOF 267 + $attr = import <nix/fetchurl.nix> { 268 268 url = "http://tarballs.nixos.org/${s3_prefix}/${nixpkgs_revision}/$fname"; 269 269 hash = "${sri}";$( 270 270 [[ -n ${executable_nix} ]] && printf "\n %s" "${executable_nix}" 271 271 [[ -n ${name_nix} ]] && printf "\n %s" "${name_nix}" 272 272 [[ -n ${unpack_nix} ]] && printf "\n %s" "${unpack_nix}" 273 - ) 274 - }; 273 + ) 274 + }; 275 275 EOF 276 - done 277 - # footer 278 - cat <<EOF 276 + done 277 + # footer 278 + cat <<EOF 279 279 } 280 280 EOF 281 281 } > "${target_file}"
+2 -2
pkgs/build-support/php/builders/v1/hooks/php-script-utils.bash
··· 24 24 setComposerRootVersion 25 25 26 26 if [ "1" == "${composerGlobal-}" ]; then 27 - global="global"; 27 + global="global"; 28 28 else 29 - global=""; 29 + global=""; 30 30 fi 31 31 32 32 command="composer ${global} validate --strict --quiet --no-interaction --no-check-all --no-check-lock"
+2 -2
pkgs/build-support/php/builders/v2/hooks/php-script-utils.bash
··· 22 22 23 23 checkComposerValidate() { 24 24 if [ "1" == "${composerGlobal-}" ]; then 25 - global="global"; 25 + global="global"; 26 26 else 27 - global=""; 27 + global=""; 28 28 fi 29 29 30 30 command="composer ${global} validate --strict --quiet --no-interaction --no-check-all --no-check-lock"
+4 -4
pkgs/development/compilers/dotnet/completions/dotnet.bash
··· 2 2 3 3 function _dotnet_bash_complete() 4 4 { 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 7 7 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) 9 9 10 - read -d '' -ra COMPREPLY < <(compgen -W "${candidates[*]:-}" -- "$cur") 10 + read -d '' -ra COMPREPLY < <(compgen -W "${candidates[*]:-}" -- "$cur") 11 11 } 12 12 13 13 complete -f -F _dotnet_bash_complete dotnet
+21 -21
pkgs/development/python-modules/av/update-test-samples.bash
··· 4 4 set -o nounset 5 5 6 6 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 9 9 fi 10 10 11 11 pyav_source=$1 ··· 13 13 exec > "$(dirname "$(readlink -f "$0")")/test-samples.toml" 14 14 15 15 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}" 21 21 } 22 22 23 23 fetch_all() { 24 - function=$1 25 - base_path=$2 26 - base_url=$3 24 + function=$1 25 + base_path=$2 26 + base_url=$3 27 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}") 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 37 38 - while IFS= read -r sample; do 38 + while IFS= read -r sample; do 39 39 fetch "${base_path}/${sample}" "${base_url}/${sample}" 40 - done <<< "${unique_samples}" 40 + done <<< "${unique_samples}" 41 41 } 42 42 43 43 fetch_all fate_suite fate-suite "http://fate.ffmpeg.org/fate-suite"