From 51ba7c3a349e11929c64bb2cf70e7352398836cf Mon Sep 17 00:00:00 2001 From: xiota Date: Fri, 17 Nov 2023 13:46:03 -0800 Subject: [PATCH] fix script --- .SRCINFO | 4 ++-- PKGBUILD | 36 ++++++++++++++++++------------------ thorium-browser.sh | 4 ++-- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index b3491b8457259..1ce687b4afbe9 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = thorium-browser-bin pkgdesc = Chromium fork focused on high performance and security pkgver = 117.0.5938.157 - pkgrel = 4 + pkgrel = 5 url = https://github.com/Alex313031/Thorium install = thorium-browser.install arch = x86_64 @@ -16,7 +16,7 @@ pkgbase = thorium-browser-bin source = https://github.com/Alex313031/Thorium/releases/download/M117.0.5938.157/thorium-browser_117.0.5938.157_amd64.deb source = thorium-browser.sh sha256sums = SKIP - sha256sums = 76dc15b6001053edc422dbed7041273a21315b5f59225f62f8b21b6385f6f9ba + sha256sums = 56ea0cd85fef5b61620c554aa8939c2f1c6b3fdb3d13d182167e66e9f884cdaa pkgname = thorium-browser-bin depends = alsa-lib diff --git a/PKGBUILD b/PKGBUILD index 1ef64d7382420..a7665ac88f89e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -17,7 +17,7 @@ fi _pkgname="thorium-browser" pkgname="$_pkgname-bin" pkgver=117.0.5938.157 -pkgrel=4 +pkgrel=5 pkgdesc="Chromium fork focused on high performance and security" url="https://github.com/Alex313031/Thorium" license=('BSD') @@ -48,7 +48,7 @@ _main_package() { ) sha256sums=( 'SKIP' - '76dc15b6001053edc422dbed7041273a21315b5f59225f62f8b21b6385f6f9ba' + '56ea0cd85fef5b61620c554aa8939c2f1c6b3fdb3d13d182167e66e9f884cdaa' ) pkgver() { @@ -119,24 +119,24 @@ package() { # update version _update_version() { - case "${_autoupdate::1}" in - 't'|'y'|'1') - _repo="${url#*//*/}" - _response=$(curl "https://api.github.com/repos/${_repo:?}/releases" -s) + if [[ x"${_autoupdate::1}" != "xt" ]] ; then + return + fi - _regex='^.*thorium-browser_([0-9\.]+)_.*\.deb.*$' - _pkgver_new=$( - printf '%s' "$_response" \ - | grep -E "$_regex" | head -1 | sed -E "s@$_regex@\1@" - ) + _repo="${url#*//*/}" + _response=$(curl "https://api.github.com/repos/${_repo:?}/releases" -s) - # update _pkgver - if [ x"$_pkgver" != x"${_pkgver_new:?}" ] ; then - _pkgver="${_pkgver_new:?}" - sed -Ei 's@^(\s*: \$\{_pkgver):=.*\}$@\1:='"${_pkgver:?}"'}@' "$startdir/PKGBUILD" - fi - ;; - esac + _regex='^.*thorium-browser_([0-9\.]+)_.*\.deb.*$' + _pkgver_new=$( + printf '%s' "$_response" \ + | grep -E "$_regex" | head -1 | sed -E "s@$_regex@\1@" + ) + + # update _pkgver + if [ x"$_pkgver" != x"${_pkgver_new:?}" ] ; then + _pkgver="${_pkgver_new:?}" + sed -Ei 's@^(\s*: \$\{_pkgver):=.*\}$@\1:='"${_pkgver:?}"'}@' "$startdir/PKGBUILD" + fi } # execute diff --git a/thorium-browser.sh b/thorium-browser.sh index 5f6664281efbe..9e9465475f246 100644 --- a/thorium-browser.sh +++ b/thorium-browser.sh @@ -17,7 +17,7 @@ fi XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config} # Allow users to override command-line options -if [[ -f $XDG_CONFIG_HOME/thorium-flags.conf ]]; then +if [[ -f "$XDG_CONFIG_HOME/thorium-flags.conf" ]]; then THORIUM_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium-flags.conf)" fi @@ -25,7 +25,7 @@ fi if tty -s ; then echo "$_message" else - [ ! -e "$HOME/.mercury" ] && notify-send -a "thorium-browser" -t 7500 "$_message" + [ ! -e "$XDG_CONFIG_HOME/thorium" ] && notify-send -a "thorium-browser" -t 7500 "$_message" fi # Launch