[arch-commits] Commit in digikam/repos (3 files)

Antonio Rojas arojas at gemini.archlinux.org
Sat Dec 25 17:32:11 UTC 2021


    Date: Saturday, December 25, 2021 @ 17:32:11
  Author: arojas
Revision: 433084

archrelease: copy trunk to staging-x86_64

Added:
  digikam/repos/staging-x86_64/
  digikam/repos/staging-x86_64/49ee18fb.patch
    (from rev 433083, digikam/trunk/49ee18fb.patch)
  digikam/repos/staging-x86_64/PKGBUILD
    (from rev 433083, digikam/trunk/PKGBUILD)

----------------+
 49ee18fb.patch |  214 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 PKGBUILD       |   40 ++++++++++
 2 files changed, 254 insertions(+)

Copied: digikam/repos/staging-x86_64/49ee18fb.patch (from rev 433083, digikam/trunk/49ee18fb.patch)
===================================================================
--- staging-x86_64/49ee18fb.patch	                        (rev 0)
+++ staging-x86_64/49ee18fb.patch	2021-12-25 17:32:11 UTC (rev 433084)
@@ -0,0 +1,214 @@
+From 49ee18fbf2220baedbc015f51b74f67930115287 Mon Sep 17 00:00:00 2001
+From: Maik Qualmann <metzpinguin at gmail.com>
+Date: Sun, 25 Jul 2021 15:44:56 +0200
+Subject: [PATCH] perform a database upgrade if the server / database version
+ is different BUGS: 440212 BUGS: 440030 FIXED-IN: 7.4.0
+
+diff --git a/core/libs/database/server/databaseserver.cpp b/core/libs/database/server/databaseserver.cpp
+index 7133148379..cebe9d0f6a 100644
+--- a/core/libs/database/server/databaseserver.cpp
++++ b/core/libs/database/server/databaseserver.cpp
+@@ -73,6 +73,7 @@ public:
+     QString                fileDataDir;
+     QString                actualConfig;
+     QString                globalConfig;
++    QString                dbVersion;
+ };
+ 
+ DatabaseServer::DatabaseServer(const DbEngineParameters& params, DatabaseServerStarter* const parent)
+@@ -224,8 +225,6 @@ bool DatabaseServer::isRunning() const
+ 
+ DatabaseServerError DatabaseServer::startMysqlDatabaseProcess()
+ {
+-    DatabaseServerError result;
+-
+     DatabaseServerError error = checkDatabaseDirs();
+ 
+     if (error.getErrorType() != DatabaseServerError::NoErrors)
+@@ -265,7 +264,14 @@ DatabaseServerError DatabaseServer::startMysqlDatabaseProcess()
+ 
+     databaseServerStateEnum = running;
+ 
+-    return result;
++    error = checkUpgradeMysqlDatabase();
++
++    if (error.getErrorType() != DatabaseServerError::NoErrors)
++    {
++        return error;
++    }
++
++    return error;
+ }
+ 
+ DatabaseServerError DatabaseServer::checkDatabaseDirs() const
+@@ -677,6 +683,25 @@ DatabaseServerError DatabaseServer::initMysqlDatabase() const
+ 
+             db.close();
+         }
++        else
++        {
++            if (query.exec(QLatin1String("SELECT VERSION();")))
++            {
++                if (query.next() && (query.lastError().type() == QSqlError::NoError))
++                {
++
++                    QRegExp reg(QLatin1String("\\d+\\.\\d+\\.\\d+"));
++
++                    if (reg.indexIn(query.value(0).toString()) != -1)
++                    {
++                        d->dbVersion = reg.capturedTexts().first();
++
++                        qCDebug(DIGIKAM_DATABASESERVER_LOG) << "Database version:"
++                                                            << d->dbVersion;
++                    }
++                }
++            }
++        }
+     }
+ 
+     QSqlDatabase::removeDatabase(initCon);
+@@ -684,6 +709,104 @@ DatabaseServerError DatabaseServer::initMysqlDatabase() const
+     return result;
+ }
+ 
++DatabaseServerError DatabaseServer::checkUpgradeMysqlDatabase()
++{
++    DatabaseServerError result;
++
++    // Synthesize the server command line arguments
++
++    QStringList versionCmdArgs;
++    versionCmdArgs << QLatin1String("--version");
++
++    // Start the database server
++
++    QProcess* const versionProcess = new QProcess();
++    versionProcess->setProcessEnvironment(adjustedEnvironmentForAppImage());
++    versionProcess->start(d->mysqldCmd, versionCmdArgs);
++
++    if (!versionProcess->waitForFinished() || (versionProcess->exitCode() != 0))
++    {
++        QString errorMsg = processErrorLog(versionProcess,
++                                           i18n("Could not get mysql server version."));
++
++        delete versionProcess;
++
++        return DatabaseServerError(DatabaseServerError::StartError, errorMsg);
++    }
++
++    QString serverVersion;
++    QRegExp reg(QLatin1String("\\d+\\.\\d+\\.\\d+"));
++
++    if (reg.indexIn(QString::fromUtf8(versionProcess->readAllStandardOutput())) != -1)
++    {
++        serverVersion = reg.capturedTexts().first();
++
++        qCDebug(DIGIKAM_DATABASESERVER_LOG) << "MySQL server version:"
++                                            << serverVersion;
++    }
++
++    delete versionProcess;
++
++    if (serverVersion == d->dbVersion)
++    {
++        return result;
++    }
++
++    // Synthesize the mysql upgrade command line arguments
++
++    QStringList upgradeCmdArgs;
++
++#ifdef Q_OS_WIN
++
++    upgradeCmdArgs << QLatin1String("--port=3307");
++
++#else
++
++    upgradeCmdArgs << QString::fromLatin1("--socket=%1/mysql.socket").arg(d->miscDir);
++
++#endif
++
++    // Start the upgrade ptogram
++
++    QUrl upgradeUrl = QUrl::fromLocalFile(d->mysqlAdminPath).adjusted(QUrl::RemoveFilename);
++    upgradeUrl.setPath(upgradeUrl.path() + QLatin1String("mysql_upgrade"));
++
++    QProcess* const upgradeProcess = new QProcess();
++    upgradeProcess->setProcessEnvironment(adjustedEnvironmentForAppImage());
++    upgradeProcess->start(upgradeUrl.toLocalFile(), upgradeCmdArgs);
++
++    qCDebug(DIGIKAM_DATABASESERVER_LOG) << "Upgrade database:"
++                                        << upgradeProcess->program()
++                                        << upgradeProcess->arguments();
++
++    if (!upgradeProcess->waitForFinished() || (upgradeProcess->exitCode() != 0))
++    {
++        QString errorMsg = processErrorLog(upgradeProcess,
++                                           i18n("Could not upgrade database."));
++
++        delete upgradeProcess;
++
++        return DatabaseServerError(DatabaseServerError::StartError, errorMsg);
++    }
++
++    delete upgradeProcess;
++
++    // Restart the database server.
++
++    stopDatabaseProcess();
++
++    result = startMysqlServer();
++
++    if (result.getErrorType() != DatabaseServerError::NoErrors)
++    {
++        return result;
++    }
++
++    result = initMysqlDatabase();
++
++    return result;
++}
++
+ QString DatabaseServer::getcurrentAccountUserName() const
+ {
+     QString name = QString::fromUtf8(qgetenv("USER"));   // Linux and OSX
+diff --git a/core/libs/database/server/databaseserver.h b/core/libs/database/server/databaseserver.h
+index 0b96d5ceb1..d1140e23ed 100644
+--- a/core/libs/database/server/databaseserver.h
++++ b/core/libs/database/server/databaseserver.h
+@@ -127,6 +127,11 @@ private:
+      */
+     DatabaseServerError initMysqlDatabase()                              const;
+ 
++    /**
++     * Check for a mysql database upgrade.
++     */
++    DatabaseServerError checkUpgradeMysqlDatabase();
++
+     /**
+      * Return the current user account name.
+      */
+diff --git a/core/libs/database/server/databaseserver.cpp b/core/libs/database/server/databaseserver.cpp
+index cebe9d0f6a..37765e3231 100644
+--- a/core/libs/database/server/databaseserver.cpp
++++ b/core/libs/database/server/databaseserver.cpp
+@@ -689,7 +689,6 @@ DatabaseServerError DatabaseServer::initMysqlDatabase() const
+             {
+                 if (query.next() && (query.lastError().type() == QSqlError::NoError))
+                 {
+-
+                     QRegExp reg(QLatin1String("\\d+\\.\\d+\\.\\d+"));
+ 
+                     if (reg.indexIn(query.value(0).toString()) != -1)
+@@ -747,7 +746,9 @@ DatabaseServerError DatabaseServer::checkUpgradeMysqlDatabase()
+ 
+     delete versionProcess;
+ 
+-    if (serverVersion == d->dbVersion)
++    if (d->dbVersion.isEmpty()        ||
++        serverVersion.isEmpty()       ||
++        (serverVersion == d->dbVersion))
+     {
+         return result;
+     }
+

Copied: digikam/repos/staging-x86_64/PKGBUILD (from rev 433083, digikam/trunk/PKGBUILD)
===================================================================
--- staging-x86_64/PKGBUILD	                        (rev 0)
+++ staging-x86_64/PKGBUILD	2021-12-25 17:32:11 UTC (rev 433084)
@@ -0,0 +1,40 @@
+# $Id: PKGBUILD 320127 2018-03-24 09:48:28Z arojas $
+# Maintainer: Ronald van Haren <ronald at archlinux.org>
+# Maintainer: Antonio Rojas <arojas at archlinux.org>
+# Contributor: Andrea Scarpino <andrea at archlinux.org>
+# Contributor: Tobias Powalowski <tpowa at archlinux.org>
+
+pkgname=digikam
+_pkgver=7.4.0
+pkgver=${_pkgver//-/_} # for beta versions
+pkgrel=2
+pkgdesc='An advanced digital photo management application'
+arch=(x86_64)
+license=(GPL)
+url='https://www.digikam.org/'
+depends=(lensfun opencv akonadi-contacts knotifyconfig libksane kfilemetadata qtav marble-common threadweaver kcalendarcore
+         qt5-xmlpatterns imagemagick jasper glu perl-image-exiftool)
+makedepends=(extra-cmake-modules doxygen eigen boost kdoctools)
+optdepends=('hugin: panorama tool' 'qt5-imageformats: support for additional image formats (WEBP, TIFF)'
+            'rawtherapee: RAW import' 'darktable: RAW import'
+            'perl: for digitaglinktree')
+source=(https://download.kde.org/stable/$pkgname/$pkgver/digiKam-$_pkgver.tar.xz{,.sig})
+sha256sums=('d08ab66da732bb449bc10106ec11dd9defa5b3562ded3741b041dbbaa715504a'
+            'SKIP')
+validpgpkeys=(D1CF2444A7858C5F2FB095B74A77747BC2386E50) # digiKam.org (digiKam project) <digikamdeveloper at gmail.com>
+
+build() {
+  cmake -B build -S $pkgname-$_pkgver \
+    -DBUILD_TESTING=OFF \
+    -DENABLE_KFILEMETADATASUPPORT=ON \
+    -DENABLE_MEDIAPLAYER=ON \
+    -DENABLE_AKONADICONTACTSUPPORT=ON \
+    -DENABLE_MYSQLSUPPORT=ON \
+    -DENABLE_APPSTYLES=ON \
+    -DENABLE_QWEBENGINE=ON
+  cmake --build build
+}
+
+package() {
+  DESTDIR="$pkgdir" cmake --install build
+}



More information about the arch-commits mailing list