ports/sysutils/catfish/files/patch-catfish_CatfishSearchEngine.py
Guido Falsi f9be5b164c - Update catfish to 1.4.13
- Migrate to python3
- Avoid errors due to testing usupported locate command line options
2020-01-15 11:34:57 +00:00

38 lines
1.2 KiB
Python

--- 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):