feat(popcount): Clean up popularity counting script

Adds the script used to generate the popularity information for all of
nixpkgs.

The README lists the (currently somewhat rough) usage instructions.
This commit is contained in:
Vincent Ambo 2019-08-12 17:47:27 +01:00 committed by Vincent Ambo
parent 6d718bf271
commit 6035bf36eb
5 changed files with 93 additions and 51 deletions

View file

@ -1,13 +0,0 @@
#!/bin/bash
set -ueo pipefail
function graphsFor() {
local pkg="${1}"
local graphs=$(nix-build --timeout 2 --argstr target "${pkg}" popcount.nix || echo -n 'empty.json')
cat $graphs | jq -r -cM '.[] | .references[]'
}
for pkg in $(cat all-top-level.json | jq -r '.[]'); do
graphsFor "${pkg}" 2>/dev/null
echo "Printed refs for ${pkg}" >&2
done