aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorremspoor2021-12-18 15:50:24 +0100
committerremspoor2021-12-18 15:50:24 +0100
commit1961012ae5cd7a4979219aeb5499025acfc07346 (patch)
treed5d9baa1869ee92152d5491769c5aa1fc088a5b9
parenta4394a02a657b5874fc40f034ebee3a2a2a413bb (diff)
downloadaur-1961012ae5cd7a4979219aeb5499025acfc07346.tar.gz
Update: next 2.024-1
Changed update_download_id.sh to make updating easier
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD14
-rw-r--r--update_download_id.sh19
3 files changed, 30 insertions, 9 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 37aa931ba220..8d613b2d95fe 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = next
pkgdesc = CGM rc Heli Flight Simulator
- pkgver = 2.018
+ pkgver = 2.024
pkgrel = 1
url = http://www.rc-aerobatics.eu/index_e.html
install = next.install
@@ -9,10 +9,10 @@ pkgbase = next
optdepends = joyutils: jscal, jstest, and jsattach utilities for the Linux joystick driver
optdepends = controllermap: Game controller mapping generator, to generate env. var. SDL_GAMECONTROLLERCONFIG
optdepends = antimicro: Game controller mapping generator, to generate env. var. SDL_GAMECONTROLLERCONFIG
- source = next-2.018.zip::https://magentacloud.de/s/ggLbDgGj6A7Aj5a/download/cgm-rc-flight-simulator-linux-2018.zip
+ source = next-2.024.zip::https://magentacloud.de/s/9TQAjLaXFd5pj9B/download/cgm-rc-flight-simulator-linux-2024.zip
source = next.desktop
source = next.sh
- sha512sums = 81157eb03db5dd2275dba9eb07c29ee28f6de30deb92091d6d02b9e9993a9e523367d21f616078ca6550fcd70305c918aaccd12a8e0393f522379d4f05db3312
+ sha512sums = a954bcddf0f58cc37cbbd53dcf2c9987782ce8bcd787ccc3a0c48ef1b86db2199bd57d0235ea04a480f26018a4e1ef628b7c27819e581b86203e749d05653679
sha512sums = 73fa793d92ef60e052b82776e89316024fbe46634a695516820b0f2740727c92e94da72f318bb22817686e53f827106ce3048126852c23608295464d90ee4b6d
sha512sums = c982aea8a23d6259069f97a8a71f74270811488818ad0e5c8496047f94cf357d64fe3267f04628030d6b766dc3dd62d5d56ab0387e4ad5bd943a7e7a39598669
diff --git a/PKGBUILD b/PKGBUILD
index f4fbd3d5f5c5..4c53a6ccb40a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,9 +1,15 @@
# Maintainer(s): remspoor <remspoor AT linuxmail DOT org>
# Jake <aur@ja-ke.tech>
+# These variables should be updated with ./update_download_id.sh
+_download_url='https://magentacloud.de/s/9TQAjLaXFd5pj9B/download/cgm-rc-flight-simulator-linux-2024.zip'
+# _download_[id|file] can be cleaned up later
+_download_id='9TQAjLaXFd5pj9B'
+_download_file='cgm-rc-flight-simulator-linux-2024.zip'
+_pkgver='2.024'
+
pkgname=next
-pkgver=2.018
-_download_id='ggLbDgGj6A7Aj5a'
+pkgver="${_pkgver}"
pkgrel=1
pkgdesc="CGM rc Heli Flight Simulator"
arch=('x86_64')
@@ -14,11 +20,11 @@ optdepends=( 'joyutils: jscal, jstest, and jsattach utilities for the Linux joys
'antimicro: Game controller mapping generator, to generate env. var. SDL_GAMECONTROLLERCONFIG')
install="${pkgname}.install"
-source=("${pkgname}-${pkgver}.zip::https://magentacloud.de/s/${_download_id}/download/cgm-rc-flight-simulator-linux-2018.zip"
+source=("${pkgname}-${pkgver}.zip::${_download_url}"
"next.desktop"
"next.sh")
-sha512sums=('81157eb03db5dd2275dba9eb07c29ee28f6de30deb92091d6d02b9e9993a9e523367d21f616078ca6550fcd70305c918aaccd12a8e0393f522379d4f05db3312'
+sha512sums=('a954bcddf0f58cc37cbbd53dcf2c9987782ce8bcd787ccc3a0c48ef1b86db2199bd57d0235ea04a480f26018a4e1ef628b7c27819e581b86203e749d05653679'
'73fa793d92ef60e052b82776e89316024fbe46634a695516820b0f2740727c92e94da72f318bb22817686e53f827106ce3048126852c23608295464d90ee4b6d'
'c982aea8a23d6259069f97a8a71f74270811488818ad0e5c8496047f94cf357d64fe3267f04628030d6b766dc3dd62d5d56ab0387e4ad5bd943a7e7a39598669')
diff --git a/update_download_id.sh b/update_download_id.sh
index a6b53087d118..ceed24ec978a 100644
--- a/update_download_id.sh
+++ b/update_download_id.sh
@@ -1,8 +1,23 @@
+#
+# Script to extract the download url and current version from the magentacloud mirror
+#
+
u='https://www.cgm-online.com/cgi-bin/rc_sim_downloadcount.pl?name=next_linux_mirror'
-id=$(curl -Ls -o /dev/null $u -w %{url_effective} | cut -d '/' -f5)
+page=$(curl -Ls $u -w %{url_effective})
+# A bit nasty to use head
+url=$(echo $page | grep -Eoih value\=\"[^\"]*\" | grep download | head -n1 | sed 's~\(value=\)\|\("\)~~g')
+
+id=$(echo $url | cut -d '/' -f5)
+file=$(basename $url)
+basever=$(echo $file | grep -Eo '[0-9]+')
+ver=$(echo $basever | sed 's/...$/.&/')
+
+sed -E "s#(_download_url=).*#\1'$url'#" -i PKGBUILD
sed -E "s#(_download_id=).*#\1'$id'#" -i PKGBUILD
+sed -E "s#(_download_file=).*#\1'$file'#" -i PKGBUILD
+sed -E "s#(_pkgver=).*#\1'$ver'#" -i PKGBUILD
-target="https://magentacloud.de/s/${id}/download/cgm-rc-flight-simulator-linux-2018.zip"
+target="https://magentacloud.de/s/${id}/download/${file}"
echo "Generated download url: $target"
#curl -fLC - --retry 3 --retry-delay 3 -OJ $target