unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 55535ffa119c02045429f356aa747ce0d9af12d8 1027 bytes (raw)
name: gnu/packages/patches/kio-search-smbd-on-PATH.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Adopted from NixOS
pkgs/development/libraries/kde-frameworks/kio/samba-search-path.patch

===================================================================
--- kio-5.17.0.orig/src/core/ksambashare.cpp
+++ kio-5.17.0/src/core/ksambashare.cpp
@@ -67,13 +67,18 @@ KSambaSharePrivate::~KSambaSharePrivate(
 
 bool KSambaSharePrivate::isSambaInstalled()
 {
-    if (QFile::exists(QStringLiteral("/usr/sbin/smbd"))
-            || QFile::exists(QStringLiteral("/usr/local/sbin/smbd"))) {
-        return true;
+    const QByteArray pathEnv = qgetenv("PATH");
+    if (!pathEnv.isEmpty()) {
+        QLatin1Char pathSep(':');
+        QStringList paths = QFile::decodeName(pathEnv).split(pathSep, QString::SkipEmptyParts);
+        for (QStringList::iterator it = paths.begin(); it != paths.end(); ++it) {
+            it->append(QStringLiteral("/smbd"));
+            if (QFile::exists(*it)) {
+                return true;
+            }
+        }
     }
 
-    //qDebug() << "Samba is not installed!";
-
     return false;
 }
 

debug log:

solving 55535ffa11 ...
found 55535ffa11 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).