summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@mailbox.org>2017-05-18 18:30:35 -0500
committerThomas Tuegel <ttuegel@mailbox.org>2017-06-18 08:44:44 -0500
commitfceb3794a209437d9c557f0e69a80ad97631a18b (patch)
treec6d1f7af55084cfb847043ea7130c7c66b0e7d78 /pkgs/applications
parentbe9a4fe6ca399364e732e14a69075bc3a23047d8 (diff)
downloadnixlib-fceb3794a209437d9c557f0e69a80ad97631a18b.tar
nixlib-fceb3794a209437d9c557f0e69a80ad97631a18b.tar.gz
nixlib-fceb3794a209437d9c557f0e69a80ad97631a18b.tar.bz2
nixlib-fceb3794a209437d9c557f0e69a80ad97631a18b.tar.lz
nixlib-fceb3794a209437d9c557f0e69a80ad97631a18b.tar.xz
nixlib-fceb3794a209437d9c557f0e69a80ad97631a18b.tar.zst
nixlib-fceb3794a209437d9c557f0e69a80ad97631a18b.zip
akonadi: do not store path to pg_ctl in configuration
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/kde/akonadi/akonadi-paths.patch62
1 files changed, 58 insertions, 4 deletions
diff --git a/pkgs/applications/kde/akonadi/akonadi-paths.patch b/pkgs/applications/kde/akonadi/akonadi-paths.patch
index 782b6cede9a1..f1ae1f23cc95 100644
--- a/pkgs/applications/kde/akonadi/akonadi-paths.patch
+++ b/pkgs/applications/kde/akonadi/akonadi-paths.patch
@@ -92,17 +92,71 @@ Index: akonadi-17.04.0/src/server/storage/dbconfigpostgresql.cpp
 ===================================================================
 --- akonadi-17.04.0.orig/src/server/storage/dbconfigpostgresql.cpp
 +++ akonadi-17.04.0/src/server/storage/dbconfigpostgresql.cpp
-@@ -97,8 +97,8 @@ bool DbConfigPostgresql::init(QSettings
-         }
-         postgresSearchPath.append(postgresVersionedSearchPaths);
+@@ -58,7 +58,6 @@ bool DbConfigPostgresql::init(QSettings
+     // determine default settings depending on the driver
+     QString defaultHostName;
+     QString defaultOptions;
+-    QString defaultServerPath;
+     QString defaultInitDbPath;
+     QString defaultPgData;
  
+@@ -70,35 +69,7 @@ bool DbConfigPostgresql::init(QSettings
+ 
+     mInternalServer = settings.value(QStringLiteral("QPSQL/StartServer"), defaultInternalServer).toBool();
+     if (mInternalServer) {
+-        QStringList postgresSearchPath;
+-
+-#ifdef POSTGRES_PATH
+-        const QString dir(QStringLiteral(POSTGRES_PATH));
+-        if (QDir(dir).exists()) {
+-            postgresSearchPath << QStringLiteral(POSTGRES_PATH);
+-        }
+-#endif
+-        postgresSearchPath << QStringLiteral("/usr/sbin")
+-                           << QStringLiteral("/usr/local/sbin");
+-        // Locale all versions in /usr/lib/postgresql (i.e. /usr/lib/postgresql/X.Y) in reversed
+-        // sorted order, so we search from the newest one to the oldest.
+-        QStringList postgresVersionedSearchPaths;
+-        QDir versionedDir(QStringLiteral("/usr/lib/postgresql"));
+-        if (versionedDir.exists()) {
+-            const auto versionedDirs = versionedDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name | QDir::Reversed);
+-            for (const auto &path : versionedDirs) {
+-                // Don't break once PostgreSQL 10 is released, but something more future-proof will be needed
+-                if (path.fileName().startsWith(QLatin1String("10."))) {
+-                    postgresVersionedSearchPaths.prepend(path.absoluteFilePath() + QStringLiteral("/bin"));
+-                } else {
+-                    postgresVersionedSearchPaths.append(path.absoluteFilePath() + QStringLiteral("/bin"));
+-                }
+-            }
+-        }
+-        postgresSearchPath.append(postgresVersionedSearchPaths);
+-
 -        defaultServerPath = XdgBaseDirs::findExecutableFile(QStringLiteral("pg_ctl"), postgresSearchPath);
 -        defaultInitDbPath = XdgBaseDirs::findExecutableFile(QStringLiteral("initdb"), postgresSearchPath);
-+        defaultServerPath = QStringLiteral(NIXPKGS_POSTGRES_PG_CTL);
 +        defaultInitDbPath = QStringLiteral(NIXPKGS_POSTGRES_INITDB);
          defaultHostName = Utils::preferredSocketDirectory(StandardDirs::saveDir("data", QStringLiteral("db_misc")));
          defaultPgData = StandardDirs::saveDir("data", QStringLiteral("db_data"));
      }
+@@ -118,10 +89,7 @@ bool DbConfigPostgresql::init(QSettings
+     mUserName = settings.value(QStringLiteral("User")).toString();
+     mPassword = settings.value(QStringLiteral("Password")).toString();
+     mConnectionOptions = settings.value(QStringLiteral("Options"), defaultOptions).toString();
+-    mServerPath = settings.value(QStringLiteral("ServerPath"), defaultServerPath).toString();
+-    if (mInternalServer && mServerPath.isEmpty()) {
+-        mServerPath = defaultServerPath;
+-    }
++    mServerPath = QStringLiteral(NIXPKGS_POSTGRES_PG_CTL);
+     qCDebug(AKONADISERVER_LOG) << "Found pg_ctl:" << mServerPath;
+     mInitDbPath = settings.value(QStringLiteral("InitDbPath"), defaultInitDbPath).toString();
+     if (mInternalServer && mInitDbPath.isEmpty()) {
+@@ -142,7 +110,6 @@ bool DbConfigPostgresql::init(QSettings
+         settings.setValue(QStringLiteral("Port"), mHostPort);
+     }
+     settings.setValue(QStringLiteral("Options"), mConnectionOptions);
+-    settings.setValue(QStringLiteral("ServerPath"), mServerPath);
+     settings.setValue(QStringLiteral("InitDbPath"), mInitDbPath);
+     settings.setValue(QStringLiteral("StartServer"), mInternalServer);
+     settings.endGroup();
 Index: akonadi-17.04.0/src/akonadicontrol/agentprocessinstance.cpp
 ===================================================================
 --- akonadi-17.04.0.orig/src/akonadicontrol/agentprocessinstance.cpp