termux-packages/packages/fish/create_manpage_completions....

35 lines
1.9 KiB
Diff

diff -u -r ../fish-3.0.0/share/tools/create_manpage_completions.py ./share/tools/create_manpage_completions.py
--- ../fish-3.0.0/share/tools/create_manpage_completions.py 2018-12-28 13:01:03.000000000 +0000
+++ ./share/tools/create_manpage_completions.py 2018-12-28 22:54:12.034220150 +0000
@@ -865,29 +865,7 @@
if os.getenv("MANPATH"):
parent_paths = os.getenv("MANPATH").strip().split(':')
else:
- # Some systems have manpath, others have `man --path` (like Haiku).
- for prog in [['manpath'], ['man', '--path']]:
- try:
- proc = subprocess.Popen(prog, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- except OSError: # Command does not exist, keep trying
- continue
- break # Command exists, use it.
- manpath, err_data = proc.communicate()
- parent_paths = manpath.decode().strip().split(':')
- if (not parent_paths) or (proc and proc.returncode > 0):
- # HACK: Use some fallbacks in case we can't get anything else.
- # `mandoc` does not provide `manpath` or `man --path` and $MANPATH might not be set.
- # The alternative is reading its config file (/etc/man.conf)
- if os.path.isfile('/etc/man.conf'):
- data = open('/etc/man.conf', 'r')
- for line in data:
- if ('manpath' in line or 'MANPATH' in line):
- p = line.split(' ')[1]
- p = p.split()[0]
- parent_paths.append(p)
- if (not parent_paths):
- sys.stderr.write("Unable to get the manpath, falling back to /usr/share/man:/usr/local/share/man. Please set $MANPATH if that is not correct.\n")
- parent_paths = ["/usr/share/man", "/usr/local/share/man"]
+ parent_paths = ["@TERMUX_PREFIX@/share/man"]
result = []
for parent_path in parent_paths:
for section in ['man1', 'man6', 'man8']: