MANPATH is more portable, e.g. to freebsd. Create self-referential
manN symlinks in Documentation to support the lookups.
Thanks to Greg Troxel for reporting the issue.
Signed-off-by: Rob Browning <
r...@defaultvalue.org>
Tested-by: Rob Browning <
r...@defaultvalue.org>
(cherry picked from commit 42aec47f1b5d54146e1fe35d9b88d1d231cfad4a)
---
Decided to go ahead; pushed to 0.33.x.
Documentation/man1 | 1 +
Documentation/man2 | 1 +
Documentation/man3 | 1 +
Documentation/man4 | 1 +
Documentation/man5 | 1 +
Documentation/man6 | 1 +
Documentation/man7 | 1 +
Documentation/man8 | 1 +
Documentation/man9 | 1 +
lib/bup/cmd/help.py | 12 +++++-------
10 files changed, 14 insertions(+), 7 deletions(-)
create mode 120000 Documentation/man1
create mode 120000 Documentation/man2
create mode 120000 Documentation/man3
create mode 120000 Documentation/man4
create mode 120000 Documentation/man5
create mode 120000 Documentation/man6
create mode 120000 Documentation/man7
create mode 120000 Documentation/man8
create mode 120000 Documentation/man9
diff --git a/Documentation/man1 b/Documentation/man1
new file mode 120000
index 00000000..945c9b46
--- /dev/null
+++ b/Documentation/man1
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/Documentation/man2 b/Documentation/man2
new file mode 120000
index 00000000..945c9b46
--- /dev/null
+++ b/Documentation/man2
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/Documentation/man3 b/Documentation/man3
new file mode 120000
index 00000000..945c9b46
--- /dev/null
+++ b/Documentation/man3
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/Documentation/man4 b/Documentation/man4
new file mode 120000
index 00000000..945c9b46
--- /dev/null
+++ b/Documentation/man4
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/Documentation/man5 b/Documentation/man5
new file mode 120000
index 00000000..945c9b46
--- /dev/null
+++ b/Documentation/man5
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/Documentation/man6 b/Documentation/man6
new file mode 120000
index 00000000..945c9b46
--- /dev/null
+++ b/Documentation/man6
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/Documentation/man7 b/Documentation/man7
new file mode 120000
index 00000000..945c9b46
--- /dev/null
+++ b/Documentation/man7
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/Documentation/man8 b/Documentation/man8
new file mode 120000
index 00000000..945c9b46
--- /dev/null
+++ b/Documentation/man8
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/Documentation/man9 b/Documentation/man9
new file mode 120000
index 00000000..945c9b46
--- /dev/null
+++ b/Documentation/man9
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/lib/bup/cmd/help.py b/lib/bup/cmd/help.py
index 10b3d361..60d46c8c 100644
--- a/lib/bup/cmd/help.py
+++ b/lib/bup/cmd/help.py
@@ -19,14 +19,12 @@ def main(argv):
os.execvp(path.exe(), [path.exe()])
elif len(extra) == 1:
docname = (extra[0]=='bup' and b'bup' or (b'bup-%s' % argv_bytes(extra[0])))
- manpath = os.path.join(path.exedir(),
- b'../../Documentation/' + docname + b'.[1-9]')
- g = glob.glob(manpath)
+ manpath = os.path.join(path.exedir(), b'../../Documentation/')
+ dev_page = glob.glob(os.path.join(manpath, docname + b'.[1-9]'))
try:
- if g:
- os.execvp('man', ['man', '-l', g[0]])
- else:
- os.execvp('man', ['man', docname])
+ if dev_page:
+ os.environb[b'MANPATH'] = manpath
+ os.execvp(b'man', [b'man', docname])
except OSError as e:
sys.stderr.write('Unable to run man command: %s\n' % e)
sys.exit(1)
--
2.47.3