From 5265f522cea4b4836a6a81fa39717284d9560519 Mon Sep 17 00:00:00 2001 From: Bert van der Weerd Date: Tue, 23 Feb 2021 12:54:57 +0100 Subject: [PATCH] added better error checking to prepare for use in a shared runner --- build.sh | 12 +++++++++++- installer_win.sh | 12 ++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 32cc3ea..450e231 100644 --- a/build.sh +++ b/build.sh @@ -10,8 +10,9 @@ pkgver=85.0.2 fetch() { # fetch the firefox source. - rm -vf firefox-$pkgver.source.tar.xz + rm -f firefox-$pkgver.source.tar.xz wget https://archive.mozilla.org/pub/firefox/releases/$pkgver/source/firefox-$pkgver.source.tar.xz + if [ ! -f firefox-$pkgver.source.tar.xz ]; then exit 1; fi # the settings and common submodules should be checked out with --recursive to allow the build @@ -19,8 +20,11 @@ fetch() { echo 'Getting patches..' rm -f megabar.patch remove_addons.patch unity-menubar.patch wget -q https://gitlab.com/librewolf-community/browser/linux/-/raw/master/megabar.patch + if [ ! -f megabar.patch ]; then exit 1; fi wget -q https://gitlab.com/librewolf-community/browser/linux/-/raw/master/remove_addons.patch + if [ ! -f remove_addons.patch ]; then exit 1; fi wget -q https://gitlab.com/librewolf-community/browser/linux/-/raw/master/unity-menubar.patch + if [ ! -f unity-menubar.patch ]; then exit 1; fi } @@ -31,6 +35,7 @@ prepare() { echo "Extracting firefox-$pkgver.source.tar.xz ..." tar xf firefox-$pkgver.source.tar.xz + if [ ! -d firefox-$pkgver ]; then exit 1; fi cd firefox-$pkgver cat >../mozconfig < librewolf-$pkgver.en-US.win64.zip.sha256sum + if [ $? -ne 0 ]; then exit 1; fi + sha256sum.exe librewolf-$pkgver.en-US.win64.zip > librewolf-$pkgver.en-US.win64.zip.sha256sum + if [ $? -ne 0 ]; then exit 1; fi # copy the resulting zip file rm -vf ../../../librewolf-$pkgver.en-US.win64.zip* cp -v librewolf-$pkgver.en-US.win64.zip* ../../.. @@ -111,7 +116,10 @@ END pushd .. rm -vrf librewolf unzip librewolf-$pkgver.en-US.win64.zip + if [ $? -ne 0 ]; then exit 1; fi cp -v common/source_files/browser/branding/librewolf/firefox.ico librewolf/librewolf.ico makensis-3.01.exe installer_win.nsi - /c/mozilla-source/Git/usr/bin/sha256sum.exe librewolf-$pkgver.en-US.win64-setup.exe > librewolf-$pkgver.en-US.win64-setup.exe.sha256sum + if [ $? -ne 0 ]; then exit 1; fi + sha256sum.exe librewolf-$pkgver.en-US.win64-setup.exe > librewolf-$pkgver.en-US.win64-setup.exe.sha256sum + if [ $? -ne 0 ]; then exit 1; fi popd