mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-11-28 08:49:51 +00:00
Select the latest plain release shared by angr, archinfo, cle, pyvex, angr-management and the binaries fixtures. Refresh source, Cargo and fixture hashes together, and emit metadata for per-package commits through update.nix. Assisted-by: OpenAI Codex (GPT-6)
44 lines
1.6 KiB
Bash
44 lines
1.6 KiB
Bash
# Run from the nixpkgs root.
|
|
workdir=$(mktemp -d)
|
|
trap 'rm -rf "$workdir"' EXIT
|
|
|
|
# Upstream publishes these repositories separately. Only select a release
|
|
# available everywhere, including CLE's fixtures, before changing any files.
|
|
repos=(angr archinfo cle pyvex angr-management binaries)
|
|
for repo in "${repos[@]}"; do
|
|
git ls-remote --tags --refs "https://github.com/angr/$repo.git" |
|
|
sed -nE 's@.*refs/tags/v([0-9]+\.[0-9]+\.[0-9]+)$@\1@p' |
|
|
LC_ALL=C sort -u > "$workdir/$repo"
|
|
if [[ $repo == angr ]]; then
|
|
cp "$workdir/$repo" "$workdir/common"
|
|
else
|
|
LC_ALL=C comm -12 "$workdir/common" "$workdir/$repo" > "$workdir/next"
|
|
mv "$workdir/next" "$workdir/common"
|
|
fi
|
|
done
|
|
|
|
version=$(sort -V "$workdir/common" | tail -n1)
|
|
if [[ -z $version ]]; then
|
|
echo "No coordinated angr release found." >&2
|
|
exit 1
|
|
fi
|
|
|
|
: > "$workdir/changes"
|
|
for package in python3Packages.{archinfo,pyvex,cle,angr} angr-management; do
|
|
metadata=$(nix-instantiate --eval --strict --json --expr "
|
|
let package = (import ./. {}).$package; in {
|
|
oldVersion = package.version;
|
|
files = [ (builtins.head (builtins.match \"(.*):[0-9]+\" package.meta.position)) ];
|
|
}
|
|
")
|
|
args=(--version="$version")
|
|
if [[ $package == python3Packages.cle ]]; then
|
|
args+=(--custom-dep=binaries)
|
|
fi
|
|
nix-update "$package" "${args[@]}" >&2
|
|
jq --arg attrPath "$package" --arg newVersion "$version" \
|
|
'select(.oldVersion != $newVersion) | . + {attrPath: $attrPath, newVersion: $newVersion}' \
|
|
<<< "$metadata" >> "$workdir/changes"
|
|
done
|
|
jq -s . "$workdir/changes"
|