diff options
author | Victor Engmark <victor@engmark.name> | 2021-11-14 15:53:26 +1300 |
---|---|---|
committer | Victor Engmark <victor@engmark.name> | 2021-11-14 16:04:46 +1300 |
commit | 90dbec47b7c8eff5262fda73d97335fb29e079fa (patch) | |
tree | a28ad9d1da052c05b661b71fc99c1c206e841e80 /maintainers/scripts/vanity.sh | |
parent | 5a7f6e1f189126cc96b55d258a787905631fbfcd (diff) | |
download | nixlib-90dbec47b7c8eff5262fda73d97335fb29e079fa.tar nixlib-90dbec47b7c8eff5262fda73d97335fb29e079fa.tar.gz nixlib-90dbec47b7c8eff5262fda73d97335fb29e079fa.tar.bz2 nixlib-90dbec47b7c8eff5262fda73d97335fb29e079fa.tar.lz nixlib-90dbec47b7c8eff5262fda73d97335fb29e079fa.tar.xz nixlib-90dbec47b7c8eff5262fda73d97335fb29e079fa.tar.zst nixlib-90dbec47b7c8eff5262fda73d97335fb29e079fa.zip |
vanity: Indent with spaces
Some literal tabs within strings should probably be spaces `\t`, but I'm not familiar enough to make that call.
Diffstat (limited to 'maintainers/scripts/vanity.sh')
-rwxr-xr-x | maintainers/scripts/vanity.sh | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/maintainers/scripts/vanity.sh b/maintainers/scripts/vanity.sh index aa7d4ec967da..a6e82e039422 100755 --- a/maintainers/scripts/vanity.sh +++ b/maintainers/scripts/vanity.sh @@ -30,7 +30,7 @@ fetchGithubName () { curl https://github.com/NixOS/nixpkgs/commit/"$commitid" 2>/dev/null | grep committed -B10 | grep 'href="/' | sed -re 's@.* href="/@@; s@".*@@' | - grep -v "/commit/" + grep -v "/commit/" )"; echo "$userid" } @@ -38,7 +38,7 @@ fetchGithubName () { [ -n "$NIXPKGS_GITHUB_NAME_CACHE" ] && { echo "$emails" | while read email; do line="$(grep "$email " "$NIXPKGS_GITHUB_NAME_CACHE")" - [ -z "$line" ] && { + [ -z "$line" ] && { echo "$email $(fetchGithubName "$email")" >> \ "$NIXPKGS_GITHUB_NAME_CACHE" } @@ -47,11 +47,11 @@ fetchGithubName () { # For RDF normalize_name () { - sed -e 's/%/%25/g; s/ /%20/g; s/'\''/%27/g; s/"/%22/g; s/`/%60/g; s/\^/%5e/g; ' + sed -e 's/%/%25/g; s/ /%20/g; s/'\''/%27/g; s/"/%22/g; s/`/%60/g; s/\^/%5e/g; ' } denormalize_name () { - sed -e 's/%20/ /g; s/%27/'\''/g; s/%22/"/g; s/%60/`/g; s/%5e/^/g; s/%25/%/g;'; + sed -e 's/%20/ /g; s/%27/'\''/g; s/%22/"/g; s/%60/`/g; s/%5e/^/g; s/%25/%/g;'; } n3="$(mktemp --suffix .n3)" @@ -75,22 +75,22 @@ echo "$maintainers" | cut -f 2 | sed -e 's@.*@<my://name/&> <my://is-name> <my:/ # Get transitive closure sparql="$(nix-build '<nixpkgs>' -Q -A apache-jena --no-out-link)/bin/sparql" name_list="$( - "$sparql" --results=TSV --data="$n3" " + "$sparql" --results=TSV --data="$n3" " select ?x ?y ?g where { ?x <my://can-be>+ ?y. ?x <my://is-name> ?g. } " | tail -n +2 | - sed -re 's@<my://name/@@g; s@<my://@@g; s@>@@g;' | - sort -k 2,3 -t ' ' + sed -re 's@<my://name/@@g; s@<my://@@g; s@>@@g;' | + sort -k 2,3 -t ' ' )" github_name_list="$( - "$sparql" --results=TSV --data="$n3" " + "$sparql" --results=TSV --data="$n3" " select ?x ?y where { ?x (<my://can-be>+ / <my://at-github>) ?y. } " | tail -n +2 | - sed -re 's@<my://(name|github)/@@g; s@<my://@@g; s@>@@g;' + sed -re 's@<my://(name|github)/@@g; s@<my://@@g; s@>@@g;' )" # Take first spelling option for every person @@ -104,10 +104,10 @@ if [ -n "$NIXPKGS_GITHUB_NAME_CACHE" ]; then github_adder_script="$(mktemp)" echo "$github_name_list" | grep -E "$(echo "$name_list_canonical" | cut -f 2 | - tr '\n' '|' )" | - sort | uniq | + tr '\n' '|' )" | + sort | uniq | sed -re 's/(.*)\t(.*)/s| \1$| \1\t\2|g;/' | - denormalize_name > "$github_adder_script" + denormalize_name > "$github_adder_script" else github_adder_script='/dev/null' fi |