Skip to content

Commit

Permalink
Update krita-devel
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-hc authored Feb 8, 2025
1 parent 79cc0ef commit d57e476
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions programs/x86_64/krita-devel
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ printf '\n%s' "rm -f /usr/local/share/applications/$APP-AM.desktop" >> ../remove
chmod a+x ../remove || exit 1

# DOWNLOAD AND PREPARE THE APP, $version is also used for updates
version=$(echo "https://cdn.kde.org/ci-builds/graphics/krita/master/linux/$(curl -Ls https://cdn.kde.org/ci-builds/graphics/krita/master/linux/ | grep -oP 'href="\Kkrita-.*?-prealpha-.*?-x86_64.appimage(?=")' | sort -V | tail -n 1)")
version="https://cdn.kde.org/ci-builds/graphics/krita/master/linux/$(curl -Ls https://cdn.kde.org/ci-builds/graphics/krita/master/linux/ | tr '">< ' '\n' | grep -i "krita.*pre.*appimage$" | head -1)"
wget "$version" || exit 1
#wget "$version.zsync" 2> /dev/null # Comment out this line if you want to use zsync
# Keep this space in sync with other installation scripts
# Use tar fx ./*tar* here for example in this line in case a compressed file is downloaded.
cd ..
mv ./tmp/*mage ./"$APP"
mv ./tmp/*.zsync ./"$APP".zsync 2>/dev/null
# Keep this space in sync with other installation scripts
rm -R -f ./tmp || exit 1
echo "$version" > ./version
chmod a+x ./"$APP" || exit 1
Expand All @@ -33,16 +33,19 @@ set -u
APP=krita-devel
SITE="https://cdn.kde.org/ci-builds/graphics/krita"
version0=$(cat "/opt/$APP/version")
version=$(echo "https://cdn.kde.org/ci-builds/graphics/krita/master/linux/$(curl -Ls https://cdn.kde.org/ci-builds/graphics/krita/master/linux/ | grep -oP 'href="\Kkrita-.*?-prealpha-.*?-x86_64.appimage(?=")' | sort -V | tail -n 1)")
version="https://cdn.kde.org/ci-builds/graphics/krita/master/linux/$(curl -Ls https://cdn.kde.org/ci-builds/graphics/krita/master/linux/ | tr '">< ' '\n' | grep -i "krita.*pre.*appimage$" | head -1)"
[ -n "$version" ] || { echo "Error getting link"; exit 1; }
if [ "$version" != "$version0" ] || [ -e /opt/"$APP"/*.zsync ]; then
if command -v appimageupdatetool >/dev/null 2>&1; then
cd "/opt/$APP" || exit 1
appimageupdatetool -Or ./"$APP" && chmod a+x ./"$APP" && echo "$version" > ./version && exit 0
fi
if [ "$version" != "$version0" ]; then
mkdir "/opt/$APP/tmp" && cd "/opt/$APP/tmp" || exit 1
[ -e ../*.zsync ] || notify-send "A new version of $APP is available, please wait"
[ -e ../*.zsync ] && wget "$version.zsync" 2>/dev/null || { wget "$version" || exit 1; }
notify-send "A new version of $APP is available, please wait"
wget "$version" || exit 1
# Use tar fx ./*tar* here for example in this line in case a compressed file is downloaded.
cd ..
mv ./tmp/*.zsync ./"$APP".zsync 2>/dev/null || mv --backup=t ./tmp/*mage ./"$APP"
[ -e ./*.zsync ] && { zsync ./"$APP".zsync || notify-send -u critical "zsync failed to update $APP"; }
mv --backup=t ./tmp/*mage ./"$APP"
chmod a+x ./"$APP" || exit 1
echo "$version" > ./version
rm -R -f ./*zs-old ./*.part ./tmp ./*~
Expand Down

0 comments on commit d57e476

Please sign in to comment.