Opened 4 years ago

Last modified 4 years ago

#3975 new defect

g.manual -m gives ERROR: No manual page entry

Reported by: jidanni Owned by: grass-dev@…
Priority: normal Milestone: 7.8.3
Component: Docs Version: git-releasebranch78
Keywords: Debian Cc:
CPU: Unspecified Platform: Unspecified

Description

man xyz works. g.manual xyz works. g.manual -m xyz says ERROR: No manual page entry for xyz. At least here on Debian sid.

GRASS 7.8.1 (newLocation):~ > g.manual -m g.manual
ERROR: No manual page entry for 'g.manual'
GRASS 7.8.1 (newLocation):~ > g.manual -m d.vect
ERROR: No manual page entry for 'd.vect'
GRASS 7.8.1 (newLocation):~ > g.manual -i
GRASS 7.8.1 (newLocation):~ > g.manual -i -m
ERROR: No manual page entry for 'index'
GRASS 7.8.1 (newLocation):~ > g.manual -t -m
ERROR: No manual page entry for 'topics'
GRASS 7.8.1 (newLocation):~ > g.manual g.manual
GRASS 7.8.1 (newLocation):~ > 

Change History (7)

comment:1 by neteler, 4 years ago

Keywords: Debian added
Milestone: 7.8.2
Version: unspecifiedgit-releasebranch78

Works nicely on Fedora:

g.manual -m g.manual

g.manual(1)                                               Grass User's Manual                                               g.manual(1)

NAME
       g.manual  - Displays the manual pages of GRASS modules.

KEYWORDS
       general, manual, help
...

The manual pages are expected to be under

/usr/lib64/grass78/docs/man/man1/x.yyy.1

see path in https://github.com/OSGeo/grass/blob/master/scripts/g.manual/g.manual.py#L101

Perhaps stores the MAN pages elsewhere?

comment:2 by Bas Couwenberg, 4 years ago

Manpages have the 'grass' suffix appended to the section to prevent conflicts, see:

https://salsa.debian.org/debian-gis-team/grass/blob/debian/7.8.1-1/debian/rules#L150

in reply to:  2 comment:3 by neteler, 4 years ago

Replying to Bas Couwenberg:

Manpages have the 'grass' suffix appended to the section to prevent conflicts, see:

https://salsa.debian.org/debian-gis-team/grass/blob/debian/7.8.1-1/debian/rules#L150

I see a "grass7.1" in the line https://salsa.debian.org/debian-gis-team/grass/blob/debian/7.8.1-1/debian/rules#L151

maybe that's the problem?

comment:4 by Bas Couwenberg, 4 years ago

maybe that's the problem?

No, that just renames grass7.1 to grass78.1.

The manual pages are expected to be under /usr/lib64/grass78/docs/man/man1/x.yyy.1

Which is not the case on Debian:

$ apt-file search man1/g.manual.1
grass-doc: /usr/share/man/man1/g.manual.1grass.gz

So g.manual.py needs to be patched to test the .1grass section suffix instead of just .1, this is more in line with what man(1) does, as it has no issue to find manpages with .1foo suffixes:

$ man -w g.manual
/usr/share/man/man1/g.manual.1grass.gz

comment:5 by Bas Couwenberg, 4 years ago

Something like this may be a good solution:

--- a/g.manual   2019-11-18 20:06:17.402073322 +0100
+++ b/g.manual   2019-11-18 20:16:03.794093319 +0100
@@ -46,6 +46,7 @@
 #% required : yes
 #%end
 
+import subprocess
 import sys
 import os
 
@@ -98,6 +99,19 @@
 
 
 def start_man(entry):
+    try:
+        cmd = ['man', '-w', '1', entry]
+
+        process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+        (stdout, stderr) = process.communicate()
+
+        paths = stdout.decode().split('\n')
+
+        if os.path.exists(paths[0]):
+            os.execlp('man', 'man', paths[0])
+    except Exception:
+        pass
+
     path = os.path.join(gisbase, 'docs', 'man', 'man1', entry + '.1')
     if not os.path.exists(path) and os.getenv('GRASS_ADDON_BASE'):
         path = os.path.join(os.getenv('GRASS_ADDON_BASE'), 'docs', 'man', 'man1', entry + '.1')

comment:6 by neteler, 4 years ago

Milestone: 7.8.2

Ticket retargeted after milestone closed

comment:7 by neteler, 4 years ago

Milestone: 7.8.3
Note: See TracTickets for help on using tickets.