X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/blobdiff_plain/50a1e680a98e90ad8334a57681c9a15bd8a7805e..197daca251715e518bb8367c8e32a7c5fa99f9ea:/packages/fish/create_manpage_completions.py.patch diff --git a/packages/fish/create_manpage_completions.py.patch b/packages/fish/create_manpage_completions.py.patch index b66572b8..f7a8dd27 100644 --- a/packages/fish/create_manpage_completions.py.patch +++ b/packages/fish/create_manpage_completions.py.patch @@ -1,17 +1,27 @@ -diff -u -r ../fish-2.4.0/share/tools/create_manpage_completions.py ./share/tools/create_manpage_completions.py ---- ../fish-2.4.0/share/tools/create_manpage_completions.py 2016-11-07 22:20:54.000000000 -0500 -+++ ./share/tools/create_manpage_completions.py 2016-12-23 15:09:00.703224799 -0500 -@@ -857,12 +857,7 @@ - def get_paths_from_manpath(): - # Return all the paths to man(1) and man(8) files in the manpath - import subprocess, os -- proc = subprocess.Popen(['manpath'], stdout=subprocess.PIPE) -- manpath, err_data = proc.communicate() -- parent_paths = manpath.decode().strip().split(':') -- if not parent_paths: -- sys.stderr.write("Unable to get the manpath (tried manpath)\n") -- sys.exit(-1) -+ parent_paths = ['@TERMUX_PREFIX@/share/man'] +diff -u -r ../fish-2.6.0/share/tools/create_manpage_completions.py ./share/tools/create_manpage_completions.py +--- ../fish-2.6.0/share/tools/create_manpage_completions.py 2017-06-03 14:45:13.000000000 +0200 ++++ ./share/tools/create_manpage_completions.py 2017-06-05 21:27:41.796125049 +0200 +@@ -862,22 +862,7 @@ + if os.getenv("MANPATH"): + parent_paths = os.getenv("MANPATH").strip().split(':') + else: +- # Some systems have manpath, others have `man --path` (like Haiku). +- # TODO: Deal with systems that have neither (OpenBSD) +- 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 fallback in case we can't get anything else. +- # `mandoc` does not provide `manpath` or `man --path` and $MANPATH might not be set, so just use the default for mandoc (minus /usr/X11R6/man, because that's not relevant). +- # The alternative is reading its config file (/etc/man.conf) +- 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']: