summaryrefslogtreecommitdiff
path: root/sysutils/catfish/files/patch-catfish_CatfishSearchEngine.py
blob: cfd4562a1ca846c1b5e5ec54dafe62c383f947ec (plain) (blame)
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
31
32
33
34
35
36
37
--- catfish/CatfishSearchEngine.py.orig	2020-01-15 01:49:54 UTC
+++ catfish/CatfishSearchEngine.py
@@ -24,6 +24,7 @@ import logging
 
 import io
 import os
+import platform
 import re
 import signal
 import subprocess
@@ -649,16 +650,17 @@ class CatfishSearchMethod_Locate(CatfishSearchMethodEx
             "existing": False,
             "regex": False
         }
-        try:
-            details = subprocess.check_output(["locate", "--help"])
-            details = details.decode("utf-8")
-            if "--existing" in details:
-                caps["existing"] = True
-            if "--regex" in details or "--regexp" in details:
-                caps["regex"] = True
+        if platform.system() != 'FreeBSD':
+            try:
+                details = subprocess.check_output(["locate", "--help"])
+                details = details.decode("utf-8")
+                if "--existing" in details:
+                    caps["existing"] = True
+                if "--regex" in details or "--regexp" in details:
+                    caps["regex"] = True
 
-        except subprocess.CalledProcessError:
-            pass
+            except subprocess.CalledProcessError:
+                pass
         return caps
 
     def assemble_query(self, keywords, path):