Implement sha256summing in bash build harness

1. Adds sha256sum stage to the bash build harness.
2. Adds a third argument to build(), the checksum file name. This is
   used where there is more than one checksum file, most notably
   in multi-stage compilations.
3. Adds checksum files to all remaining programs.
4. Adds appropriate 3rd argument where needed (coreutils, tcc-musl,
   bison).
This commit is contained in:
fosslinux 2021-02-18 18:29:58 +11:00
parent 8724c94d20
commit 77ccf06efc
14 changed files with 93 additions and 5 deletions

View file

@ -1,6 +1,8 @@
#!/bin/bash -e
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
export PATH=/after/bin
@ -8,12 +10,14 @@ export PATH=/after/bin
# Common build steps
# Build function provides a few common stages with default implementation
# that can be overridden on per package basis in the build script.
# build takes two arguments:
# build takes three arguments:
# 1) name-version of the package
# 2) optionally specify build script. Default is name-version.sh
# 3) optionally specify name of checksum file. Default is checksums
build () {
pkg=$1
script_name=${2:-${pkg}.sh}
checksum_f=${3:-checksums}
cd "$pkg" || (echo "Cannot cd into ${pkg}!"; kill $$)
echo "${pkg}: beginning build using script ${script_name}"
@ -52,6 +56,9 @@ build () {
cd ../..
echo "${pkg}: checksumming installed files."
sha256sum -c "${checksum_f}"
echo "${pkg}: build successful"
cd ..