Skip to content

Commit 555c1f0

Browse files
committed
nix-prefetch-darcs: grep+cut+tr → awk
Since AWK was introduced as a dependency, I can remove the grep dependency
1 parent f3fae3b commit 555c1f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ if [ -z "$final_path" ]; then
140140
# Darcs has a weak hash using the XOR of the patch hashes which is useful
141141
# for other scripts
142142
# https://darcs.net/Internals/Hashes
143-
weak_hash="$(darcs show repo | grep '^ *Weak Hash:' | cut -d: -f2- | tr -d "[:space:]")"
143+
weak_hash="$(darcs show repo | awk '/^[[:space:]]*Weak Hash:/ { sub(/^[[:space:]]*Weak Hash:[[:space:]]*/, "", $0); printf $0 }')"
144144
date="$(darcs log --repodir="$tmp_clone/$name" --max-count 1 | awk '/^Date:/ { sub(/^Date:[[:space:]]*/, "", $0); printf $0 }')"
145145
date="$(date -u -d "$date" "+%Y-%m-%dT%H:%M:%SZ")"
146146
cd - >/dev/null

0 commit comments

Comments
 (0)