diff options
author | Rafael Cruz | 2020-09-03 22:05:00 -0300 |
---|---|---|
committer | Rafael Cruz | 2020-09-03 22:05:00 -0300 |
commit | e05d00bf572216eaf24fa9731cb75224edef7bf6 (patch) | |
tree | 2baec6cea4a6259764b5f13ef01a131ef674df6e | |
parent | 251682513a5ef99764d0e139c43522b1217fd436 (diff) | |
download | aur-e05d00bf572216eaf24fa9731cb75224edef7bf6.tar.gz |
update
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 34 |
2 files changed, 32 insertions, 4 deletions
@@ -1,7 +1,7 @@ pkgbase = fightcade2 pkgdesc = The best way to play your favorite retro games with or against any other player in the world. pkgver = 2.0.77 - pkgrel = 5 + pkgrel = 6 url = https://www.fightcade.com/ arch = any license = custom @@ -2,7 +2,7 @@ pkgname=fightcade2 pkgver=2.0.77 -pkgrel=5 +pkgrel=6 pkgdesc='The best way to play your favorite retro games with or against any other player in the world.' url='https://www.fightcade.com/' arch=('any') @@ -16,17 +16,45 @@ _romsPkgname="$pkgname-roms" createShellFiles() { cat << 'EOF' > $srcdir/Fightcade/start.sh #!/bin/bash + fightcadeUserFolderName="fightcade2" fightcadeInstallFolder="/opt/$fightcadeUserFolderName" fightcadeUserFolderPath="$HOME/.$fightcadeUserFolderName" fightcadeRomsPath="$fightcadeUserFolderPath/ROMs" +oldVersionTxt="$fightcadeUserFolderPath/VERSION.txt" +newVersionTxt="$fightcadeInstallFolder/VERSION.txt" +oldVersion=0 +newVersion=0 + +function compareVersion () { + #1: requiredver + #2: currentver + if [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$1" ]; then + return 0 + else + return 1 + fi +} + +if [ -f "$oldVersionTxt" ] +then + oldVersion=`cat $fightcadeUserFolderPath/VERSION.txt` +fi + +if [ -f "$newVersionTxt" ] +then + newVersion=`cat $fightcadeInstallFolder/VERSION.txt` +fi if [ "$1" = "roms" ]; then xdg-open "$fightcadeRomsPath" exit 1 fi -if [ ! -f "$fightcadeUserFolderPath/Fightcade2.sh" ] +compareVersion "$newVersion" "$oldVersion" +hasNewVersion=$? + +if [ ! -f "$fightcadeUserFolderPath/Fightcade2.sh" ] || [ "$hasNewVersion" -eq "1" ] then mkdir -p "$fightcadeUserFolderPath" rsync -r --copy-links $fightcadeInstallFolder/* $fightcadeUserFolderPath @@ -49,6 +77,6 @@ package() { install -Dm644 "$srcdir/$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop" install -Dm644 "$srcdir/$_romsPkgname.desktop" "$pkgdir/usr/share/applications/$_romsPkgname.desktop" msg "Copying files..." - rsync -r --copy-links $srcdir/Fightcade/* $pkgdir/opt/$pkgname/ + rsync -r -I --copy-links $srcdir/Fightcade/* $pkgdir/opt/$pkgname/ chmod +x $pkgdir/opt/$pkgname/start.sh } |