diff options
author | Leah Rowe <leah@libreboot.org> | 2023-05-20 18:59:59 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-05-20 18:59:59 +0100 |
commit | 1cdf1c7cf0aba37bfa1ee48057da42e8a82a82f7 (patch) | |
tree | 2cafbbf1eac394cfac9603527e7c3ce06ab336e5 | |
parent | 16f878e88219f9040acf976828034818cd4c114a (diff) |
build/release/src: handle errors in subshells
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rwxr-xr-x | resources/scripts/build/release/src | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/resources/scripts/build/release/src b/resources/scripts/build/release/src index f551904b..42870d79 100755 --- a/resources/scripts/build/release/src +++ b/resources/scripts/build/release/src @@ -113,41 +113,47 @@ copy_blobs() purge_files() { ( - cd "${srcdir}/coreboot/" + cd "${srcdir}/coreboot/" || err "cd1" for i in *; do [ ! -d "${i}" ] && \ continue ( - cd "${i}/" - make distclean + cd "${i}/" || err "cd2" + make distclean || err "make-distclean1" ) - make clean -BC default/util/kbc1126/ + make clean -BC default/util/kbc1126/ || err "make-clean1" done ) ( - cd "${srcdir}/" - ./build clean all - make clean -BC util/nvmutil - make clean -BC util/ich9utils - - rm -Rf coreboot/coreboot/ - rm -Rf .git .gitignore */.git* coreboot/*/.git* coreboot/*/3rdparty/*/.git* - rm -Rf coreboot/*/util/nvidia/cbootimage/.git* - rm -Rf u-boot/u-boot/ u-boot/*/.git* + cd "${srcdir}/" || err "cd3" + ./build clean all || err "build-clean1" + make clean -BC util/nvmutil || err "make-clean2" + make clean -BC util/ich9utils || err "make-clean3" + + rm -Rf coreboot/coreboot/ || err "rm-rf1" + rm -Rf .git .gitignore */.git* coreboot/*/.git* \ + coreboot/*/3rdparty/*/.git* || err "rm-rf2" + rm -Rf coreboot/*/util/nvidia/cbootimage/.git* || err "rm-rf3" + rm -Rf u-boot/u-boot/ u-boot/*/.git* || err "rm-rf4" ) } create_release_archive() { ( - cd "${reldir}/" + cd "${reldir}/" || err "cd4" printf "%s\n" "${version}" > "${dirname}/version" printf "%s\n" "${versiondate}" > "${dirname}/versiondate" printf "%s\n" "${projectname}" > "${dirname}/projectname" - tar -c "${dirname}/" | xz -9e >"${dirname}.tar.xz" - rm -Rf "${dirname}/" + tar -c "${dirname}/" | xz -9e >"${dirname}.tar.xz" || err "tar" + rm -Rf "${dirname}/" || err "rm-rf5" ) } +err() +{ + printf "%s: %s\n" $0 $1 +} + main $@ |