diff --git a/pkgs/build-support/fetchpijul/nix-prefetch-pijul b/pkgs/build-support/fetchpijul/nix-prefetch-pijul index 9428c38cc14f..bd8d7f169ddb 100755 --- a/pkgs/build-support/fetchpijul/nix-prefetch-pijul +++ b/pkgs/build-support/fetchpijul/nix-prefetch-pijul @@ -6,6 +6,7 @@ remote= channel="main" change= state= +date= exp_hash= usage() { @@ -100,11 +101,15 @@ if [ -z "$final_path" ]; then cd "$tmp_clone" pijul clone $clone_args "$remote" "$name" + latest_log="$(pijul log --repository "$tmp_clone/$name" --limit 1)" # State is a stable reference is a stable reference for the patchset that # doesn't depend on patch order. As a result, it will always be included. if [ -z "$state" ]; then - state="$(pijul log --repository "$tmp_clone/$name" --state --limit 1 | awk '/^State:/ {printf $2}')" + state="$(printf "%s" "$latest_log" | awk '/^State:/ {printf $2}')" fi + date="$(printf "%s" "$latest_log" | awk '/^Date:/ { sub(/^Date:[[:space:]]*/, "", $0); printf $0 }')" + date="$(date -u -d "$date" "+%Y-%m-%dT%H:%M:%SZ")" + rm -rf "$tmp_clone/$name/.pijul" hash="$(nix-hash --type "$hash_algo" "$hash_format" "$tmp_clone/$name")" @@ -132,6 +137,7 @@ if [ -n "$change" ]; then cat <