On Tue, May 29, 2007 at 01:04:42PM -0400, Isaac Dupree wrote:
> 
> Malcolm Wallace wrote:
> > 
> > That would be /home/simonmar/bin/commit-messages-split.sh, which does this:
> > 
> >     patchname=$(${DARCS} changes            \
> >             --matches="hash ${patch}"       \
> >             --xml-output                    \
> >             | grep '<name>'                 \
> >             | sed 's|.*<name>\(.*\)</name>.*|\1|')
> > 
> > Note the flag '--xml-output', but unfortunately it is needed for the
> > following 'grep' to work.  Ideally, we need to find a different way of
> > identifying the patchname string from the output of darcs.

Thanks for tracking it down!

> How about removing --xml-output and:
>      | grep '^  \* ' | head -n 1 | sed 's|  \* ||'
> (`head` just in case the detailed text has a line starting with "* ")
> 
> Or get the second line (is there a better shell way?) :
>      | head -n 2 | tail -n 1 | sed 's|  \* ||'

We have several Haskell XML libraries, so we ought to be able to do it
properly and write a program that takes something like

<changelog>
<patch author='Simon Marlow &lt;[EMAIL PROTECTED]&gt;' date='20070529074224' 
local_date='Tue May 29 08:42:24 BST 2007' inverted='False' 
hash='20070529074224-760e2-15f67f8b5b45e82238177fff068c6b788e7aff02.gz'>
        <name>don&apos;t build the threaded RTS when 
GhcUnregisterised=YES</name>
</patch>
</changelog>

and prints out the contents of the name element (either printing out the
contents of all of them, or the first one; it doesn't really matter for
this).


Thanks
Ian

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to