depends: Fix regex bugs in cargo-checksum.sh

This commit is contained in:
Jack Grigg 2018-03-30 19:06:51 +01:00
parent 72f14060bc
commit 0e400c8854
No known key found for this signature in database
GPG Key ID: 665DBCD284F7DAFF
1 changed files with 2 additions and 2 deletions

View File

@ -1,8 +1,8 @@
echo "{\"files\":{$( echo "{\"files\":{$(
find . -type f | # Get list of file paths find . -type f | # Get list of file paths
grep -v $1 | # Exclude Makefile hashes grep -v $1 | # Exclude Makefile hashes
grep -v .stamp_ | # Exclude Makefile stamps grep -v '[.]stamp_' | # Exclude Makefile stamps
sed 's|^./||' | # Remove leading ./ sed 's|^[.]/||' | # Remove leading ./
sort | # Sort (for uniformity) sort | # Sort (for uniformity)
xargs $2 | # Get SHA256 hashes (assumes standard 'H(A) A' format) xargs $2 | # Get SHA256 hashes (assumes standard 'H(A) A' format)
awk -v OFS='":"' '{print $2, $1}' | # 'H(A) A' -> 'A":"H(A)' awk -v OFS='":"' '{print $2, $1}' | # 'H(A) A' -> 'A":"H(A)'