File indexing completed on 2024-11-10 04:05:17

0001 #!/usr/bin/env bash
0002 #
0003 #  SPDX-License-Identifier: GPL-3.0-or-later
0004 #
0005 
0006 set -x
0007 set -e
0008 
0009 APPIMAGE_PATH="${1}"
0010 CHANNEL="${2}"
0011 VERSION="${3}"
0012 
0013 if [ -z $APPIMAGE_PATH ]; then
0014   echo "path to appimage (arg1) is not set"
0015   exit 1
0016 fi
0017 
0018 if [ -z $CHANNEL ]; then
0019   echo "channel (arg2) is not set"
0020   exit 1
0021 fi
0022 
0023 if [ -z $VERSION ]; then
0024   echo "version (arg3) is not set"
0025   exit 1
0026 fi
0027 
0028 # regenerate zsync file
0029 if [ "$CHANNEL" = "Next" ]; then
0030         URL="${BUILD_URL}/artifact/"
0031 elif [ "$CHANNEL" = "Plus" ]; then
0032         URL="${BUILD_URL}/artifact/"
0033 elif [ "$CHANNEL" = "Stable" ]; then
0034         URL="https://download.kde.org/stable/krita/${VERSION}"
0035 elif [ "$CHANNEL" = "Beta" ]; then
0036         URL="https://download.kde.org/unstable/krita/${VERSION}"
0037 fi
0038 
0039 zsyncmake -u "${URL}/$(basename ${APPIMAGE_PATH})" -o $APPIMAGE_PATH.zsync.new $APPIMAGE_PATH
0040 ret=$?
0041 if [ $ret -eq 0 ]; then
0042   mv $APPIMAGE_PATH.zsync.new Krita-${CHANNEL}-x86_64.appimage.zsync
0043 fi
0044