summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorcorey drew bruce2023-12-30 19:22:52 +1000
committercorey drew bruce2023-12-30 19:22:52 +1000
commitc6f10cabef1ce480747fad002313742a5f8dd77c (patch)
tree259ac946973fa74c093da2b175e616189a6d4f1a
parenta9846263a34bd9ead426486018dc2e248abf6580 (diff)
downloadaur-c6f10cabef1ce480747fad002313742a5f8dd77c.tar.gz
package will now check if the data file exists and skip if it does so it doesn't needlessly download it again on every update which only needs to download once
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD16
2 files changed, 13 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5e691f8efab2..579b4410a5a8 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -16,8 +16,6 @@ pkgbase = sonicthehedgehog
depends = unzip
depends = zenity
source = https://gitlab.com/SonicRSDK/sonicthehedgehog/-/archive/1.0.0-1/sonicthehedgehog-1.0.0-1.tar.bz2
- source = https://archive.org/download/data_20231229_202312/Data.rsdk
- sha256sums = SKIP
sha256sums = SKIP
pkgname = sonicthehedgehog
diff --git a/PKGBUILD b/PKGBUILD
index 47ca8c4c2ad5..c97941613b4a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,8 +8,8 @@ url="https://gitlab.com/SonicRSDK/sonicthehedgehog"
license=('GPL')
depends=('rsdkv4-bin' 'libogg' 'libvorbis' 'wget' 'sdl2' 'unzip' 'zenity')
makedepends=('unzip')
-source=("https://gitlab.com/SonicRSDK/sonicthehedgehog/-/archive/$pkgver-$pkgrel/sonicthehedgehog-$pkgver-$pkgrel.tar.bz2" "https://archive.org/download/data_20231229_202312/Data.rsdk")
-sha256sums=("SKIP" "SKIP")
+source=("https://gitlab.com/SonicRSDK/sonicthehedgehog/-/archive/$pkgver-$pkgrel/sonicthehedgehog-$pkgver-$pkgrel.tar.bz2")
+sha256sums=("SKIP")
package() {
install -dm755 "$pkgdir/usr/bin"
@@ -17,10 +17,20 @@ package() {
install -dm755 "$pkgdir/usr/share/pixmaps"
# Packaging files
+
+ # Check if Data.rsdk exists so it doesn't redownload the file when it doesn't need to.
+ FILE="/usr/share/games/$_pkgname/Data.rsdk"
+ if test -f "$FILE"
+ then
+ echo "$FILE exists skipping download."
+ else
+ echo "$FILE does not exist, Starting download.."
+ cd $srcdir/$pkgname-$pkgver-$pkgrel
+ wget "https://archive.org/download/data_20231229_202312/Data.rsdk"
+ fi
cd $srcdir/$pkgname-$pkgver-$pkgrel
cp "$srcdir/$pkgname-$pkgver-$pkgrel/sonic.sh" "$pkgdir/usr/bin/sonic"
cp -r ./ "$pkgdir/usr/share/games/$_pkgname"
- cp "$srcdir/Data.rsdk" "$pkgdir/usr/share/games/$_pkgname"
cp sonic.png "$pkgdir/usr/share/pixmaps"
# Desktop Entry