From cf52b012a2795050d4519057c550686aad42fea4 Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Sun, 28 Nov 2021 23:23:15 +0300 Subject: [PATCH] upd.sh: check appliability of patches --- upd.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/upd.sh b/upd.sh index 26bc78e..3a70ef9 100755 --- a/upd.sh +++ b/upd.sh @@ -1,11 +1,15 @@ #!/usr/bin/env bash # Script to partly automate updating this package +# sudo dnf install /usr/bin/rpmbuild /usr/bin/spectool /usr/bin/rpmspec /usr/bin/git /usr/bin/curl /usr/bin/abf set -x set -e set -f set -u +# try to avoid asking for password in `sudo mount -t tmpfs <...>` +#sudo echo + spec=chromium-browser-stable.spec old_version="$(rpmspec -q --srpm --qf '%{version}' "$spec")" @@ -31,6 +35,15 @@ sed -E -i'' "$spec" \ -- spectool --get-files --source 0,1101,1102 "$spec" + +# check appliability of patches +patches_ok=0 +# unpack >8 GiB of source code, I do not have so much RAM to store it in tmpfs +tmp="$(mktemp --tmpdir=/var/tmp -d)" +#sudo mount -t tmpfs -o size=30G tmpfs "$tmp" +trap 'if [ "$patches_ok" = 1 ]; then rm -fr "$tmp"; fi' EXIT +rpmbuild --define "_sourcedir $PWD" --define "_builddir $tmp" -bp "$spec" && patches_ok=1 + sed -i'' .abf.yml -e '/^ chromium-/d' -e '/^ msspi-/d' abf put -n # abf put erronously uploads *.json @@ -40,3 +53,7 @@ sed -i'' .abf.yml -e '/^ master_preferences.json/d' PAGER='' git diff # can be copypasted for a commit message echo "upd: $old_version -> $latest_version" + +if [ "$patches_ok" = 0 ]; then + echo "PATCHES require attention!" +fi