Remove SRCINFO, fix SKIP insertion

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2024-04-30 13:25:47 +02:00
parent 177876de7d
commit 93e3d6b048
Signed by: luzifer
SSH key fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E
3 changed files with 18 additions and 48 deletions

View file

@ -1,25 +0,0 @@
pkgbase = discord
pkgdesc = Discord using system provided electron (v22) for increased security and performance
pkgver = 0.0.51
pkgrel = 1
url = https://discord.com
arch = x86_64
license = custom
makedepends = asar
makedepends = curl
makedepends = python-html2text
depends = electron22
depends = libnotify
depends = libxss
depends = nspr
depends = nss
depends = gtk3
optdepends = libpulse: Pulseaudio support
optdepends = xdg-utils: Open files
provides = discord
conflicts = discord
options = !strip
source = https://dl.discordapp.net/apps/linux/0.0.51/discord-0.0.51.tar.gz
sha512sums = b98072a64cfb593176e7e057b926fcf2d9e1a4aa555a659cebb8abe20fe463ff135a8028fd0fc36dc6c1bd40235da98c7c055c372e707cae00b882c8b0462dd9
pkgname = discord

View file

@ -34,12 +34,10 @@ source=(
'LICENSE.html::https://discord.com/terms'
'OSS-LICENSES.html::https://discord.com/licenses'
)
sha512sums=(
'42ff4b59a0dd846f06a297a1a8b5a1e28f37daa6951b4ce597d103492458c5ae90f69545908cd41238c5ed91b249ad2dd9b9cec3ef4feeb9ad22245c692eaa72'
'140b8fd340caf1069fcde0d23c8058488a59518b0b55db70290bd2c50b6c3c1c28978fe7d3a6e8feff65cec990f41e34cf68876acfc0183c51f6a58e9f8cb668'
SKIP
SKIP
)
sha512sums=('42ff4b59a0dd846f06a297a1a8b5a1e28f37daa6951b4ce597d103492458c5ae90f69545908cd41238c5ed91b249ad2dd9b9cec3ef4feeb9ad22245c692eaa72'
'140b8fd340caf1069fcde0d23c8058488a59518b0b55db70290bd2c50b6c3c1c28978fe7d3a6e8feff65cec990f41e34cf68876acfc0183c51f6a58e9f8cb668'
'SKIP'
'SKIP')
prepare() {
# fix the .desktop file

View file

@ -6,40 +6,37 @@ PKG=$(awk -F '=' '/pkgname=/{ print $2 }' PKGBUILD)
# Get latest version
VER=$(
curl -fsS \
-o /dev/null \
-w '%{redirect_url}' \
'https://discord.com/api/download?platform=linux&format=tar.gz' |
grep -o '[0-9]*\.[0-9]*\.[0-9]*' |
head -n1
curl -fsS \
-o /dev/null \
-w '%{redirect_url}' \
'https://discord.com/api/download?platform=linux&format=tar.gz' |
grep -o '[0-9]*\.[0-9]*\.[0-9]*' |
head -n1
)
[[ -n $VER ]]
# Insert latest version into PKGBUILD
sed -i \
-e "s/^pkgver=.*/pkgver=${VER}/" \
PKGBUILD
-e "s/^pkgver=.*/pkgver=${VER}/" \
PKGBUILD
# Check whether this changed anything
if (git diff --exit-code PKGBUILD); then
echo "Package ${PKG} has most recent version ${VER}"
exit 0
echo "Package ${PKG} has most recent version ${VER}"
exit 0
fi
# Reset pkgrel
sed -i \
-e 's/pkgrel=.*/pkgrel=1/' \
PKGBUILD
-e 's/pkgrel=.*/pkgrel=1/' \
PKGBUILD
# Update source hashes
updpkgsums
# Remove checksums for HTML files (they change all the time)
sed -i -e "/sha512sums/,/)/ {s/ '.*'/ 'SKIP'/}" PKGBUILD
# Update .SRCINFO
makepkg --printsrcinfo >.SRCINFO
sed -i -e "/sha512sums/,/)/ {n;n;s/ '.*'/ 'SKIP'/;n;s/ '.*'/ 'SKIP'/}" PKGBUILD
# Commit changes
git add PKGBUILD .SRCINFO
git add PKGBUILD
git commit -m "${PKG} v${VER}"