script for linux update Yuzu #132

Open
opened 2023-06-08 11:22:43 +02:00 by netzgiest · 9 comments
netzgiest commented 2023-06-08 11:22:43 +02:00 (Migrated from github.com)

I suggest a script that implements emulator update from the command line from main site

#!/bin/bash
url=$(curl -s 'https://pineappleea.github.io/' | grep -o 'https://github.com/pineappleEA/pineapple-src/releases/tag/EA-[0-9]' | head -1)
if [ -n "$url" ]; then
appimage_url=$(echo $url | sed -E 's|https://github.com/(.
)/releases/tag/EA-(.*)|https://github.com/\1/releases/download/EA-\2/Linux-Yuzu-EA-\2.AppImage|')
wget $appimage_url -O ./Yuzu.AppImage
else
echo "unable find link or something else"
fi

I suggest a script that implements emulator update from the command line from main site #!/bin/bash url=$(curl -s 'https://pineappleea.github.io/' | grep -o 'https://github.com/pineappleEA/pineapple-src/releases/tag/EA-[0-9]*' | head -1) if [ -n "$url" ]; then appimage_url=$(echo $url | sed -E 's|https://github.com/(.*)/releases/tag/EA-(.*)|https://github.com/\1/releases/download/EA-\2/Linux-Yuzu-EA-\2.AppImage|') wget $appimage_url -O ./Yuzu.AppImage else echo "unable find link or something else" fi
qurious-pixel commented 2023-06-08 23:24:56 +02:00 (Migrated from github.com)

This should work:

#!/bin/bash

GITURL='https://api.github.com/repos/pineappleEA/pineapple-src/releases/latest'
GITVER=$(wget -qO- "$GITURL" | grep -o 'Linux-Yuzu-EA-[[:digit:]]*.AppImage' | uniq | grep -o '[[:digit:]]*' )
APP=$(ls Linux-Yuzu-EA-*.AppImage | tail -n 1 )
APPVER=$(echo "$APP" | grep -o '[[:digit:]]*' )
DOWNLOAD_URL=$(wget -qO- "$GITURL" | grep "browser_download_url.*AppImage" | cut -d : -f 2,3 | tr -d \" )

if [ "$GITVER" -gt "$APPVER" ]; then
	"$(wget -q $DOWNLOAD_URL)"
	chmod +x ./Linux-Yuzu-EA-"$GITVER".AppImage
        ## This removes all but the last 3 versions ##
	# rm $(ls Linux-Yuzu-EA-*.AppImage| head -n -3)	
	./Linux-Yuzu-EA-"$GITVER".AppImage
else
	./"$APP"
fi
This should work: ``` #!/bin/bash GITURL='https://api.github.com/repos/pineappleEA/pineapple-src/releases/latest' GITVER=$(wget -qO- "$GITURL" | grep -o 'Linux-Yuzu-EA-[[:digit:]]*.AppImage' | uniq | grep -o '[[:digit:]]*' ) APP=$(ls Linux-Yuzu-EA-*.AppImage | tail -n 1 ) APPVER=$(echo "$APP" | grep -o '[[:digit:]]*' ) DOWNLOAD_URL=$(wget -qO- "$GITURL" | grep "browser_download_url.*AppImage" | cut -d : -f 2,3 | tr -d \" ) if [ "$GITVER" -gt "$APPVER" ]; then "$(wget -q $DOWNLOAD_URL)" chmod +x ./Linux-Yuzu-EA-"$GITVER".AppImage ## This removes all but the last 3 versions ## # rm $(ls Linux-Yuzu-EA-*.AppImage| head -n -3) ./Linux-Yuzu-EA-"$GITVER".AppImage else ./"$APP" fi ```
NightHammer1000 commented 2023-06-09 19:52:38 +02:00 (Migrated from github.com)

Something that In-place Replaces the .AppImage with a fixed Name would be nice.
To keep shortcuts made by SteamRomManager or EmulationStation intact.

Something that In-place Replaces the .AppImage with a fixed Name would be nice. To keep shortcuts made by SteamRomManager or EmulationStation intact.
NightHammer1000 commented 2023-06-09 20:07:22 +02:00 (Migrated from github.com)

I use this at the Top of my yuzu.sh of the Emudeck Installation on my Steam Deck.

It pulls the latest Yuzu everytime you start a Game that way:

cd /tmp
curl -s https://api.github.com/repos/pineappleEA/pineapple-src/releases/latest \
| grep -e "https.*Yuzu.*AppImage" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -

FILE=`find /tmp -name '*Yuzu*' 2>/dev/null`
chmod +x $FILE
mv $FILE /home/deck/Applications/yuzu.AppImage
I use this at the Top of my yuzu.sh of the Emudeck Installation on my Steam Deck. It pulls the latest Yuzu everytime you start a Game that way: ``` cd /tmp curl -s https://api.github.com/repos/pineappleEA/pineapple-src/releases/latest \ | grep -e "https.*Yuzu.*AppImage" \ | cut -d : -f 2,3 \ | tr -d \" \ | wget -qi - FILE=`find /tmp -name '*Yuzu*' 2>/dev/null` chmod +x $FILE mv $FILE /home/deck/Applications/yuzu.AppImage ```
smallevilbeast commented 2023-06-09 20:58:29 +02:00 (Migrated from github.com)

update_yuzu.sh

#!/bin/bash

GITURL='https://api.github.com/repos/pineappleEA/pineapple-src/releases/latest'
content=$(wget -qO- "$GITURL")

GITVER=$(echo "$content" | grep -o 'Linux-Yuzu-EA-[[:digit:]]*.AppImage' | uniq | grep -o '[[:digit:]]*' )
DOWNLOAD_URL=$(echo "$content" | grep "browser_download_url.*AppImage" | cut -d : -f 2,3 | tr -d \" )

files=(Linux-Yuzu-EA-*.AppImage)
if [ -f "${files[0]}" ]; then
    APPVER=$(echo "${files[-1]}" | grep -o '[[:digit:]]*')
else
    APPVER=0
fi

if [ "$GITVER" -gt "$APPVER" ]; then
        echo "Check for a new version: $GITVER, start download"
        wget --no-verbose --show-progress $DOWNLOAD_URL
        chmod +x ./Linux-Yuzu-EA-"$GITVER".AppImage
        files=(Linux-Yuzu-EA-*.AppImage)
	file_count=${#files[@]}
        if [ $file_count -gt 2 ]; then
                delete=("${files[@]:0:$(($file_count-2))}")
                rm "${delete[@]}"
        fi
        echo "Successfully updated to the latest version: $GITVER"
else
        echo "Already the latest version"
fi

run_yuzu.sh

RUN_DIR=$(dirname "$0")
APP=$(ls $RUN_DIR/Linux-Yuzu-EA-*.AppImage | tail -n 1 )
$APP

yuzu.desktop

[Desktop Entry]
Name=yuzu
Exec=/home/evilbeast/Game/run_yuzu.sh
Icon=/home/evilbeast/icons/yuzu.svg
Type=Application
Categories=Utility;

In this way, it can be updated to the latest by comparing the version number, and it can be guaranteed to run to the latest yuzu

update_yuzu.sh ```bash #!/bin/bash GITURL='https://api.github.com/repos/pineappleEA/pineapple-src/releases/latest' content=$(wget -qO- "$GITURL") GITVER=$(echo "$content" | grep -o 'Linux-Yuzu-EA-[[:digit:]]*.AppImage' | uniq | grep -o '[[:digit:]]*' ) DOWNLOAD_URL=$(echo "$content" | grep "browser_download_url.*AppImage" | cut -d : -f 2,3 | tr -d \" ) files=(Linux-Yuzu-EA-*.AppImage) if [ -f "${files[0]}" ]; then APPVER=$(echo "${files[-1]}" | grep -o '[[:digit:]]*') else APPVER=0 fi if [ "$GITVER" -gt "$APPVER" ]; then echo "Check for a new version: $GITVER, start download" wget --no-verbose --show-progress $DOWNLOAD_URL chmod +x ./Linux-Yuzu-EA-"$GITVER".AppImage files=(Linux-Yuzu-EA-*.AppImage) file_count=${#files[@]} if [ $file_count -gt 2 ]; then delete=("${files[@]:0:$(($file_count-2))}") rm "${delete[@]}" fi echo "Successfully updated to the latest version: $GITVER" else echo "Already the latest version" fi ``` run_yuzu.sh ```bash RUN_DIR=$(dirname "$0") APP=$(ls $RUN_DIR/Linux-Yuzu-EA-*.AppImage | tail -n 1 ) $APP ``` yuzu.desktop ```ini [Desktop Entry] Name=yuzu Exec=/home/evilbeast/Game/run_yuzu.sh Icon=/home/evilbeast/icons/yuzu.svg Type=Application Categories=Utility; ``` In this way, it can be updated to the latest by comparing the version number, and it can be guaranteed to run to the latest yuzu
ThisNekoGuy commented 2023-06-10 22:47:41 +02:00 (Migrated from github.com)

AppImages actually already have a self-update feature, so I don't see why this wasn't considered?

[AppImages actually already have a self-update feature](https://docs.appimage.org/packaging-guide/optional/updates.html#making-appimages-self-updateable), so I don't see why this wasn't considered?
IsraelMachado commented 2023-06-13 15:48:38 +02:00 (Migrated from github.com)

For those who use emudeck and want the update function of the original script to work the same way as it works for the mainline, it's just necessary to modify an URL inside the yuzu.sh file located in the Emulation/tools/launchers directory. Please, do the following:

  • Open the file with a text editor (if you're using the Steam Deck, you can open it with KWrite)
  • Search for yuzuHost
  • The first time it appears, it should have an URL declared. Change that URL for the following: https://api.github.com/repos/pineappleEA/pineapple-src/releases/latest
  • Save the file, and the next time you open a game that uses that script, you should be prompted to update

Every time a new update is sent to this repository on GitHub, we'll be prompted by the original script to update. Then, it's up to you whether you want to update. Nice and easy :)

For those who use emudeck and want the update function of the original script to work the same way as it works for the mainline, it's just necessary to modify an URL inside the yuzu.sh file located in the Emulation/tools/launchers directory. Please, do the following: - Open the file with a text editor (if you're using the Steam Deck, you can open it with KWrite) - Search for _yuzuHost_ - The first time it appears, it should have an URL declared. Change that URL for the following: https://api.github.com/repos/pineappleEA/pineapple-src/releases/latest - Save the file, and the next time you open a game that uses that script, you should be prompted to update Every time a new update is sent to this repository on GitHub, we'll be prompted by the original script to update. Then, it's up to you whether you want to update. Nice and easy :)
MGThePro commented 2023-06-13 16:08:30 +02:00 (Migrated from github.com)

AppImages actually already have a self-update feature, so I don't see why this wasn't considered?

From the perspective of yuzu devs: No easy way to implement authentication this way, so either it wouldn't be possible at all or everyone could update even without being a patron

From the perspective of us, the people maintaining pinEApple: Would require modifying the supplied appimages, which would risk breaking stuff in ways that could be unpredictable. Also takes some time to setup. An external updater script is just easier.

> [AppImages actually already have a self-update feature](https://docs.appimage.org/packaging-guide/optional/updates.html#making-appimages-self-updateable), so I don't see why this wasn't considered? From the perspective of yuzu devs: No easy way to implement authentication this way, so either it wouldn't be possible at all or everyone could update even without being a patron From the perspective of us, the people maintaining pinEApple: Would require modifying the supplied appimages, which would risk breaking stuff in ways that could be unpredictable. Also takes some time to setup. An external updater script is just easier.
noksookhao commented 2023-08-03 14:47:11 +02:00 (Migrated from github.com)

In case it is useful to anyone else that likes to keep multiple versions, this is the script I use. It automatically checks (and pulls, if newer) the latest version each launch, then provides a dialog allowing the user to choose an installed version. The requested version is then launched (optionally) with MangoHUD and gamemode:

#!/usr/bin/env bash
### set to directory where yuzuEA AppImages are stored 
YUZUBINDIR="${HOME}/Downloads"
### set to 1 to enable mangohud, 0 to disable
mango=1
### set to 'gamemoderun' to enable gamemode, set to blank to disable
gamemode="gamemoderun"

for x in jq dialog wget xargs cut; do
    [ "$(builtin command -v ${x})" ] ||
        {
            builtin echo "This script requires ${x}, which does not seem to be installed. \
            Re-run this script once ${x} is installed." &&
            builtin exit 1; 
        }
done

latest_yuzu="$(
        wget -qO- 'https://api.github.com/repos/pineappleEA/pineapple-src/releases/latest' |
        jq '.assets[0].name' -r
    )"
if [ ! -e "${YUZUBINDIR}"/"${latest_yuzu}" ]; then
    wget "$(wget -qO- 'https://api.github.com/repos/pineappleEA/pineapple-src/releases/latest' |jq '.assets[0].browser_download_url' -r)" -O "${YUZUBINDIR}"/"${latest_yuzu}" &&
    chmod +x "${YUZUBINDIR}"/"${latest_yuzu}"
elif [ ! -x "${YUZUBINDIR}"/"${latest_yuzu}" ]; then
    chmod +x "${YUZUBINDIR}"/"${latest_yuzu}"
fi

builtin readarray -t yuzu_versions <<<"$(find "${YUZUBINDIR}" -iname "Linux-Yuzu-EA-????.AppImage" -print0 |xargs -0 -I{} basename {} |cut -d'.' -f1 | cut -d'-' -f3-)"

selected_version="$(dialog --ok-label "Launch" --no-cancel --no-tags --backtitle 'Yuzu PinEApple - https://github.com/pineappleEA/pineapple-src' --title 'Yuzu Version' --menu 'Choose which Yuzu version you want to use:' 0 30 0 $(for ((x = "${#yuzu_versions[@]}" - 1; x >= 0; --x)); do builtin echo "$x ${yuzu_versions[x]}"; done | tr '\n' ' ') --output-fd 1)"

if {
    find "${YUZUBINDIR}" -iname "Linux-Yuzu-EA-????.AppImage" |grep -q "${yuzu_versions[$selected_version]}";} then { 
        builtin declare -x MANGOHUD=${mango} &&
        exec ${gamemode} "${YUZUBINDIR}"/Linux-Yuzu-"${yuzu_versions[$selected_version]}".AppImage "${@}";
    } else {
        builtin echo "Selected version does not exist!" &&
        builtin exit 1
    }
fi

image

Cheers 🤙🤙🤙

In case it is useful to anyone else that likes to keep multiple versions, this is the script I use. It automatically checks (and pulls, if newer) the latest version each launch, then provides a dialog allowing the user to choose an installed version. The requested version is then launched (optionally) with MangoHUD and gamemode: ```bash #!/usr/bin/env bash ### set to directory where yuzuEA AppImages are stored YUZUBINDIR="${HOME}/Downloads" ### set to 1 to enable mangohud, 0 to disable mango=1 ### set to 'gamemoderun' to enable gamemode, set to blank to disable gamemode="gamemoderun" for x in jq dialog wget xargs cut; do [ "$(builtin command -v ${x})" ] || { builtin echo "This script requires ${x}, which does not seem to be installed. \ Re-run this script once ${x} is installed." && builtin exit 1; } done latest_yuzu="$( wget -qO- 'https://api.github.com/repos/pineappleEA/pineapple-src/releases/latest' | jq '.assets[0].name' -r )" if [ ! -e "${YUZUBINDIR}"/"${latest_yuzu}" ]; then wget "$(wget -qO- 'https://api.github.com/repos/pineappleEA/pineapple-src/releases/latest' |jq '.assets[0].browser_download_url' -r)" -O "${YUZUBINDIR}"/"${latest_yuzu}" && chmod +x "${YUZUBINDIR}"/"${latest_yuzu}" elif [ ! -x "${YUZUBINDIR}"/"${latest_yuzu}" ]; then chmod +x "${YUZUBINDIR}"/"${latest_yuzu}" fi builtin readarray -t yuzu_versions <<<"$(find "${YUZUBINDIR}" -iname "Linux-Yuzu-EA-????.AppImage" -print0 |xargs -0 -I{} basename {} |cut -d'.' -f1 | cut -d'-' -f3-)" selected_version="$(dialog --ok-label "Launch" --no-cancel --no-tags --backtitle 'Yuzu PinEApple - https://github.com/pineappleEA/pineapple-src' --title 'Yuzu Version' --menu 'Choose which Yuzu version you want to use:' 0 30 0 $(for ((x = "${#yuzu_versions[@]}" - 1; x >= 0; --x)); do builtin echo "$x ${yuzu_versions[x]}"; done | tr '\n' ' ') --output-fd 1)" if { find "${YUZUBINDIR}" -iname "Linux-Yuzu-EA-????.AppImage" |grep -q "${yuzu_versions[$selected_version]}";} then { builtin declare -x MANGOHUD=${mango} && exec ${gamemode} "${YUZUBINDIR}"/Linux-Yuzu-"${yuzu_versions[$selected_version]}".AppImage "${@}"; } else { builtin echo "Selected version does not exist!" && builtin exit 1 } fi ``` ![image](https://github.com/pineappleEA/pineapple-src/assets/121763855/43ba476e-fd8f-485c-b7f6-2406e5199207) Cheers 🤙🤙🤙
solipsist01 commented 2023-12-17 12:46:03 +01:00 (Migrated from github.com)
url=$(curl -s 'https://pineappleea.github.io/' | grep -o 'https://github.com/pineappleEA/pineapple-src/releases/tag/EA-[0-9]*' | head -1) && \
        appimage_url=$(echo $url | sed -E 's|https://github.com/(.*)/releases/tag/EA-(.*)|https://github.com/\1/releases/download/EA-\2/Linux-Yuzu-EA-\2.AppImage|') && \
        wget $appimage_url -O yuzu-emu.AppImage

if you're using a deck
create updateyuzu.sh on your desktop and paste this.

url=$(curl -s 'https://pineappleea.github.io/' | grep -o 'https://github.com/pineappleEA/pineapple-src/releases/tag/EA-[0-9]*' | head -1) && \
        appimage_url=$(echo $url | sed -E 's|https://github.com/(.*)/releases/tag/EA-(.*)|https://github.com/\1/releases/download/EA-\2/Linux-Yuzu-EA-\2.AppImage|') && \
        wget $appimage_url -O /home/deck/Applications/yuzu-ea.AppImage
``` url=$(curl -s 'https://pineappleea.github.io/' | grep -o 'https://github.com/pineappleEA/pineapple-src/releases/tag/EA-[0-9]*' | head -1) && \ appimage_url=$(echo $url | sed -E 's|https://github.com/(.*)/releases/tag/EA-(.*)|https://github.com/\1/releases/download/EA-\2/Linux-Yuzu-EA-\2.AppImage|') && \ wget $appimage_url -O yuzu-emu.AppImage ``` if you're using a deck create updateyuzu.sh on your desktop and paste this. ``` url=$(curl -s 'https://pineappleea.github.io/' | grep -o 'https://github.com/pineappleEA/pineapple-src/releases/tag/EA-[0-9]*' | head -1) && \ appimage_url=$(echo $url | sed -E 's|https://github.com/(.*)/releases/tag/EA-(.*)|https://github.com/\1/releases/download/EA-\2/Linux-Yuzu-EA-\2.AppImage|') && \ wget $appimage_url -O /home/deck/Applications/yuzu-ea.AppImage ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: N-archive/pineapple-src#132
No description provided.