diff options
author | Victor Engmark <victor@engmark.name> | 2021-11-14 15:54:33 +1300 |
---|---|---|
committer | Victor Engmark <victor@engmark.name> | 2021-11-14 16:04:46 +1300 |
commit | 57b496ea98bdbd633c48f16af1c69a196aaf963a (patch) | |
tree | e12cd5e6735aa44ae5725d8210b933de4a1234aa /pkgs/development/perl-modules | |
parent | 90dbec47b7c8eff5262fda73d97335fb29e079fa (diff) |
misc: Replace tab indentation with spaces
I've tried to be consistent, using four or eight spaces to line up with existing code.
Diffstat (limited to 'pkgs/development/perl-modules')
9 files changed, 60 insertions, 62 deletions
diff --git a/pkgs/development/perl-modules/expression-generator/filtered-requirements.sh b/pkgs/development/perl-modules/expression-generator/filtered-requirements.sh index 98c01508fd5a3..2e3509d68c12c 100755 --- a/pkgs/development/perl-modules/expression-generator/filtered-requirements.sh +++ b/pkgs/development/perl-modules/expression-generator/filtered-requirements.sh @@ -3,13 +3,13 @@ source lib-cache.sh; print_reqs() { - module_name="$1"; + module_name="$1"; - ./requirements.sh "$1"| while read; do - if let "$(./source-download-link.sh "${REPLY}" | wc -c)" && [ perl != "$REPLY" ]; then - echo "$REPLY"; - fi; - done; + ./requirements.sh "$1"| while read; do + if let "$(./source-download-link.sh "${REPLY}" | wc -c)" && [ perl != "$REPLY" ]; then + echo "$REPLY"; + fi; + done; } module_name="$1"; diff --git a/pkgs/development/perl-modules/expression-generator/full-requirements.sh b/pkgs/development/perl-modules/expression-generator/full-requirements.sh index 29ed83668ed55..91218f36f609b 100755 --- a/pkgs/development/perl-modules/expression-generator/full-requirements.sh +++ b/pkgs/development/perl-modules/expression-generator/full-requirements.sh @@ -3,19 +3,19 @@ source lib-cache.sh; print_requirements () { - module_name="$1"; + module_name="$1"; - ./requirements.sh "$module_name" | while read; do - echo "$REPLY"; - print_reqs_cache "$REPLY"; - done | sort | uniq + ./requirements.sh "$module_name" | while read; do + echo "$REPLY"; + print_reqs_cache "$REPLY"; + done | sort | uniq }; print_reqs_cache () { - module_name="$1"; - module_basename="${module_name//::/-}"; - - cached_output print_requirements "$module_basename" "$module_name" "full.deps"; + module_name="$1"; + module_basename="${module_name//::/-}"; + + cached_output print_requirements "$module_basename" "$module_name" "full.deps"; }; print_reqs_cache "$@"; diff --git a/pkgs/development/perl-modules/expression-generator/grab-url.sh b/pkgs/development/perl-modules/expression-generator/grab-url.sh index 809cf87fcebf1..8935cad8cefe3 100755 --- a/pkgs/development/perl-modules/expression-generator/grab-url.sh +++ b/pkgs/development/perl-modules/expression-generator/grab-url.sh @@ -3,13 +3,13 @@ source lib-cache.sh get_file() { - url="$1"; + url="$1"; - if [ -n "$url" ]; then - curl "$1"; - else - echo -n; - fi; + if [ -n "$url" ]; then + curl "$1"; + else + echo -n; + fi; } url="$1"; @@ -17,4 +17,3 @@ name="$2"; name=${name:-$(basename "$url")} cached_output get_file "${name%%.*}" "$url" "${name#*.}" - diff --git a/pkgs/development/perl-modules/expression-generator/lib-cache.sh b/pkgs/development/perl-modules/expression-generator/lib-cache.sh index 7473e2d1c15ed..65095144bcd68 100644 --- a/pkgs/development/perl-modules/expression-generator/lib-cache.sh +++ b/pkgs/development/perl-modules/expression-generator/lib-cache.sh @@ -4,16 +4,15 @@ # Third argument: argument to command # Fourth argument: cache type cached_output () { - cmd="$1"; - basename="$2"; - arg="$3"; - ext="$4"; - - if ! [ -e "cache-${ext//./-}/${basename}.${ext}" ]; then - mkdir -p "cache-${ext//./-}"; - $cmd $arg > "cache-${ext//./-}/${basename}.${ext}"; - fi; + cmd="$1"; + basename="$2"; + arg="$3"; + ext="$4"; - cat "cache-${ext//./-}/${basename}.${ext}"; -} + if ! [ -e "cache-${ext//./-}/${basename}.${ext}" ]; then + mkdir -p "cache-${ext//./-}"; + $cmd $arg > "cache-${ext//./-}/${basename}.${ext}"; + fi; + cat "cache-${ext//./-}/${basename}.${ext}"; +} diff --git a/pkgs/development/perl-modules/expression-generator/requirements.sh b/pkgs/development/perl-modules/expression-generator/requirements.sh index 60ee68d99adaf..19b24c55a8eed 100755 --- a/pkgs/development/perl-modules/expression-generator/requirements.sh +++ b/pkgs/development/perl-modules/expression-generator/requirements.sh @@ -6,12 +6,12 @@ module_name="$1"; module_basename="${1//::/-}"; print_requirements () { - module_name="$1"; - - ./retrieve-meta-yaml.sh "$module_name" | - sed -re '1,/^requires:/d; /^[a-z]/,$d; s@^\s*@@; s@:\s.*@@'; - ./retrieve-meta-yaml.sh "$module_name" | - sed -re '1,/^build_requires:/d; /^[a-z]/,$d; s@^\s*@@; s@:\s.*@@'; + module_name="$1"; + + ./retrieve-meta-yaml.sh "$module_name" | + sed -re '1,/^requires:/d; /^[a-z]/,$d; s@^\s*@@; s@:\s.*@@'; + ./retrieve-meta-yaml.sh "$module_name" | + sed -re '1,/^build_requires:/d; /^[a-z]/,$d; s@^\s*@@; s@:\s.*@@'; }; cached_output print_requirements "$module_basename" "$module_name" "direct.deps"; diff --git a/pkgs/development/perl-modules/expression-generator/retrieve-file-link.sh b/pkgs/development/perl-modules/expression-generator/retrieve-file-link.sh index a9cf0d94e0d3f..c8ec5df11b7dd 100755 --- a/pkgs/development/perl-modules/expression-generator/retrieve-file-link.sh +++ b/pkgs/development/perl-modules/expression-generator/retrieve-file-link.sh @@ -6,9 +6,9 @@ file_name="$2"; version_regexp="${module_basename}(-[0-9.a-z]+){0,1}"; author_regexp="[A-Z0-9]+"; -./retrieve-modulepage.sh "$module_basename" | - egrep "[<]a href=\"[a-z0-9/]*/(${author_regexp}/){0,1}${version_regexp}/${file_name}" | - sed -re "s@.*href=\"@@; s@\".*@@" | - sed -re 's@^/@http://search.cpan.org/@'; +./retrieve-modulepage.sh "$module_basename" | + egrep "[<]a href=\"[a-z0-9/]*/(${author_regexp}/){0,1}${version_regexp}/${file_name}" | + sed -re "s@.*href=\"@@; s@\".*@@" | + sed -re 's@^/@http://search.cpan.org/@'; echo "$link_line"; diff --git a/pkgs/development/perl-modules/expression-generator/retrieve-meta-yaml.sh b/pkgs/development/perl-modules/expression-generator/retrieve-meta-yaml.sh index 2c85d45691f09..3b162ebe693fe 100755 --- a/pkgs/development/perl-modules/expression-generator/retrieve-meta-yaml.sh +++ b/pkgs/development/perl-modules/expression-generator/retrieve-meta-yaml.sh @@ -3,11 +3,11 @@ source lib-cache.sh; print_meta_yaml () { - module_name="$1"; - module_basename="${module_name//::/-}"; + module_name="$1"; + module_basename="${module_name//::/-}"; - ./grab-url.sh "$(./retrieve-file-link.sh "$module_basename" "META.yml")" \ - "${module_basename}.meta.yml"; + ./grab-url.sh "$(./retrieve-file-link.sh "$module_basename" "META.yml")" \ + "${module_basename}.meta.yml"; }; module_name="$1"; diff --git a/pkgs/development/perl-modules/expression-generator/source-download-link.sh b/pkgs/development/perl-modules/expression-generator/source-download-link.sh index 575f47629c26b..779d131961f07 100755 --- a/pkgs/development/perl-modules/expression-generator/source-download-link.sh +++ b/pkgs/development/perl-modules/expression-generator/source-download-link.sh @@ -6,12 +6,12 @@ module_name="$1"; module_basename="${module_name//::/-}"; write_link() { - module_basename="$1"; + module_basename="$1"; - ./retrieve-modulepage.sh "$module_basename" | - grep -A 2 "This Release" | - grep href | - sed -re 's/.*href="//; s/".*//; s@^/@http://search.cpan.org/@'; + ./retrieve-modulepage.sh "$module_basename" | + grep -A 2 "This Release" | + grep href | + sed -re 's/.*href="//; s/".*//; s@^/@http://search.cpan.org/@'; } cached_output write_link "$module_basename" "$module_basename" src.link; diff --git a/pkgs/development/perl-modules/expression-generator/write-nix-expression.sh b/pkgs/development/perl-modules/expression-generator/write-nix-expression.sh index cfe1506640b31..9f5cdb9142eb2 100755 --- a/pkgs/development/perl-modules/expression-generator/write-nix-expression.sh +++ b/pkgs/development/perl-modules/expression-generator/write-nix-expression.sh @@ -5,16 +5,16 @@ cd $(dirname $0); source lib-cache.sh; print_expression () { - module_name="$1"; - module_basename="${module_name//::/-}"; - module_compressedname="perl${module_name//::/}"; - sourcelink="$(./source-download-link.sh "${module_name}")"; - version_name="${sourcelink%.tar.*}"; - version_name="${version_name##*/}"; - dependencies="$(./filtered-requirements.sh "$module_name" | sed -e 's/^/perl/; s/:://g' | xargs)"; - source_hash=$(nix-prefetch-url "$sourcelink" 2>/dev/null); - - cat <<EOF + module_name="$1"; + module_basename="${module_name//::/-}"; + module_compressedname="perl${module_name//::/}"; + sourcelink="$(./source-download-link.sh "${module_name}")"; + version_name="${sourcelink%.tar.*}"; + version_name="${version_name##*/}"; + dependencies="$(./filtered-requirements.sh "$module_name" | sed -e 's/^/perl/; s/:://g' | xargs)"; + source_hash=$(nix-prefetch-url "$sourcelink" 2>/dev/null); + + cat <<EOF ${module_compressedname} = import ../development/perl-modules/generic perl { name = "${version_name}"; |