fix script

This commit is contained in:
xiota 2023-11-17 13:46:03 -08:00
parent bfcae5f95b
commit 51ba7c3a34
3 changed files with 22 additions and 22 deletions

View file

@ -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

View file

@ -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

View file

@ -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