Skip to content

Commit f3fae3b

Browse files
committed
nix-prefetch-darcs: show date
1 parent bc3f1fd commit f3fae3b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pkgs/build-support/fetchdarcs/nix-prefetch-darcs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ if [ -z "$final_path" ]; then
141141
# for other scripts
142142
# https://darcs.net/Internals/Hashes
143143
weak_hash="$(darcs show repo | grep '^ *Weak Hash:' | cut -d: -f2- | tr -d "[:space:]")"
144+
date="$(darcs log --repodir="$tmp_clone/$name" --max-count 1 | awk '/^Date:/ { sub(/^Date:[[:space:]]*/, "", $0); printf $0 }')"
145+
date="$(date -u -d "$date" "+%Y-%m-%dT%H:%M:%SZ")"
144146
cd - >/dev/null
145147
rm -rf "$tmp_clone/$name/_darcs"
146148

@@ -176,6 +178,7 @@ fi; if [ -s "$final_context" ]; then cat <<EOF
176178
"context": $(json_escape "$final_context"),
177179
EOF
178180
fi; cat <<EOF
181+
"date": "$date",
179182
"path": "$final_path",
180183
$(json_escape "$hash_algo"): $(json_escape "$hash"),
181184
"hash": "$(nix-hash --to-sri --type "$hash_algo" "$hash")"

pkgs/tools/package-management/nix-prefetch-scripts/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ rec {
6868
nix-prefetch-darcs = mkPrefetchScript "darcs" ../../../build-support/fetchdarcs/nix-prefetch-darcs [
6969
darcs
7070
cacert
71+
gawk
7172
jq
7273
];
7374
nix-prefetch-git = mkPrefetchScript "git" ../../../build-support/fetchgit/nix-prefetch-git [

0 commit comments

Comments
 (0)