summary refs log tree commit diff
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2018-03-03 22:34:17 -0500
committerGitHub <noreply@github.com>2018-03-03 22:34:17 -0500
commitf6e943fd40b189a309271d55a80f063bb5e5efdc (patch)
tree5595740705da879d4702351b929323bd3bde0494
parent52963931cdd97710b87b7d125fbe7ea79e98a0bc (diff)
downloadnixpkgs-f6e943fd40b189a309271d55a80f063bb5e5efdc.tar
nixpkgs-f6e943fd40b189a309271d55a80f063bb5e5efdc.tar.gz
nixpkgs-f6e943fd40b189a309271d55a80f063bb5e5efdc.tar.bz2
nixpkgs-f6e943fd40b189a309271d55a80f063bb5e5efdc.tar.lz
nixpkgs-f6e943fd40b189a309271d55a80f063bb5e5efdc.tar.xz
nixpkgs-f6e943fd40b189a309271d55a80f063bb5e5efdc.tar.zst
nixpkgs-f6e943fd40b189a309271d55a80f063bb5e5efdc.zip
Revert "maintainers/scripts: improve github handle checker"
This reverts commit a2c708c2563144d61e54d7684dd8572bed7f1989.
-rwxr-xr-xmaintainers/scripts/check-maintainer-github-handles.sh53
1 files changed, 5 insertions, 48 deletions
diff --git a/maintainers/scripts/check-maintainer-github-handles.sh b/maintainers/scripts/check-maintainer-github-handles.sh
index 879a2e452cb..e389fde7d8a 100755
--- a/maintainers/scripts/check-maintainer-github-handles.sh
+++ b/maintainers/scripts/check-maintainer-github-handles.sh
@@ -6,61 +6,18 @@
 
 set -e
 
-# nixpkgs='<nixpkgs>'
-# if [ -n "$1" ]; then
-
-function checkCommits {
-    local user="$1"
-    local tmp=$(mktemp)
-    curl --silent -w "%{http_code}" \
-         "https://github.com/NixOS/nixpkgs/commits?author=$user" \
-         > "$tmp"
-    # the last line of tmp contains the http status
-    local status=$(tail -n1 "$tmp")
-    local ret=
-    case $status in
-        200) if <"$tmp" grep -i "no commits found" > /dev/null; then
-                 ret=1
-             else
-                 ret=0
-             fi
-             ;;
-        # because of github’s hard request limits, this can take some time
-        429) sleep 2
-             printf "."
-             checkCommits "$user"
-             ret=$?
-             ;;
-        *)   printf "BAD STATUS: $(tail -n1 $tmp) for %s\n" "$user"; ret=1
-             ret=1
-             ;;
-    esac
-    rm "$tmp"
-    return $ret
-}
-export -f checkCommits
-
+# checks whether a user handle can be found on github
 function checkUser {
     local user="$1"
     local status=
     status="$(curl --silent --head "https://github.com/${user}" | grep Status)"
-    # checks whether a user handle can be found on github
-    if [[ "$status" =~ 404 ]]; then
-        printf "%s\t\t\t\t%s\n" "$status" "$user"
-    # checks whether the user handle has any nixpkgs commits
-    elif checkCommits "$user"; then
-        printf "OK!\t\t\t\t%s\n" "$user"
-    else
-        printf "No Commits!\t\t\t%s\n" "$user"
-    fi
+    printf "%s\t\t\t\t%s\n" "$status" "$user"
 }
 export -f checkUser
 
 # output the maintainers set as json
 # and filter out the github username of each maintainer (if it exists)
-# then check some at the same time
+# then check 100 at the same time
 nix-instantiate -A lib.maintainers --eval --strict --json \
-    | jq -r '.[]|.github|select(.)' \
-    | parallel -j5 checkUser
-
-# parallel -j100 checkUser ::: "eelco" "profpatsch" "Profpatsch" "a"
+    | jq -r '.[]|.github' \
+    | parallel -j100 checkUser