24
utils/diff-evals.sh
Normal file
24
utils/diff-evals.sh
Normal file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env nix
|
||||
#! nix shell nixpkgs#bash nixpkgs#gnugrep nixpkgs#nvd --command bash
|
||||
|
||||
# diffs each derivation
|
||||
|
||||
set -x
|
||||
set -v
|
||||
set -e
|
||||
|
||||
script_path=$(dirname "$(readlink -f $0)")
|
||||
parent_path=$(dirname "$script_path")
|
||||
|
||||
readarray -t pre_drv < "$parent_path/pre-drv"
|
||||
readarray -t post_drv < "$parent_path/post-drv"
|
||||
|
||||
post_drv_path="$parent_path/post-diff"
|
||||
# cleanup any files with the same name
|
||||
rm "$post_drv_path" || true
|
||||
touch "$post_drv_path"
|
||||
|
||||
for i in $(seq 0 $(( "${#pre_drv[@]}" -1 ))); do
|
||||
echo "Diffing updates to $(echo "${pre_drv[$i]}" | cut -f 2- -d '-')" >> "$post_drv_path"
|
||||
nvd diff "${pre_drv[$i]}" "${post_drv[$i]}" >> "$post_drv_path"
|
||||
done
|
21
utils/eval-to-drv.sh
Normal file
21
utils/eval-to-drv.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env nix
|
||||
#! nix shell nixpkgs#bash nixpkgs#gnugrep --command bash
|
||||
|
||||
# diffs each derivation
|
||||
|
||||
set -x
|
||||
set -v
|
||||
set -e
|
||||
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "$0 (pre|post)"
|
||||
fi
|
||||
|
||||
script_path=$(dirname "$(readlink -f $0)")
|
||||
parent_path=$(dirname "$script_path")
|
||||
out_path="$parent_path/$1-drv"
|
||||
|
||||
|
||||
drv=$(nix flake check --verbose 2> >(grep -P -o "derivation evaluated to (/nix/store/.*\.drv)" | grep -P -o "/nix/store/.*\.drv"))
|
||||
|
||||
echo "$drv" > "$out_path"
|
Reference in New Issue
Block a user