On Sat, Dec 10, 2005 at 02:24:29AM -0500, A. Costa wrote:
> Hi, thanks for the useful critique, for which to simplify things I'd
> prefer to reply to one thing at a time if that's OK; and first up is: 

OK!

> On Wed, 7 Dec 2005 17:40:33 +0000
> Julian Gilbey <[EMAIL PROTECTED]> wrote:
> 
> > - patch against the actual original file rather than something from
> > stdin: the patch file headings such as:
> > 
> > --- -       2005-12-06 02:27:58.437196000 -0500
> > +++ /tmp/annotateoutput.1.gz.19281  2005-12-06
> > 02:27:58.000000000 -0500
> > 
> >   make it impossible to use patch automatically.
> 
> Thanks very very much for pointing that out.  Should be easy to code,
> assuming I correctly understand the format, (I'm working on this
> typo-tool, which is why all the typo bugs are boilerplate).  Would you
> say if the following would be what's needed:
> 
>        --- /usr/share/man/man1/annotate-output.1.gz 16:08:58.000000000 -0500
>        +++ /tmp/annotateoutput.1.gz.19281     2005-12-06
>        02:27:58.000000000 -0500
> 
> ...or if that's wrong, (I'm not a maintainer), suggest what the better
> format should be? 

Almost.  This should be perfect:

>        --- annotate-output.1 16:08:58.000000000 -0500
>        +++ /tmp/annotateoutput.1.19281        2005-12-06
>        02:27:58.000000000 -0500

The first line could have the path in it but not necessarily.  The key
thing, though, is that you are patching the *uncompressed* pages, so
don't have a .gz suffix in the original file name.

> Or consider the source code (shell script) that's making the errant
> diff:
> 
>       zdiff --unified --minimal $MANPAGELONGNAME $EDITABLEMANPAGE > $DIFFNAME
> 
> ...where $MANPAGELONGNAME is the full path and file name of the man
> page, and $EDITABLEMANPAGE and $DIFFNAME are just what they sound like
> and live in '/tmp'.  Perhaps there are better ways or tools; if not,
> once I know the right format I could code something to parse the
> '.diff' after the fact into something better for patching.
> 
> If possible, please advise!

Ah, I see.  If you can either pass the zdiff output through a perl
script or do the following short script, it would be better.  (You may
want to do this much more safely, making a temporary directory first
with mktemp -d depending on your setup.)

cp $MANPAGELONGNAME /tmp
gunzip /tmp/$MANPAGESHORTNAME
diff --unified --minimal /tmp/$MANPAGESHORTNAME $DIFFNAME
rm /tmp/$MANPAGESSHORTNAME

   Julian


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to