File: gen-binary-hash

package info (click to toggle)
xca 2.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,328 kB
  • sloc: cpp: 30,584; sh: 341; xml: 74; makefile: 56; python: 34
file content (20 lines) | stat: -rwxr-xr-x 298 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

set -ex
hashes="$(dirname $0)/binary-hashes.json"

export dir="$1"
(
  head -n -2
  test -z "$dir" || cd $dir
  sha256sum *xca* | while read md file; do
   echo '  "'$file'":"'$md'",'
  done
  cat <<-EOF

	  "last":""
	}
	EOF
) < "$hashes" > "$hashes".tmp &&

mv "$hashes".tmp "$hashes"