Add sources updater script

This commit is contained in:
Nathan McCarty 2023-05-13 13:58:44 -04:00
parent e05fc1c5ee
commit ad47ebaf4c
Signed by: thatonelutenist
SSH Key Fingerprint: SHA256:hwQEcmak9E6sdU9bXc98RHw/Xd1AhpB5HZT7ZSVJkRM
3 changed files with 61 additions and 0 deletions

6
sources/packages.txt Normal file
View File

@ -0,0 +1,6 @@
cargo-llvm-cov
cargo-nextest
cargo-release
cargo-udeps
cargo-audit
cargo-deny

32
sources/sources.json Normal file
View File

@ -0,0 +1,32 @@
[
{
"hash": "sha256-ICNcBqlkX1k3J5vc/bfoXw/+l2LdHOchv4PfY0G7Y94=",
"pname": "cargo-audit",
"version": "0.17.6"
},
{
"hash": "sha256-/2HClc4rzQvvbmWXOotZuC9MEPPnPZKWCOVC2AadtG4=",
"pname": "cargo-deny",
"version": "0.13.9"
},
{
"hash": "sha256-5xHDjNFQDmi+SnhxfoCxoBdCqHpZEk/87r2sBKsT+W4=",
"pname": "cargo-llvm-cov",
"version": "0.5.19"
},
{
"hash": "sha256-IY8H9TnOBj0nAn8G1o8onN5kWAhJxkiBhU9jQ0/pIss=",
"pname": "cargo-nextest",
"version": "0.9.52"
},
{
"hash": "sha256-tmyIQMjKs37ZVqG/WV4Qe99Jc+bzneTmEMrvxV1Gnsc=",
"pname": "cargo-release",
"version": "0.24.10"
},
{
"hash": "sha256-jvEhE/fngzEzRinA4iZYJbBfcl2CGbTwQB52h5laVf8=",
"pname": "cargo-udeps",
"version": "0.1.39"
}
]

23
sources/update-sources.sh Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -eou pipefail
DIRECTORY=$(dirname "$0")
PACKAGES_FILE="$DIRECTORY/packages.txt"
SOURCES_FILE="$DIRECTORY/sources.json"
TEMP_DIR=$(mktemp -d "rust-flake-sources.XXXX" -p $XDG_RUNTIME_DIR)
pushd $TEMP_DIR
echo ""
for package in $(cat "$PACKAGES_FILE")
do
version=$(curl -s "https://crates.io/api/v1/crates/$package" | jq ".crate.max_stable_version" | tr -d '"')
echo "Fetching $package -- $version"
nurl "https://crates.io/crates/$package" "$version" -j | jq ".args" > $package.json
echo ""
done
popd
jq -s "." $TEMP_DIR/* > $SOURCES_FILE
rm -r $TEMP_DIR