Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 123140 - sys-apps/man-1.6b-r2 doesn't display man3x pages
Summary: sys-apps/man-1.6b-r2 doesn't display man3x pages
Status: RESOLVED DUPLICATE of bug 123328
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-16 23:54 UTC by Philip Kovacs
Modified: 2006-02-18 20:47 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Kovacs 2006-02-16 23:54:55 UTC
There are a great many 3x man pages (*.3x.gz), from many different packages, in /usr/share/man/man3.  This version of man doesn't display them, instead yielding the error (for example):

$ man XWindowChanges
fopen: No such file or directory
Cannot open man page /usr/share/man/man3x/XConfigureWindow.3x.gz
fopen: No such file or directory
Cannot open man page /usr/X11R6/man/man3x/XConfigureWindow.3x.gz
fopen: No such file or directory
Cannot open man page /usr/man/man3x/XConfigureWindow.3x.gz
No manual entry for XWindowChanges

The workaround seems to be simply to create a symlink for section 3x:

cd /usr/share/man
ln -s man3 man3x

There may be other similar situations in other man directories.
Comment 1 Philip Kovacs 2006-02-17 09:22:19 UTC
Here's my emerge --info.   My upgrade to Modular X was the motivation for using this version of man (as per gentoo mod X instructions).

Portage 2.1_pre4-r1 (default-linux/x86/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14-gentoo-r5 i686)
=================================================================
System uname: 2.6.14-gentoo-r5 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz
Gentoo Base System version 1.6.14
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -O2 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo ftp://gentoo.mirrors.pair.com http://gentoo.ccccom.com"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="x86 X aalib alsa avi cdr cups divx4linux dvd dvdr encode fbcon gif gpm gtk gtk2 jpeg mad mikmod mmx mpeg ncurses nls nptl ogg opengl oss perl png python readline sdl slang spell sse ssl tcpd truetype unicode vorbis xml2 xv xvid zlib elibc_glibc input_devices_keyboard input_devices_mouse kernel_linux userland_GNU video_cards_nv"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LDFLAGS, LINGUAS
Comment 2 SpanKY gentoo-dev 2006-02-17 21:41:25 UTC
works fine for me with man-1.6c
Comment 3 Philip Kovacs 2006-02-18 12:14:55 UTC
i upgraded to man-1.6c and i am still seeing the problem.  I looked more closely at some of the Xorg 7.0 man files themselves and they are the problem.  It's related to those .3x.gz files which contain merely references to the main file containing the page.  Example:

/usr/share/man/man3/XConfigureWindow.3x.gz

this file contains a man page and man XConfigureWindow displays it properly.   
However, 

/usr/share/man/man3/XMoveWindow.3x.gx is contains exactly his data:

.so man3x/XConfigureWindow.3x

i.e. it references the XConfigureWindow page which is what should be displayed as that page contains the info on XMoveWindow and other functions.

But man expects to find that file under man3x as the reference indicates and it fails as follows:

fopen: No such file or directory
Cannot open man page /usr/share/man/man3x/XConfigureWindow.3x.gz
No manual entry for XMoveWindow

At this point I am not sure where this bug belongs -- on libX11 or man? 

$ equery belongs /usr/share/man/man3/XConfigureWindow.3x.gz
[ Searching for file(s) /usr/share/man/man3/XConfigureWindow.3x.gz in *... ]
x11-libs/libX11-1.0.0-r1 (/usr/share/man/man3/XConfigureWindow.3x.gz)

Comment 4 SpanKY gentoo-dev 2006-02-18 12:26:01 UTC
thanks for looking deeper ... this is a bug in the X packages

if man3/XConfigureWindow.3x is the real manpage, then man3/XMoveWindow.3x should be pointing to man3/XConfigureWindow.3x or man3/XConfigureWindow.3x should really be installed in man3x/ instead of man3/

to sum it up ... the current (incorrect) situation:
man3/XConfigureWindow.3x: real manpage
man3/XMoveWindow.3x: incorrectly points to man3x/XConfigureWindow.3x

possible fix 1:
man3/XConfigureWindow.3x: real manpage
man3/XMoveWindow.3x: points to man3/XConfigureWindow.3x

possible fix 2:
man3x/XConfigureWindow.3x: real manpage
man3x/XMoveWindow.3x: points to man3x/XConfigureWindow.3x
Comment 5 Philip Kovacs 2006-02-18 12:29:38 UTC
exactly correct Spanky.  do you need me to do anything more?
Comment 6 Philip Kovacs 2006-02-18 14:34:31 UTC
I wrote this hack to fix them:

----fix_libX11_manpages.sh----

#!/bin/bash

# Philip Kovacs
#
# Find X11 man pages <100 bytes which we can reasonably assume
# contain links to other man pages.  Open the file, inspect if
# the man page reference is valid and, if not, correct it.
#

MANHOME=/usr/share/man
find $MANHOME -type f -name X\*.gz -size -100c | while read file;
do
   REF="`cat $file | gunzip - | head -n 1 | sed -e 's/\.so \(.*\)/\1/g'`"
   if [ ! -f $MANHOME/$A ]; then
       BASENAME="`basename $file`"
       echo $BASENAME has invalid reference to: $REF
       echo -n "    trying to fix ... "
       CORRECTED_REF="`echo $REF | sed -e 's/^man3x/man3/g'`"
       if [ -f $MANHOME/${CORRECTED_REF}.gz ]; then
          FILE_3X="`echo $BASENAME | sed -e 's/\(.*\)*\.gz/\1/g'`"
          echo ".so $CORRECTED_REF" > /tmp/${FILE_3X}
          rm /tmp/${FILE_3X}.gz
          gzip /tmp/${FILE_3X}

          ###  UNCOMMENT TO REALLY INSTALL
          ###
          ###  mv $file ${file}.old
          ###  install -o root -g root -m 644 /tmp/${FILE_3X}.gz ${MANHOME}/man3
          ###

          echo fixed
       else
          echo NOT FIXED
       fi
   fi
done
Comment 7 Philip Kovacs 2006-02-18 14:55:46 UTC
if anyone uses it i recommend this step first:

cd /usr/share/man
tar -xvf man3 man3-BACKUP.tar
gzip man3-BACKUP.tar

run the fix_libX11_manpages.sh script, then

then remove the *.old files or the pages wont display properly:

cd /usr/share/man
rm man3/*.old
Comment 8 Philip Kovacs 2006-02-18 17:43:52 UTC
I filed a simple patch to libX11-1.0.0-r1.ebuild. moving the libX11 man pages and their associated shadwo pages to section 3.  See bug 123328 .
Comment 9 Joshua Baergen (RETIRED) gentoo-dev 2006-02-18 20:47:47 UTC
You could have just continued to follow the bug here instead of creating a new one.

Thanks for figuring this one out btw.

*** This bug has been marked as a duplicate of 123328 ***