Check-in [8e05e7b5e2]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added support for SHA256 checksums
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:8e05e7b5e2d1f70a01d20f0872332e0d472a3f72
User & Date: rkeene 2016-12-21 19:53:13
Context
2016-12-21
19:53
Added SHA256 checksum for the Linux kernel download check-in: 5b7f948afb user: rkeene tags: trunk
19:53
Added support for SHA256 checksums check-in: 8e05e7b5e2 user: rkeene tags: trunk
2016-01-27
04:00
Build-CC 0.12 check-in: e451592ac8 user: rkeene tags: trunk, 0.12
Changes

Changes to scripts/common.

25
26
27
28
29
30
31


32










33
34
35
36
37
38
39

	mkdir -p "$(dirname "${tmpfile}")" 2>/dev/null >/dev/null

	rm -f "${tmpfile}"
	wget -O "${tmpfile}" "${url}" || return 1

	if [ -n "${checksum}" ]; then


		dl_checksum="$(openssl sha1 "${tmpfile}" 2>/dev/null | sed 's@.*= *@@')"











		if [ "${checksum}" != "${dl_checksum}" ]; then
			echo "Checksum mismatch.  Got checksum: ${dl_checksum}; Expected checksum: ${checksum}" >&2

			return 1
		fi
	fi







>
>
|
>
>
>
>
>
>
>
>
>
>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

	mkdir -p "$(dirname "${tmpfile}")" 2>/dev/null >/dev/null

	rm -f "${tmpfile}"
	wget -O "${tmpfile}" "${url}" || return 1

	if [ -n "${checksum}" ]; then
		case "${checksum}" in
			????????????????????????????????????????)
				dl_checksum="$(openssl dgst -sha1 "${tmpfile}" 2>/dev/null | sed 's@.*= *@@')"
				;;
			????????????????????????????????????????????????????????????????)
				dl_checksum="$(openssl dgst -sha256 "${tmpfile}" 2>/dev/null | sed 's@.*= *@@')"
				;;
			*)
				echo "Invalid checksum value: ${checksum}" >&2

				exit 1
				;;
		esac

		if [ "${checksum}" != "${dl_checksum}" ]; then
			echo "Checksum mismatch.  Got checksum: ${dl_checksum}; Expected checksum: ${checksum}" >&2

			return 1
		fi
	fi