0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-05-09 23:55:29 +00:00
Files
termux-packages/packages/fish/share-tools-create_manpage_completions.py.patch
2025-04-21 16:40:42 +02:00

25 lines
1.3 KiB
Diff

diff --git a/share/tools/create_manpage_completions.py b/share/tools/create_manpage_completions.py
index 1fc26a846..5c3d078e3 100755
--- a/share/tools/create_manpage_completions.py
+++ b/share/tools/create_manpage_completions.py
@@ -1019,7 +1019,7 @@ def get_paths_from_man_locations():
# Fallback: With mandoc (OpenBSD, embedded Linux) and NetBSD man, the only way to get the default manpath is by reading /etc.
if not parent_paths:
try:
- with open("/etc/man.conf", "r") as file:
+ with open("@TERMUX_PREFIX@/etc/man.conf", "r") as file:
data = file.read()
for key in ["MANPATH", "_default"]:
for match in re.findall(r"^%s\s+(.*)$" % key, data, re.I | re.M):
@@ -1027,8 +1027,9 @@ def get_paths_from_man_locations():
except FileNotFoundError:
pass
# Fallback: hard-code some common paths. These should be likely for FHS Linux distros, BSDs, and macOS.
+ # We need to patch this to work properly on Termux.
if not parent_paths:
- parent_paths = ["/usr/share/man", "/usr/local/man", "/usr/local/share/man"]
+ parent_paths = ["@TERMUX_PREFIX@/share/man"]
print(
"Unable to get the manpath, falling back to %s." % ":".join(parent_paths),
"Explictly set $MANPATH to fix this error.",