vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| 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) |
| |||
| 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 |
| |||
| 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 |
| |||
| 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 |