Unverified Commit 31a5b695 authored by Philip Taron's avatar Philip Taron Committed by GitHub
Browse files

nix-prefetch-pijul: always output “state” (Pijul’s stable reference) (#462758)

parents c7c97ed3 e4c95117
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -100,6 +100,11 @@ if [ -z "$final_path" ]; then

	cd "$tmp_clone"
	pijul clone $clone_args "$remote" "$name"
	# 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}')"
	fi
	rm -rf "$tmp_clone/$name/.pijul"

	hash="$(nix-hash --type "$hash_algo" "$hash_format" "$tmp_clone/$name")"
@@ -125,10 +130,8 @@ EOF
if [ -n "$change" ]; then cat <<EOF
	"change": $(json_escape "$change"),
EOF
elif [ -n "$state" ]; then cat <<EOF
	"state": $(json_escape "$state"),
EOF
fi; cat <<EOF
	"state": $(json_escape "$state"),
	"path": "$final_path",
	$(json_escape "$hash_algo"): $(json_escape "$hash"),
	"hash": "$(nix-hash --to-sri --type "$hash_algo" "$hash")"
+1 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ rec {
    subversion
  ];
  nix-prefetch-pijul = mkPrefetchScript "pijul" ../../../build-support/fetchpijul/nix-prefetch-pijul [
    gawk
    pijul
    cacert
    jq