Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > Gentoo Linux Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-21-2008, 12:20 PM
Grant
 
Posts: n/a
Default xman problem

I've emerged xman.
The program dialogue box runs ok but the man page output is full of garbage


This is a small part of the dump after prog terminated :
eqn:/usr/share/man/man1/man.1.bz2:23: invalid input character code `0'
eqn:/usr/share/man/man1/man.1.bz2:23: invalid input character code `151'
eqn:/usr/share/man/man1/man.1.bz2:23: invalid input character code `135'
eqn:/usr/share/man/man1/man.1.bz2:23: invalid input character code `140'
eqn:/usr/share/man/man1/man.1.bz2:23: invalid input character code `146'
eqn:/usr/share/man/man1/man.1.bz2:23: invalid input character code `11'
eqn:/usr/share/man/man1/man.1.bz2:23: invalid input character code `24'


I tried :-

USE="debug xprint" emerge xman
but that didn't help either


Any ideas ?

thanks

GC


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-21-2008, 12:20 PM
Aragorn
 
Posts: n/a
Default Re: xman problem

Grant wrote:

> I've emerged xman.
> The program dialogue box runs ok but the man page output is full of
> garbage
>
>
> This is a small part of the dump after prog terminated :
> eqn:/usr/share/man/man1/man.1.bz2:23: invalid input character code `0'
> eqn:/usr/share/man/man1/man.1.bz2:23: invalid input character code `151'
> eqn:/usr/share/man/man1/man.1.bz2:23: invalid input character code `135'
> eqn:/usr/share/man/man1/man.1.bz2:23: invalid input character code `140'
> eqn:/usr/share/man/man1/man.1.bz2:23: invalid input character code `146'
> eqn:/usr/share/man/man1/man.1.bz2:23: invalid input character code `11'
> eqn:/usr/share/man/man1/man.1.bz2:23: invalid input character code `24'
>
>
> I tried :-
>
> USE="debug xprint" emerge xman
> but that didn't help either
>
>
> Any ideas ?


Just a wild guess, but are your character encoding settings correct? As I
understand it - and I could be wrong, of course - the developers tend to
favor UTF-8 for /man/ pages, and if you've set up your X11 environment for
something else, then you would indeed get to see all kinds of garbage on
your screen when viewing a /man/ page.

Just my two cents worth, but then again they are Eurocents and according to
the current dollar course they'd be worth more than dollarcents...

--
Aragorn
(registered GNU/Linux user #223157)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-21-2008, 12:20 PM
Arthur Hagen
 
Posts: n/a
Default Re: xman problem

Grant <virus@clear.net.nz> wrote:
> I've emerged xman.
> The program dialogue box runs ok but the man page output is full of
> garbage
>
> This is a small part of the dump after prog terminated :
> eqn:/usr/share/man/man1/man.1.bz2:23: invalid input character code `0'


The .bz2 extension tells it all. bzip2 is not a universal compression
format, and whoever in Gentoo thought it was a good idea to compress man
pages with it should have his danglies compressed with bzip2.
In your case, xman doesn't understand the bzip2 format, which it shouldn't
be expected to understand either, cause it's non-standard.

The traditional way to pack man files in Unix is with "pack"[1], which has
the advantage that even though it doesn't pack all that well, unpacking
takes extremely little CPU, and is generally faster than a cat of the same
file. That's why the files were compressed in the first place -- to save
/time/, not to save disk space. And why bzip is such a horrible choice; on
a slow or CPU-pegged system, it takes longer to uncompress a .bzip file than
to read a much bigger file from disk, and while doing this, you'll use 100%
CPU on a core, slowing down the entire system.

As a better alternative to bzip2, there's three real alternatives:

1: Use gzip instead. This used to be the default for Gentoo, until some
ignorant asshat changed it. The downside to using gzip is if man pages are
shared with a non-Linux system where gzip hasn't been installed, then man
pages won't work on that system.
To use gzip, add the following two lines to /etc/make.conf:
PORTAGE_COMPRESS="gzip"
PORTAGE_COMPRESS_FLAGS="-8" # Or -7. Using -9 is silly, it just eats CPU
Then edit /etc/man.conf, and change the following two lines:
COMPRESS /bin/gzip
COMPRESS_EXT .gz

2: Use compress instead. This is present on /all/ Unix like systems I can
think of, except Gentoo, unless it has been installed specifically. (Again,
some strange choices by the newer devs.) The advantage is that if you share
some man pages over NFS to other systems, they won't have a problem.
To use compress, "emerge ncompress", then add the following two lines to
/etc/make.conf:
PORTAGE_COMPRESS="compress"
PORTAGE_COMPRESS_FLAGS=" " # Due to a bug in some versions of portage
Then edit /etc/man.conf, and change the following two lines:
COMPRESS /usr/bin/compress
COMPRESS_EXT .Z

3: Keep man pages uncompressed. The saving for compressing man pages is
minimal, because the man pages themselves are so small. Unless enough space
is saved by compressing to reduce the number of disk blocks, there's no
saving at all, just increased CPU usage. As an example, if your file system
has a 4 kB block size, and compressing reduces the size from 7900 to 4200
bytes, you save exactly *zero* disk space. And, remember, the purpose of
compressing in the first place was to save /time/ and CPU use, not space[2].
This is what I'd recommend.
To not use compressed man pages, except for catman pages, add the following
two lines to /etc/make.conf:
PORTAGE_COMPRESS=""
PORTAGE_COMPRESS_FLAGS=" " # Due to a bug in some versions of portage
Then edit /etc/man.conf, and change the following two lines:
COMPRESS /bin/gzip
COMPRESS_EXT .gz

Approach #3 above will also have the side effect that files under
/usr/share/doc will not be compressed, which is nice. It's especially nice
for the doc files that come in html format, with one doc linking another.
(If using compression, you would have to uncompress all the files, and then
recompressing them afterwards, else portage would not find the original
files when updating a package, possibly leaving you with both compressed and
uncompressed files in the same directory.)

After doing one of the above, you have to re-emerge any packages that puts
files in /usr/share/man or /usr/share/doc. Easiest is to "emerge -e world"
before going to bed.

And then go to http://bugs.gentoo.org/show_bug.cgi?id=169260 and voice your
opinion.

[1]: "pack" compressed files have a .z (lower case) extension, not to be
confused with the .Z (upper case) extension which "compress" uses.
Unfortunately, "pack" isn't even available for Gentoo!
[2]: That's why "catman" saves a compressed version of the formatted man
page when you read it for the first time, and then does a zcat on that
instead of reformatting every time you re-read a man page. You burn disk
space that way, but save CPU time.

Regards,
--
*Art

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-21-2008, 12:20 PM
m.s.w
 
Posts: n/a
Default [OT]:but still about man pages

I just wonder what is responsible for the way man pages are displayed in
terminal? I mean, reading man pages by typing "man command" displays
text using "less" but some man pages are displayed in much better way.
They have colored keywords, options etc. Some doesn't. Is it possible to
make all man pages looks in the "nice" way without rewriting man pages
(for example by setting some man options)?

m.s.w
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-21-2008, 12:20 PM
Arthur Hagen
 
Posts: n/a
Default Re: [OT]:but still about man pages

m.s.w <m.s.w@interia.pl> wrote:
> I just wonder what is responsible for the way man pages are displayed
> in terminal? I mean, reading man pages by typing "man command"
> displays text using "less" but some man pages are displayed in much
> better way. They have colored keywords, options etc. Some doesn't. Is
> it possible to make all man pages looks in the "nice" way without
> rewriting man pages (for example by setting some man options)?


Man pages are in a special format, with formatting codes. If the formatting
codes haven't been used by the person creating the man pages, you can't
easily get them (short of rewriting the man pages and adding the codes).
When a man page is displayed, it's piped through several formatting apps
that understand the various codes, including eqn/neqn/tbl (formats tables)
and roff/nroff/groff (justification, colour, bold etc.), and then finally
piped to a viewer like more/less/cat.
You can change how a man page is displayed (by standard, it's formatted for
a 80 column line printer with US letter size paper!) by changing the -m
option to nroff/troff/groff -- for Gentoo, this is set in /etc/man.conf, and
by default, groff is used, using formatting instructions found in
/usr/share/groff/[version]/tmac/
The default convention is to call "nroff -man" (or for Gentoo,
"groff -mandoc"), which will cause a file named "an.mac" (or for Gentoo,
"andoc.tmac") to be used for formatting.

To play around with the formatting, try these (assuming you keep your man
pages in gzip format -- use bzcat instead of "gzip -dc" if they are in .bz2
format):

# Standard output:
gzip -dc /usr/share/man/man1/man.1.gz | neqn -Tlatin1 |
nroff -Tlatin1 -mandoc

# Standard output without bold/colours:
gzip -dc /usr/share/man/man1/man.1.gz | nroff -Tlatin1 -c -man

# Postscript output for A4 paper:
emerge app-text/gv
gzip -dc /usr/share/man/man1/man.1.gz | groff -Tps -e -ma4 | gv -

# HTML page:
gzip -dc /usr/share/man/man1/man.1.gz | groff -Thtml -e -mwww

Regards,
--
*Art

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-21-2008, 12:20 PM
m.s.w
 
Posts: n/a
Default Re: [OT]:but still about man pages

Arthur Hagen pisze:
//...//

That's a detailed answer. Thank you.

m.s.w
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:53 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145