File indexing completed on 2024-06-02 04:19:47

0001 #! /bin/bash
0002 
0003 # Script to bundle data using previously-built KDE and digiKam installation
0004 # and create a Windows installer file with NSIS application
0005 # Dependency : NSIS makensis program for Linux.
0006 #
0007 # SPDX-FileCopyrightText: 2015-2024 by Gilles Caulier  <caulier dot gilles at gmail dot com>
0008 #
0009 # SPDX-License-Identifier: BSD-3-Clause
0010 #
0011 
0012 # Halt and catch errors
0013 set -eE
0014 trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG
0015 trap 'echo "FAILED COMMAND: $PREVIOUS_COMMAND"' ERR
0016 
0017 export LANG=C
0018 
0019 #################################################################################################
0020 # Manage script traces to log file
0021 
0022 mkdir -p ./logs
0023 exec > >(tee ./logs/build-installer.full.log) 2>&1
0024 
0025 #################################################################################################
0026 
0027 echo "04-build-installer.sh : build digiKam Windows installer."
0028 echo "--------------------------------------------------------"
0029 
0030 #################################################################################################
0031 # Pre-processing checks
0032 
0033 . ./config.sh
0034 . ./common.sh
0035 StartScript
0036 ChecksCPUCores
0037 RegisterRemoteServers
0038 
0039 #################################################################################################
0040 # Check if NSIS CLI tools is installed
0041 
0042 if ! which ${MXE_BUILDROOT}/usr/bin/x86_64-w64-mingw32.shared-makensis ; then
0043     echo "NSIS CLI tool is not installed"
0044     echo "See https://nsis.sourceforge.io for details."
0045     exit 1
0046 else
0047     echo "Check NSIS CLI tools passed..."
0048 fi
0049 
0050 #################################################################################################
0051 # Configurations
0052 
0053 # Directory where this script is located (default - current directory)
0054 BUILDDIR="$PWD"
0055 
0056 # Directory where bundle files are located
0057 BUNDLEDIR="$BUILDDIR/temp"
0058 
0059 ORIG_WD="`pwd`"
0060 
0061 DK_RELEASEID=`cat $ORIG_WD/data/RELEASEID.txt`
0062 
0063 #################################################################################################
0064 # Build icons-set resource
0065 
0066 echo -e "\n---------- Build icons-set resource\n"
0067 
0068 cd $ORIG_WD/icon-rcc
0069 
0070 rm -f CMakeCache.txt > /dev/null
0071 rm -f Makefile > /dev/null
0072 rm -f cmake_install.cmake > /dev/null
0073 rm -fr CMakeFiles > /dev/null
0074 rm -fr icon-rcc-prefix > /dev/null
0075 rm -f *.rcc > /dev/null
0076 
0077 cmake -DCMAKE_COLOR_MAKEFILE=ON \
0078       -DEXTERNALS_DOWNLOAD_DIR=$DOWNLOAD_DIR \
0079       -DKA_VERSION=$DK_KA_VERSION \
0080       -DKP_VERSION=$DK_KP_VERSION \
0081       -DKDE_VERSION=$DK_KDE_VERSION \
0082       -DENABLE_QTVERSION=$DK_QTVERSION \
0083       -DENABLE_QTWEBENGINE=$DK_QTWEBENGINE \
0084       -Wno-dev \
0085       .
0086 
0087 make -j$CPU_CORES
0088 
0089 mv $BUILDDIR/icon-rcc/icon-rcc-prefix/src/icon-rcc-build/icons/breeze-icons.rcc           $BUILDDIR/icon-rcc/
0090 mv $BUILDDIR/icon-rcc/icon-rcc-prefix/src/icon-rcc-build/icons-dark/breeze-icons-dark.rcc $BUILDDIR/icon-rcc/
0091 
0092 #################################################################################################
0093 # Copy files
0094 
0095 echo -e "\n---------- Copy files in bundle directory\n"
0096 
0097 # Directories creation -----------------------------------------------------------------------
0098 
0099 cd $ORIG_WD
0100 
0101 if [ -d "$BUNDLEDIR" ]; then
0102     rm -fr $BUNDLEDIR
0103     mkdir $BUNDLEDIR
0104 fi
0105 
0106 mkdir -p $BUNDLEDIR/data
0107 mkdir -p $BUNDLEDIR/etc
0108 mkdir -p $BUNDLEDIR/share
0109 mkdir -p $BUNDLEDIR/translations
0110 
0111 # Data files ---------------------------------------------------------------------------------
0112 
0113 echo -e "\n---------- Generics data"
0114 cp -r $MXE_INSTALL_PREFIX/share/lensfun                                 $BUNDLEDIR/data                 2>/dev/null
0115 cp -r $MXE_INSTALL_PREFIX/bin/data/digikam                              $BUNDLEDIR/data                 2>/dev/null
0116 cp -r $MXE_INSTALL_PREFIX/bin/data/showfoto                             $BUNDLEDIR/data                 2>/dev/null
0117 cp -r $MXE_INSTALL_PREFIX/bin/data/solid                                $BUNDLEDIR/data                 2>/dev/null
0118 cp -r $MXE_INSTALL_PREFIX/bin/data/k*                                   $BUNDLEDIR/data                 2>/dev/null
0119 
0120 # Copy digiKam hi-colors PNG icons-set to the bundle
0121 
0122 cp -r $MXE_INSTALL_PREFIX/bin/data/icons                                $BUNDLEDIR/data                 2>/dev/null
0123 rm -fr $BUNDLEDIR/data/icons/breeze*                                                                    2>/dev/null
0124 rm -fr $BUNDLEDIR/data/icons/*.qrc                                                                      2>/dev/null
0125 
0126 echo -e "\n---------- Qt config"
0127 cp    $BUILDDIR/data/qt.conf                                            $BUNDLEDIR/                     2>/dev/null
0128 
0129 echo -e "\n---------- icons-set"
0130 cp    $BUILDDIR/icon-rcc/breeze-icons.rcc                               $BUNDLEDIR/breeze.rcc           2>/dev/null
0131 cp    $BUILDDIR/icon-rcc/breeze-icons-dark.rcc                          $BUNDLEDIR/breeze-dark.rcc      2>/dev/null
0132 
0133 echo -e "\n---------- i18n"
0134 cp -r $MXE_INSTALL_PREFIX/qt5/translations/qt*                          $BUNDLEDIR/translations         2>/dev/null
0135 cp -r $MXE_INSTALL_PREFIX/bin/data/locale                               $BUNDLEDIR/data                 2>/dev/null
0136 
0137 echo -e "\n---------- Xdg"
0138 cp -r $MXE_INSTALL_PREFIX/etc/xdg                                       $BUNDLEDIR/etc                  2>/dev/null
0139 cp -r $MXE_INSTALL_PREFIX/bin/data/xdg                                  $BUNDLEDIR/share                2>/dev/null
0140 
0141 # See bug 471058
0142 echo -e "\n---------- Freedesktop"
0143 mkdir -p $BUNDLEDIR/share/mime/packages/                                                                2>/dev/null
0144 cp -r /usr/share/mime/packages/freedesktop.org.xml                      $BUNDLEDIR/share/mime/packages  2>/dev/null
0145 
0146 echo -e "\n---------- Copy Git Revisions Manifest"
0147 
0148 touch $BUNDLEDIR/MANIFEST.txt
0149 
0150 FILES=$(ls $ORIG_WD/data/*_manifest.txt)
0151 
0152 for FILE in $FILES ; do
0153     echo $FILE
0154     cat $FILE >> $BUNDLEDIR/MANIFEST.txt
0155 done
0156 
0157 # Plugins Shared libraries -------------------------------------------------------------------
0158 
0159 echo -e "\n---------- Qt5 plugins"
0160 cp -r $MXE_INSTALL_PREFIX/qt5/plugins                                   $BUNDLEDIR/                     2>/dev/null
0161 
0162 echo -e "\n---------- digiKam and KF5 plugins"
0163 cp -r $MXE_INSTALL_PREFIX/lib/plugins                                   $BUNDLEDIR/                     2>/dev/null
0164 
0165 echo -e "\n---------- OpenAL for QtAV"
0166 cp -r $MXE_INSTALL_PREFIX/bin/OpenAL32.dll                              $BUNDLEDIR/                     2>/dev/null
0167 
0168 echo -e "\n---------- DrMinGw run-time"
0169 cp -r $MXE_INSTALL_PREFIX/bin/exchndl.dll                               $BUNDLEDIR/                     2>/dev/null
0170 cp -r $MXE_INSTALL_PREFIX/bin/mgwhelp.dll                               $BUNDLEDIR/                     2>/dev/null
0171 cp -r $MXE_INSTALL_PREFIX/bin/dbgcore.dll                               $BUNDLEDIR/                     2>/dev/null
0172 cp -r $MXE_INSTALL_PREFIX/bin/symsrv.dll                                $BUNDLEDIR/                     2>/dev/null
0173 cp -r $MXE_INSTALL_PREFIX/bin/symsrv.yes                                $BUNDLEDIR/                     2>/dev/null
0174 
0175 # Do not include this file from DrMinGW as it require extra devel dll from Microsoft at run-time.
0176 #cp -r $MXE_INSTALL_PREFIX/bin/dbghelp.dll                               $BUNDLEDIR/                    2>/dev/null
0177 
0178 echo -e "\n---------- libgphoto2 drivers"
0179 mkdir $BUNDLEDIR/libgphoto2                                                                             2>/dev/null
0180 mkdir $BUNDLEDIR/libgphoto2_port                                                                        2>/dev/null
0181 cp $MXE_INSTALL_PREFIX/lib/libgphoto2/*/*.dll                           $BUNDLEDIR/libgphoto2           2>/dev/null
0182 cp $MXE_INSTALL_PREFIX/lib/libgphoto2_port/*/*.dll                      $BUNDLEDIR/libgphoto2_port      2>/dev/null
0183 
0184 echo -e "\n---------- Copy executables with recursive dependencies in bundle directory\n"
0185 
0186 # Executables and plugins shared libraries dependencies scan ---------------------------------
0187 
0188 EXE_FILES="\
0189 $MXE_INSTALL_PREFIX/bin/digikam.exe \
0190 $MXE_INSTALL_PREFIX/bin/showfoto.exe \
0191 $MXE_INSTALL_PREFIX/bin/kbuildsycoca5.exe \
0192 $MXE_INSTALL_PREFIX/qt5/bin/QtWebNetworkProcess.exe \
0193 $MXE_INSTALL_PREFIX/qt5/bin/QtWebProcess.exe \
0194 $MXE_INSTALL_PREFIX/qt5/bin/QtWebStorageProcess.exe \
0195 "
0196 for app in $EXE_FILES ; do
0197 
0198     cp $app $BUNDLEDIR/
0199     $ORIG_WD/rll.py --copy --installprefix $MXE_INSTALL_PREFIX --odir $BUNDLEDIR --efile $app
0200 
0201 done
0202 
0203 DLL_FILES="\
0204 `find  $MXE_INSTALL_PREFIX/lib/plugins         -name "*.dll" -type f | sed 's|$MXE_INSTALL_PREFIX/libs/plugins||'`        \
0205 `find  $MXE_INSTALL_PREFIX/qt5/plugins         -name "*.dll" -type f | sed 's|$MXE_INSTALL_PREFIX/qt5/plugins||'`         \
0206 `find  $MXE_INSTALL_PREFIX/plugins             -name "*.dll" -type f | sed 's|$MXE_INSTALL_PREFIX/plugins/||'`            \
0207 `find  $MXE_INSTALL_PREFIX/lib/libgphoto2      -name "*.dll" -type f | sed 's|$MXE_INSTALL_PREFIX/lib/libgphoto2||'`      \
0208 `find  $MXE_INSTALL_PREFIX/lib/libgphoto2_port -name "*.dll" -type f | sed 's|$MXE_INSTALL_PREFIX/lib/libgphoto2_port||'` \
0209 $MXE_INSTALL_PREFIX/bin/OpenAL32.dll \
0210 $MXE_INSTALL_PREFIX/bin/exchndl.dll  \
0211 $MXE_INSTALL_PREFIX/bin/mgwhelp.dll  \
0212 "
0213 
0214 for app in $DLL_FILES ; do
0215 
0216     $ORIG_WD/rll.py --copy --installprefix $MXE_INSTALL_PREFIX --odir $BUNDLEDIR --efile $app
0217 
0218 done
0219 
0220 #################################################################################################
0221 # Cleanup symbols in binary files to free space.
0222 # NOTE: NSIS only support < 2Gb of file to package in the same installer. If size is bigger, a bus error exception is genenrated.
0223 # The following code to do lets all debug symbols in each digiKam components, else size will be largest than 2Gb.
0224 # only the digiKam/Showfoto executable and shared libraries debug symbols are preserved. All digiKam plugins are stripped.
0225 
0226 echo -e "\n---------- Strip symbols in binary files\n"
0227 
0228 if [[ $DK_DEBUG = 1 ]] ; then
0229 
0230     DEBUG_EXE_STRIP_ALL="`find $BUNDLEDIR -name \*exe | grep -Ev '(digikam|showfoto)'`"
0231     echo "DEBUG_EXE_STRIP_ALL=$DEBUG_EXE_STRIP_ALL"
0232     ${MXE_BUILDROOT}/usr/bin/${MXE_BUILD_TARGETS}-strip $DEBUG_EXE_STRIP_ALL
0233 
0234     DEBUG_DLL_STRIP_ALL="`find $BUNDLEDIR -name \*dll | grep -Ev '(digikam|showfoto)'`"
0235     echo "DEBUG_DLL_STRIP_ALL=$DEBUG_DLL_STRIP_ALL"
0236     ${MXE_BUILDROOT}/usr/bin/${MXE_BUILD_TARGETS}-strip $DEBUG_DLL_STRIP_ALL
0237 
0238 #    DEBUG_EXE_STRIP="`find $BUNDLEDIR -name \*exe | grep -E '(digikam|showfoto)'`"
0239 #    echo "DEBUG_EXE_STRIP=$DEBUG_EXE_STRIP"
0240 #    ${MXE_BUILDROOT}/usr/bin/${MXE_BUILD_TARGETS}-strip --only-keep-debug $DEBUG_EXE_STRIP
0241 
0242     DEBUG_DLL_STRIP="`find $BUNDLEDIR -name \*dll | grep -E '(digikam|showfoto)' | grep -Ev '(libdigikam|digikam.dll|showfoto.dll)'`"
0243     echo "DEBUG_DLL_STRIP=$DEBUG_DLL_STRIP"
0244     ${MXE_BUILDROOT}/usr/bin/${MXE_BUILD_TARGETS}-strip $DEBUG_DLL_STRIP
0245 
0246 else
0247 
0248     find $BUNDLEDIR -name \*exe | xargs ${MXE_BUILDROOT}/usr/bin/${MXE_BUILD_TARGETS}-strip --strip-all
0249     find $BUNDLEDIR -name \*dll | xargs ${MXE_BUILDROOT}/usr/bin/${MXE_BUILD_TARGETS}-strip --strip-all
0250 
0251 fi
0252 
0253 #################################################################################################
0254 # Install ExifTool binary.
0255 
0256 cd $DOWNLOAD_DIR
0257 
0258 #if [ ! -f $DOWNLOAD_DIR/exiftool.zip ] ; then
0259     wget https://files.kde.org/digikam/exiftool/exiftool.zip -O exiftool.zip
0260 #fi
0261 
0262 unzip -o $DOWNLOAD_DIR/exiftool.zip -d $BUNDLEDIR
0263 mv "$BUNDLEDIR/exiftool(-k).exe" "$BUNDLEDIR/exiftool.exe"
0264 
0265 #################################################################################################
0266 
0267 if [[ $DK_DEBUG = 1 ]] ; then
0268 
0269     DEBUG_SUF="-debug"
0270 
0271 fi
0272 
0273 if [[ $DK_VERSION != v* ]] ; then
0274 
0275     # with non-official release version, use build time-stamp as sub-version string.
0276     DK_SUBVER="$DK_SUBVER-`cat $ORIG_WD/data/BUILDDATE.txt`"
0277 
0278 else
0279 
0280     # with official release version, disable upload to KDE server, as this break check for new version function.
0281     echo -e "Official release version detected, upload is disabled.\n"
0282     DK_UPLOAD=0
0283 
0284 fi
0285 
0286 #################################################################################################
0287 # Build NSIS installer and Portable archive.
0288 
0289 echo -e "\n---------- Build NSIS installer and Portable archive\n"
0290 
0291 mkdir -p $ORIG_WD/bundle
0292 
0293 if [ $MXE_BUILD_TARGETS == "i686-w64-mingw32.shared" ]; then
0294 
0295     TARGET_INSTALLER=digiKam-$DK_RELEASEID$DK_SUBVER-Win32$DEBUG_SUF.exe
0296     PORTABLE_FILE=digiKam-$DK_RELEASEID$DK_SUBVER-Win32$DEBUG_SUF.tar.xz
0297     CHECKSUM_FILE=digiKam-$DK_RELEASEID$DK_SUBVER-Win32$DEBUG_SUF.sum
0298     rm -f $ORIG_WD/bundle/*Win32$DEBUG_SUF* || true
0299 
0300 else
0301 
0302     TARGET_INSTALLER=digiKam-$DK_RELEASEID$DK_SUBVER-Win64$DEBUG_SUF.exe
0303     PORTABLE_FILE=digiKam-$DK_RELEASEID$DK_SUBVER-Win64$DEBUG_SUF.tar.xz
0304     CHECKSUM_FILE=digiKam-$DK_RELEASEID$DK_SUBVER-Win64$DEBUG_SUF.sum
0305     rm -f $ORIG_WD/bundle/*Win64$DEBUG_SUF* || true
0306 
0307 fi
0308 
0309 cd $ORIG_WD/installer
0310 
0311 ${MXE_BUILDROOT}/usr/bin/x86_64-w64-mingw32.shared-makensis -DVERSION=$DK_RELEASEID -DBUNDLEPATH=$BUNDLEDIR -DTARGETARCH=$MXE_ARCHBITS -DOUTPUT=$ORIG_WD/bundle/$TARGET_INSTALLER ./digikam.nsi
0312 
0313 cd $ORIG_WD
0314 tar cf - `basename $BUNDLEDIR` --transform s/temp/digiKam/ | xz -4e > $ORIG_WD/bundle/$PORTABLE_FILE
0315 
0316 #################################################################################################
0317 # Show resume information and future instructions to host target files on remote server
0318 
0319 echo -e "\n---------- Compute installer checksums for digiKam $DK_RELEASEID\n"          >  $ORIG_WD/bundle/$TARGET_INSTALLER.sum
0320 echo    "File       : $TARGET_INSTALLER"                                                >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum
0321 echo -n "Size       : "                                                                 >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum
0322 du -h "$ORIG_WD/bundle/$TARGET_INSTALLER"        | { read first rest ; echo $first ; }  >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum
0323 echo -n "SHA256 sum : "                                                                 >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum
0324 shasum -a256 "$ORIG_WD/bundle/$TARGET_INSTALLER" | { read first rest ; echo $first ; }  >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum
0325 
0326 # Checksums to post on Phabricator at release time.
0327 shasum -a256 "$ORIG_WD/bundle/$TARGET_INSTALLER" > $ORIG_WD/bundle/$CHECKSUM_FILE
0328 
0329 echo -e "\n---------- Compute Portable archive checksums for digiKam $DK_RELEASEID\n"   >  $ORIG_WD/bundle/$PORTABLE_FILE.sum
0330 echo    "File       : $PORTABLE_FILE"                                                   >> $ORIG_WD/bundle/$PORTABLE_FILE.sum
0331 echo -n "Size       : "                                                                 >> $ORIG_WD/bundle/$PORTABLE_FILE.sum
0332 du -h "$ORIG_WD/bundle/$PORTABLE_FILE"        | { read first rest ; echo $first ; }     >> $ORIG_WD/bundle/$PORTABLE_FILE.sum
0333 echo -n "SHA256 sum : "                                                                 >> $ORIG_WD/bundle/$PORTABLE_FILE.sum
0334 shasum -a256 "$ORIG_WD/bundle/$PORTABLE_FILE" | { read first rest ; echo $first ; }     >> $ORIG_WD/bundle/$PORTABLE_FILE.sum
0335 
0336 # Checksums to post on Phabricator at release time.
0337 shasum -a256 "$ORIG_WD/bundle/$PORTABLE_FILE" >> $ORIG_WD/bundle/$CHECKSUM_FILE
0338 
0339 if [[ $DK_SIGN = 1 ]] ; then
0340 
0341     echo -e "\n---------- Compute Signature checksums for digiKam installer $DK_RELEASEID\n"    >  $ORIG_WD/bundle/$TARGET_INSTALLER.sum
0342 
0343     cat ~/.gnupg/dkorg-gpg-pwd.txt | gpg --batch --yes --passphrase-fd 0 -sabv "$ORIG_WD/bundle/$TARGET_INSTALLER"
0344     mv -f $ORIG_WD/bundle/$TARGET_INSTALLER.asc $ORIG_WD/bundle/$TARGET_INSTALLER.sig
0345 
0346     echo    "File       : $TARGET_INSTALLER.sig"                                                >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum
0347     echo -n "Size       : "                                                                     >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum
0348     du -h "$ORIG_WD/bundle/$TARGET_INSTALLER.sig"        | { read first rest ; echo $first ; }  >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum
0349     echo -n "SHA256 sum : "                                                                     >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum
0350     shasum -a256 "$ORIG_WD/bundle/$TARGET_INSTALLER.sig" | { read first rest ; echo $first ; }  >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum
0351 
0352     # Checksums to post on Phabricator at release time.
0353     shasum -a256 "$ORIG_WD/bundle/$TARGET_INSTALLER.sig" >> $ORIG_WD/bundle/$CHECKSUM_FILE
0354 
0355     echo -e "\n---------- Compute Signature checksums for digiKam Portable $DK_RELEASEID\n"     >  $ORIG_WD/bundle/$PORTABLE_FILE.sum
0356 
0357     cat ~/.gnupg/dkorg-gpg-pwd.txt | gpg --batch --yes --passphrase-fd 0 -sabv "$ORIG_WD/bundle/$PORTABLE_FILE"
0358     mv -f $ORIG_WD/bundle/$PORTABLE_FILE.asc $ORIG_WD/bundle/$PORTABLE_FILE.sig
0359 
0360     echo    "File       : $PORTABLE_FILE.sig"                                                >> $ORIG_WD/bundle/$PORTABLE_FILE.sum
0361     echo -n "Size       : "                                                                  >> $ORIG_WD/bundle/$PORTABLE_FILE.sum
0362     du -h "$ORIG_WD/bundle/$PORTABLE_FILE.sig"        | { read first rest ; echo $first ; }  >> $ORIG_WD/bundle/$PORTABLE_FILE.sum
0363     echo -n "SHA256 sum : "                                                                  >> $ORIG_WD/bundle/$PORTABLE_FILE.sum
0364     shasum -a256 "$ORIG_WD/bundle/$PORTABLE_FILE.sig" | { read first rest ; echo $first ; }  >> $ORIG_WD/bundle/$PORTABLE_FILE.sum
0365 
0366     # Checksums to post on Phabricator at release time.
0367     shasum -a256 "$ORIG_WD/bundle/$PORTABLE_FILE.sig" >> $ORIG_WD/bundle/$CHECKSUM_FILE
0368 
0369 fi
0370 
0371 cat $ORIG_WD/bundle/$TARGET_INSTALLER.sum
0372 cat $ORIG_WD/bundle/$PORTABLE_FILE.sum
0373 
0374 if [[ $DK_UPLOAD = 1 ]] ; then
0375 
0376     echo -e "---------- Cleanup older Windows bundle files from files.kde.org repository \n"
0377 
0378     if [ $MXE_BUILD_TARGETS == "i686-w64-mingw32.shared" ]; then
0379         sftp -q $DK_UPLOADURL:$DK_UPLOADDIR <<< "rm *-Win32$DEBUG_SUF.exe*"
0380         sftp -q $DK_UPLOADURL:$DK_UPLOADDIR <<< "rm *-Win32$DEBUG_SUF.tar.xz*"
0381     else
0382         sftp -q $DK_UPLOADURL:$DK_UPLOADDIR <<< "rm *-Win64$DEBUG_SUF.exe*"
0383         sftp -q $DK_UPLOADURL:$DK_UPLOADDIR <<< "rm *-Win64$DEBUG_SUF.tar.xz*"
0384     fi
0385 
0386     echo -e "---------- Upload new Windows bundle files to files.kde.org repository \n"
0387 
0388     rsync -r -v --progress -e ssh $ORIG_WD/bundle/$TARGET_INSTALLER $DK_UPLOADURL:$DK_UPLOADDIR
0389     rsync -r -v --progress -e ssh $ORIG_WD/bundle/$PORTABLE_FILE $DK_UPLOADURL:$DK_UPLOADDIR
0390 
0391     if [[ $DK_SIGN = 1 ]] ; then
0392         scp $ORIG_WD/bundle/$TARGET_INSTALLER.sig $DK_UPLOADURL:$DK_UPLOADDIR
0393         scp $ORIG_WD/bundle/$PORTABLE_FILE.sig $DK_UPLOADURL:$DK_UPLOADDIR
0394     fi
0395 
0396     # update remote files list
0397 
0398     sftp -q $DK_UPLOADURL:$DK_UPLOADDIR <<< "ls digi*" > $ORIG_WD/bundle/ls.txt
0399     tail -n +2 $ORIG_WD/bundle/ls.txt > $ORIG_WD/bundle/ls.tmp
0400     cat $ORIG_WD/bundle/ls.tmp | grep -E '(.pkg |.appimage |.exe )' | grep -Ev '(debug)' > $ORIG_WD/bundle/FILES
0401     rm $ORIG_WD/bundle/ls.tmp
0402     rm $ORIG_WD/bundle/ls.txt
0403     sftp -q $DK_UPLOADURL:$DK_UPLOADDIR <<< "rm FILES"
0404     rsync -r -v --progress -e ssh $BUILDDIR/bundle/FILES $DK_UPLOADURL:$DK_UPLOADDIR
0405 
0406 else
0407 
0408     echo -e "\n------------------------------------------------------------------"
0409     curl https://download.kde.org/README_UPLOAD
0410     echo -e "------------------------------------------------------------------\n"
0411 
0412 fi
0413 
0414 #################################################################################################
0415 
0416 TerminateScript