[PLUTO-ildp] pagine man X

Hugh Hartmann hhartmann a libero.it
Dom 14 Gen 2007 16:22:17 CET


Ciao Sandro,
e un saluto "festoso" si estende a tutti i partecipanti alla lista .. :-)

On Sun, Jan 14, 2007 at 11:25:06AM +0100, sacarde wrote: 
> il formato testo che ottengo e':
> 
> - con spazi multipli
> - indentato con spazi
> 
> 
> come mi comporto?

Allora, forse non mi sono spiegato sufficientemente bene o non ho capito
il problema, urge allora qualche chiarimento o riassunto della "puntata
precedente" ... :-))

Qundo si decide di tradurre una man page, prendendo il file relativo
nelle dir /usr/man/man1/.... man8/, si deve fare attenzione non solo ai
codici "punto" (delle lettere maiuscole seguite da un punto) ma "BISOGNA"
rispettare gli "a capo" presenti nel testo originale altrimenti groff (il
gestore delle man page) crea dei problemi.

Riporto una parte di man page a titolo di esempio:

[..]  

.TH alien 1L "Debian Utilities" "DEBIAN" \" -*- nroff -*-
.SH NAME
alien \- Convert or install an alien binary package
.SH SYNOPSIS
\fBalien\fP [\fB--to-deb\fP] [\fB--patch=file\fP] [\fBoptions\fP] \fBfile\fP [\fB...\fP]
.br
\fBalien\fP --to-rpm [\fBoptions\fP] \fBfile\fP [\fB...\fP]
.br
\fBalien\fP --to-tgz [\fBoptions\fP] \fBfile\fP [\fB...\fP]
.br
\fBalien\fP --to-slp [\fBoptions\fP] \fBfile\fP [\fB...\fP]
.SH DESCRIPTION
To build Debian packages, 
.I alien
is simply called with a parameter giving the 
name of the alien package to be converted. A look up will then be done in
.B /var/lib/alien/packagename*.diff.gz
and then in
.B /usr/lib/alien/patches/packagename*.diff.gz .
If such a diff exists then the alien package is unpacked and the patch is
applied to debianize the package. If there is no such diff then 
.I alien 
will attempt to automatically debianize the package. After this, alien will 
build the debian binary package, and it will be saved to the current 
directory.
.PP
To build Red Hat packages, alien must be called with the --to-rpm parameter,
and the name of the alien package to be converted. 
.I Alien 
will then generate a spec file, and call rpm to build the package.
.PP
This tool probably needs to be run as superuser. Make sure that there is
enough room in the current directory since
.I alien
will build the package in that location.
.SH ALIEN PACKAGE FORMATS
.I Alien 
can input and output packages in the Red Hat .rpm format, the Debian .deb 
format, the Stampede .slp format, the Slackware .tgz format and the
generic .tar.gz format. 
.PP
For converting from and to .rpm format the Red Hat Package Manager must be 
installed (See
.B rpm (8)
).
[...]

Come potrai notare ci sono i caratteri "punto" e anche altri caratteri
preceduti da uno \ (praticamente le macro che groff usa per generare la
man page): .TH, .SH, \fB, \fP, .br, .B, .I, .PP, ecc. 
Naturalmente non sono casuali ma hanno un preciso significato, come si
puo' notare dalla man groff_man, ne cito alcuni:

.TP = titolo di una sezione
.SH = intestazione non identata
.SS = intestazione identata
.TP = paragrafo identato
.LP = interruzione di linea alla posizione corrente
.PP = idem come .LP
.P  = idem come .LP
.B  = il testo che segue viene evidenziato in grassetto (bold face)
.I  = il testo che segue viene rappresentato in italico

Bene questi caratteri NON devono essere minimamente alterati e, per quanto
possibile devono rimanere esattamente nello stesso posto. Poi se osservi
la formattazione del testo noterai che spesso una riga e' composta da una
sola parola, seguita da un "a capo", bene, devi tradurre ma non alterare 
la formattazione del testo.

Poi, se man page e' stata alterata nei ritorni a capo o in altri
caratteri punto quando fai la trasformazione i testo  con il comando:

$ man nome_comando | col -bfx > nome_comando.txt <invio>

e' chiaro che il risultato non sara' bello da vedersi .... :-) 

Se usi il midnight commander (mc) basta cliccare sopra il file della man
page o evidenziarlo e premere invio per poterlo vedere come una man page,
senza doverlo copiare nelle dir /usr/man/man1/ ... /man8/ e lanciare
mandb per fare l'aggiornamento (ogni volta che si aggiunge o toglie un
file delle man page, e' necessario aggiornare il suo database con il
comando mandb, altrimenti non si puo' vedere la man page in italiano (che
dovrebbero essere sotto /usr/man/it/man1/ ... /man8/. E' importante anche
che ci sia il giusto percorso (MANPATH), dare un'occhiata il file:
/etc/manpath.config ....

Spero di essere stato piu' chiaro ... :-)


Au Revoir
Hugh Hartmann


-- 
 ... Linux, Windows Xp ed MS-DOS 
     (anche conosciuti come il Bello, il Brutto ed il Cattivo).   
     -- Matt Welsh

 



Maggiori informazioni sulla lista pluto-ildp