unify err functions across scripts

include/err.sh

this new handling also does mundane things,
such as tell you what script b0rked

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2023-08-23 18:56:31 +01:00
parent b3fbcdf66e
commit 57adbc6eb1
17 changed files with 127 additions and 175 deletions
+2 -5
View File
@@ -29,6 +29,8 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
. "include/err.sh"
projectname="$(cat projectname)"
opts=""
boards=
@@ -116,9 +118,4 @@ buildrom() {
./build boot roms_helper ${1}${opts}
}
err() {
printf '%s\n' "${1}" 1>&2
exit 1
}
main $@
+1 -5
View File
@@ -30,11 +30,7 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
err()
{
printf "ERROR: build/boot/roms: %s\n" "${1}" 1>&2
exit 1
}
. "include/err.sh"
projectname="$(cat projectname)"
+2 -6
View File
@@ -22,6 +22,8 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
. "include/err.sh"
main()
{
printf "Cleaning crossgcc builds in all coreboot archives\n"
@@ -34,10 +36,4 @@ main()
done
}
err()
{
printf "%s: %s\n" $0 $1
exit 1
}
main $@
+2 -6
View File
@@ -19,6 +19,8 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
. "include/err.sh"
ich9gen="util/ich9utils/ich9gen"
main()
@@ -36,10 +38,4 @@ main()
)
}
err()
{
printf "%s: %s\n" $0 $1
exit 1
}
main $@
+2 -6
View File
@@ -22,6 +22,8 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
. "include/err.sh"
main()
{
printf "Building GRUB\n"
@@ -41,10 +43,4 @@ build_grub()
)
}
err()
{
printf "%s: error: %s\n" $0 $1
exit 1
}
main $@
+2 -6
View File
@@ -21,6 +21,8 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
. "include/err.sh"
projectname="$(cat projectname)"
version="version-unknown"
versiondate="version-date-unknown"
@@ -165,10 +167,4 @@ strip_rom_image()
${cbfstool} "${romfile}" remove -n "pci10de,06eb.rom" || exit 1
}
err()
{
printf "%s: %s\n" $0 $1
exit 1
}
main $@
+2 -5
View File
@@ -21,6 +21,8 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
. "include/err.sh"
projectname="$(cat projectname)"
trees_fetch_list="coreboot u-boot"
@@ -161,9 +163,4 @@ create_release_archive()
)
}
err()
{
printf "%s: %s\n" $0 $1
}
main $@
+2 -6
View File
@@ -21,6 +21,8 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
. "include/err.sh"
mode=""
project=""
@@ -61,10 +63,4 @@ main()
|| err "cannot clean project src, ${project}"
}
err()
{
printf "ERROR: build/src: %s\n" "${1}" 1>&2
exit 1
}
main $@