diff options
author | Félix Saparelli | 2016-09-24 14:02:25 +1200 |
---|---|---|
committer | Félix Saparelli | 2016-09-24 14:13:57 +1200 |
commit | 8fe211e193e46eb4278d52098655a9b5c1c1d9f2 (patch) | |
tree | 3b59475641a82ebc327937866554916ab1f5fb4a | |
parent | 94adedde4478e0a5eec38daadb82fab6e58ac0ef (diff) | |
download | aur-8fe211e193e46eb4278d52098655a9b5c1c1d9f2.tar.gz |
Download file as a different name every day
This should fix an issue with pacaur reported by SolarAquarion [0]:
> In pacaur the checksum calculation fails because it doesn't delete the
> tar.bz2 instead it keeps it in ~/.cache/pacaur/firefox-always-nightly
> so if it downloads an update which has the same name but a different
> checksum, the download fails. The only way to make sure it doesn't
> fail would be to find a way to get a different tar.bz2 name everyday.
Their earlier proposed solution:
> change: `source=("${_srcurl}/${_file}.tar.bz2"`
> to: `source=("$pkgname-$pkgver.tar.bz2"::"${_srcurl}/${_file}.tar.bz2"`
> [and similarly for the .txt]
However it seemed to me that given the problem as explained, this would
have made the filename `firefox-always-nightly-99.0a.tar.bz2` everyday,
due to the order of execution within the PKGBUILD. Thus, it would help
even less. What I ended up doing was to use the current system date as
part of the filename, which ensures that it changes every day.
[0]: https://aur.archlinux.org/account/SolarAquarion
Also included in this changeset is a minor refactor of the GPG
verification block; functionality should stay unchanged.
-rw-r--r-- | .SRCINFO | 60 | ||||
-rw-r--r-- | PKGBUILD | 17 |
2 files changed, 39 insertions, 38 deletions
@@ -1,33 +1,33 @@ pkgbase = firefox-always-nightly - pkgdesc = Standalone web browser from mozilla.org, nightly build, always updating - pkgver = 99.0a1 - pkgrel = 7 - url = https://nightly.mozilla.org - arch = i686 - arch = x86_64 - license = MPL - license = GPL - license = LGPL - depends = alsa-lib - depends = dbus-glib - depends = gtk2 - depends = libnotify - depends = libxt - depends = mime-types - depends = nss - depends = sqlite - provides = firefox-nightly - conflicts = firefox-nightly - source = https://ftp.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-VERSION.en-US.linux-ARCH.tar.bz2 - source = https://ftp.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-VERSION.en-US.linux-ARCH.txt - source = firefox-nightly.desktop - source = firefox-nightly-safe.desktop - source = vendor.js - sha512sums = - sha512sums = - sha512sums = d2d836b07288d2a13d01d668399df8a2a15884a58a7051303938bf74a30bdfc23a8bc57395494345727ae24e1dd9cab09c67a640a5c9e7a8df895f987e009dcd - sha512sums = 00caf982c072c7499433c494ecf2096542c4ddf368c4b97fb22672fd669683911d009a65a498b8a03da61ae9aa5a4e8bdaa6e58b148c2a5d7c008910b2af26a5 - sha512sums = bae5a952d9b92e7a0ccc82f2caac3578e0368ea6676f0a4bc69d3ce276ef4f70802888f882dda53f9eb8e52911fb31e09ef497188bcd630762e1c0f5293cc010 - pkgname = firefox-always-nightly +pkgdesc = Standalone web browser from mozilla.org, nightly build, always updating +pkgver = 99.0a1 +pkgrel = 8 +url = https://nightly.mozilla.org +arch = i686 +arch = x86_64 +license = MPL +license = GPL +license = LGPL +depends = alsa-lib +depends = dbus-glib +depends = gtk2 +depends = libnotify +depends = libxt +depends = mime-types +depends = nss +depends = sqlite +provides = firefox-nightly +conflicts = firefox-nightly +source = https://ftp.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-VERSION.en-US.linux-ARCH.tar.bz2 +source = https://ftp.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-VERSION.en-US.linux-ARCH.txt +source = firefox-nightly.desktop +source = firefox-nightly-safe.desktop +source = vendor.js +sha512sums = SKIP +sha512sums = SKIP +sha512sums = d2d836b07288d2a13d01d668399df8a2a15884a58a7051303938bf74a30bdfc23a8bc57395494345727ae24e1dd9cab09c67a640a5c9e7a8df895f987e009dcd +sha512sums = 00caf982c072c7499433c494ecf2096542c4ddf368c4b97fb22672fd669683911d009a65a498b8a03da61ae9aa5a4e8bdaa6e58b148c2a5d7c008910b2af26a5 +sha512sums = bae5a952d9b92e7a0ccc82f2caac3578e0368ea6676f0a4bc69d3ce276ef4f70802888f882dda53f9eb8e52911fb31e09ef497188bcd630762e1c0f5293cc010 + @@ -10,7 +10,7 @@ pkgname=firefox-always-nightly pkgdesc='Standalone web browser from mozilla.org, nightly build, always updating' url='https://nightly.mozilla.org' pkgver=99.0a1 -pkgrel=7 +pkgrel=8 arch=('i686' 'x86_64') license=('MPL' 'GPL' 'LGPL') _srcurl="https://ftp.mozilla.org/pub/firefox/nightly/latest-mozilla-central" @@ -19,8 +19,9 @@ _file="firefox-${_version}.en-US.linux-${CARCH}" curl -so {,${_srcurl}/}${_file}.checksums _sumbz2="$(grep -E sha512.+${_file}\.tar\.bz2 ${_file}.checksums | cut -d\ -f1)" _sumtxt="$(grep -E sha512.+${_file}\.txt ${_file}.checksums | cut -d\ -f1)" -source=("${_srcurl}/${_file}.tar.bz2" - "${_srcurl}/${_file}.txt" +_nametoday="${pkgname}-${pkgver}-$(date +%F)" +source=("${_nametoday}.tar.bz2::${_srcurl}/${_file}.tar.bz2" + "${_nametoday}.txt::${_srcurl}/${_file}.txt" 'firefox-nightly.desktop' 'firefox-nightly-safe.desktop' 'vendor.js') @@ -41,7 +42,7 @@ provides=('firefox-nightly') conflicts=('firefox-nightly') pkgver() { - echo "${_version}.$(head -n1 ${_file}.txt | cut -c-8)" + echo "${_version}.$(head -n1 ${_nametoday}.txt | cut -c-8)" } package() { @@ -52,10 +53,10 @@ package() { # shortid 0x15A0A4BC if [[ $VERIFY_GPG -eq 1 ]]; then msg "Verifying GnuPG signature..." - FX_GPG="${_file}.checksums.asc" - curl -OR "${_srcurl}/${_file}.checksums" - curl -OR "${_srcurl}/${FX_GPG}" - gpg --verify ${FX_GPG} + _sums="${_file}.checksums" + curl -OR "${_srcurl}/${_sums}" + curl -OR "${_srcurl}/${_sums}.asc" + gpg --verify "${sums}.asc" fi # uncomment this line to remove these |