From e4437013c2a5dc54ee863b46288045e352e76b2e Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 24 Nov 2018 14:36:04 +0100 Subject: [PATCH] Update maintainer, add update-script, switch to sha512 Signed-off-by: Knut Ahlers --- .SRCINFO | 6 +++--- PKGBUILD | 9 +++++---- update_version.sh | 28 ++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 7 deletions(-) create mode 100755 update_version.sh diff --git a/.SRCINFO b/.SRCINFO index 04d9782..18a2788 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -25,9 +25,9 @@ pkgbase = google-chrome-beta source = google-chrome-beta_71.0.3578.62_amd64.deb::https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb source = eula_text.html source = google-chrome-beta.sh - md5sums = aa2364556a3cfc40a6f498fbe80900ce - md5sums = d50d8f0a6940791eabc41c4f64e6a3cf - md5sums = ca16d5162eed85b1ba4e6b9fc37f9e35 + sha512sums = 6e92926fc738483e04de270ea6a4d23e676ca25fe2822865f38c1c32f1205155886414f1e7eaeece0ebb6c48cb6eb9156421bf2070cd59078c4b5ad63ec336af + sha512sums = a225555c06b7c32f9f2657004558e3f996c981481dbb0d3cd79b1d59fa3f05d591af88399422d3ab29d9446c103e98d567aeafe061d9550817ab6e7eb0498396 + sha512sums = ce84dadfd8accc8bc590c8570bda7f59b415f125967f712fc9b64e10a7ab64d0f677fa8f14d2e7a2645f732c60701d9158fa421cc1f8f82715bdcf63999a005b pkgname = google-chrome-beta diff --git a/PKGBUILD b/PKGBUILD index df8514e..4c12d76 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,4 +1,5 @@ -# Maintainer: Det +# Maintainer: Knut Ahlers +# Contributor: Det # Contributors: t3ddy, Lex Rivera aka x-demon, ruario # Check for new Linux releases in: http://googlechromereleases.blogspot.com/search/label/Beta%20updates @@ -26,9 +27,9 @@ _channel=beta source=("google-chrome-${_channel}_${pkgver}_amd64.deb::https://dl.google.com/linux/direct/google-chrome-${_channel}_current_amd64.deb" 'eula_text.html' "google-chrome-$_channel.sh") -md5sums=('aa2364556a3cfc40a6f498fbe80900ce' - 'd50d8f0a6940791eabc41c4f64e6a3cf' - 'ca16d5162eed85b1ba4e6b9fc37f9e35') +sha512sums=('6e92926fc738483e04de270ea6a4d23e676ca25fe2822865f38c1c32f1205155886414f1e7eaeece0ebb6c48cb6eb9156421bf2070cd59078c4b5ad63ec336af' + 'a225555c06b7c32f9f2657004558e3f996c981481dbb0d3cd79b1d59fa3f05d591af88399422d3ab29d9446c103e98d567aeafe061d9550817ab6e7eb0498396' + 'ce84dadfd8accc8bc590c8570bda7f59b415f125967f712fc9b64e10a7ab64d0f677fa8f14d2e7a2645f732c60701d9158fa421cc1f8f82715bdcf63999a005b') ## Previous versions (also see: /var/cache/pacman/pkg/google-chrome-beta-*): #source[0]="https://dl.google.com/linux/deb/pool/main/g/google-chrome-${_channel}/google-chrome-${_channel}_${pkgver}-1_amd64.deb" diff --git a/update_version.sh b/update_version.sh new file mode 100755 index 0000000..a51aa96 --- /dev/null +++ b/update_version.sh @@ -0,0 +1,28 @@ +#!/bin/bash +set -euxo pipefail + +# Get channel +CHANNEL=$(awk -F '=' '/^_channel/{ print $2 }' PKGBUILD) +PKG="google-chrome-${CHANNEL}" + +# Get latest version +VER=$(curl -sL "https://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/other.xml.gz" | gzip -df | + tr ' ' '\n' | grep -e name= -e ver= | cut -d '"' -f2 | sed 'N;s/\n/ /' | + grep "${PKG}" | cut -d ' ' -f 2) + +# Insert latest version into PKGBUILD and update hashes +sed -i "s/^pkgver=.*/pkgver=${VER}/" PKGBUILD +updpkgsums + +# Check whether this changed anything +if (git diff --exit-code PKGBUILD); then + echo "Package ${PKG} has most recent version ${VER}" + exit 0 +fi + +# Update .SRCINFO +makepkg --printsrcinfo >.SRCINFO + +# Commit changes +git add PKGBUILD .SRCINFO +git commit -m "${PKG} v${VER}"