mirror of
https://abf.rosa.ru/djam/chromium-browser-stable-test.git
synced 2025-02-23 17:42:45 +00:00
Add script which automates updating this package
This commit is contained in:
parent
4f485b572c
commit
5699e8a7a8
1 changed files with 42 additions and 0 deletions
42
upd.sh
Executable file
42
upd.sh
Executable file
|
@ -0,0 +1,42 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# Script to partly automate updating this package
|
||||||
|
|
||||||
|
set -x
|
||||||
|
set -e
|
||||||
|
set -f
|
||||||
|
set -u
|
||||||
|
|
||||||
|
spec=chromium-browser-stable.spec
|
||||||
|
|
||||||
|
old_version="$(rpmspec -q --srpm --qf '%{version}' "$spec")"
|
||||||
|
latest_version="$(curl -s 'https://omahaproxy.appspot.com/all?os=linux&channel=stable' | sed 1d | cut -d , -f 3)"
|
||||||
|
[ -n "$latest_version" ]
|
||||||
|
if [ "$old_version" = "$latest_version" ]; then
|
||||||
|
echo "No updates"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# https://stackoverflow.com/a/66636133
|
||||||
|
latest_commit_chromium_gost="$(curl -s -H "Accept: application/vnd.github.VERSION.sha" "https://api.github.com/repos/deemru/chromium-gost/commits/master")"
|
||||||
|
[ -n "$latest_commit_chromium_gost" ]
|
||||||
|
|
||||||
|
latest_commit_msspi="$(curl -s -H "Accept: application/vnd.github.VERSION.sha" "https://api.github.com/repos/deemru/msspi/commits/master")"
|
||||||
|
[ -n "$latest_commit_msspi" ]
|
||||||
|
|
||||||
|
sed -E -i'' "$spec" \
|
||||||
|
-e "s,^Version:.+,Version:\t${latest_version}," \
|
||||||
|
-e "s,^Release:.+,Release:\t1," \
|
||||||
|
-e "s,^%define chromium_gost_commit .+,%define chromium_gost_commit ${latest_commit_chromium_gost}," \
|
||||||
|
-e "s,^%define msspi_commit .+,%define msspi_commit ${latest_commit_msspi}," \
|
||||||
|
--
|
||||||
|
|
||||||
|
spectool --get-files --source 0,1101,1102 "$spec"
|
||||||
|
sed -i'' .abf.yml -e '/^ chromium-/d' -e '/^ msspi-/d'
|
||||||
|
abf put -n
|
||||||
|
# abf put erronously uploads *.json
|
||||||
|
git checkout master_preferences.json
|
||||||
|
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"
|
Loading…
Add table
Reference in a new issue