maintainers/scripts/kde/collect-logs: rewrite in Nu

Fast.
This commit is contained in:
K900
2024-02-28 16:58:51 +03:00
parent 30c4a4b8f3
commit 4cbb0adf4d
2 changed files with 11 additions and 13 deletions

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env nix-shell
#!nix-shell -i nu -p nushell
cd $"($env.FILE_PWD)/../../.."
mkdir logs
nix-env -qaP -f . -A kdePackages --json --out-path | from json | values | par-each { |it|
echo $"Processing ($it.pname)..."
if "outputs" in $it {
nix-store --read-log $it.outputs.out | save -f $"logs/($it.pname).log"
}
}

View File

@@ -1,13 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p gnused jq
set -eu
cd "$(dirname "$(readlink -f "$0")")"/../../..
mkdir -p logs
for name in $(nix-env -qaP -f . -A kdePackages --json | jq -r 'to_entries[] | .key' | sed s/kdePackages.//); do
echo "Processing ${name}..."
path=$(nix eval ".#kdePackages.${name}.outPath" --json --option warn-dirty false | jq -r)
if [ -n "${path}" ]; then
nix-store --read-log "${path}" > "logs/${name}.log" || true
fi
done