Created
June 4, 2024 21:50
-
-
Save Sigmanificient/4d238fa6bc37abcd210e48862d14b9de to your computer and use it in GitHub Desktop.
Get the percentage of pkgs that has been migrated to by-name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export count=$( \ | |
curl -L "https://channels.nixos.org/nixos-unstable/packages.json.br" \ | |
| brotli -d --stdout \ | |
| nix run nixpkgs#jq -- ".packages | length") | |
find pkgs/by-name -maxdepth 1 -type d \ | |
| xargs -i sh -c "find {} -maxdepth 1 -type d| wc -l" \ | |
| tr '\n' '+' \ | |
| python -c "print(eval(input()[:-1]))" \ | |
| python -c "print(100 * int(input()) / $count, '%')" \ | |
| head -c 7 \ | |
| xargs printf "Percentage migrated: %s%%\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment