diff options
author | corey drew bruce | 2023-12-30 19:22:52 +1000 |
---|---|---|
committer | corey drew bruce | 2023-12-30 19:22:52 +1000 |
commit | c6f10cabef1ce480747fad002313742a5f8dd77c (patch) | |
tree | 259ac946973fa74c093da2b175e616189a6d4f1a | |
parent | a9846263a34bd9ead426486018dc2e248abf6580 (diff) | |
download | aur-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-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 16 |
2 files changed, 13 insertions, 5 deletions
@@ -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 @@ -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 |