| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
# Script to update digiKam Windows installers. |
| 4 |
# |
| 5 |
# SPDX-FileCopyrightText: 2013-2026 by Gilles Caulier <caulier dot gilles at gmail dot com> |
| 6 |
# |
| 7 |
# SPDX-License-Identifier: BSD-3-Clause |
| 8 |
# |
| 9 |
|
| 10 |
######################################################################## |
| 11 |
# Function to upload bundle log files |
| 12 |
BundleUploadLogFiles() |
| 13 |
{ |
| 14 |
|
| 15 |
if [[ $DK_UPLOAD = 1 ]] ; then |
| 16 |
|
| 17 |
echo -e "---------- Cleanup older bundle logs from files.kde.org repository \n" |
| 18 |
|
| 19 |
sftp -q $DK_UPLOADURL:$DK_UPLOADDIR/build.logs/win64-Qt$DK_QTVERSION <<< "rm build-digikam.full.log.gz" |
| 20 |
sftp -q $DK_UPLOADURL:$DK_UPLOADDIR/build.logs/win64-Qt$DK_QTVERSION <<< "rm build-installer.full.log.gz" |
| 21 |
|
| 22 |
echo -e "---------- Compress bundle log files \n" |
| 23 |
|
| 24 |
gzip -k $ORIG_WD/logs/build-digikam.full.log $ORIG_WD/logs/build-digikam.full.log.gz || true |
| 25 |
gzip -k $ORIG_WD/logs/build-installer.full.log $ORIG_WD/logs/build-installer.full.log.gz || true |
| 26 |
|
| 27 |
echo -e "---------- Upload new bundle logs to files.kde.org repository \n" |
| 28 |
|
| 29 |
UploadWithRetry $ORIG_WD/logs/build-digikam.full.log.gz $DK_UPLOADURL $DK_UPLOADDIR/build.logs/win64-Qt$DK_QTVERSION 10 |
| 30 |
UploadWithRetry $ORIG_WD/logs/build-installer.full.log.gz $DK_UPLOADURL $DK_UPLOADDIR/build.logs/win64-Qt$DK_QTVERSION 10 |
| 31 |
|
| 32 |
echo -e "---------- Cleanup local bundle log file archives \n" |
| 33 |
|
| 34 |
rm -f $ORIG_WD/logs/build-digikam.full.log.gz || true |
| 35 |
rm -f $ORIG_WD/logs/build-installer.full.log.gz || true |
| 36 |
|
| 37 |
fi |
| 38 |
|
| 39 |
} |
| 40 |
|
| 41 |
######################################################################## |
| 42 |
|
| 43 |
. ./config.sh |
| 44 |
. ./common.sh |
| 45 |
|
| 46 |
# Halt and catch errors. Upload log files if necessary at script error or exit. |
| 47 |
set -eE |
| 48 |
trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG |
| 49 |
trap 'echo "FAILED COMMAND: $PREVIOUS_COMMAND"' ERR |
| 50 |
trap BundleUploadLogFiles ERR exit |
| 51 |
|
| 52 |
StartScript |
| 53 |
|
| 54 |
ORIG_WD="`pwd`" |
| 55 |
|
| 56 |
echo "++++++++++++++++ Build 64 bits Installer ++++++++++++++++++++++++++++++++++" |
| 57 |
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" |
| 58 |
|
| 59 |
./03-build-digikam.sh |
| 60 |
|
| 61 |
sed -e "s/DK_DEBUG=1/DK_DEBUG=0/g" ./config.sh > ./tmp.sh ; mv -f ./tmp.sh ./config.sh |
| 62 |
|
| 63 |
./04-build-installer.sh |
| 64 |
|
| 65 |
sed -e "s/DK_DEBUG=0/DK_DEBUG=1/g" ./config.sh > ./tmp.sh ; mv -f ./tmp.sh ./config.sh |
| 66 |
|
| 67 |
./04-build-installer.sh |
| 68 |
|
| 69 |
sed -e "s/DK_DEBUG=1/DK_DEBUG=0/g" ./config.sh > ./tmp.sh ; mv -f ./tmp.sh ./config.sh |
| 70 |
|
| 71 |
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" |
| 72 |
|
| 73 |
TerminateScript |