Re: Output of dpkg-scanpackages as XML
On Wed, Jan 05, 2005 at 04:21:38PM -0500, William Ballard wrote:
> If you want to include the short or long descriptions you'd have to
> wrap those fields in CDATA tags, so you'd need an exta sed
> expression to handle that.
This outputs all fields and splits the short and long descriptions:
echo '<packages><entry>'
zcat /a/dists/latest/binary-i386/Packages.gz | \
grep-dctrl . | sed -r
-e 's/(Description): (.+)/<\1><Short-Description>\2<\/Short-Description><Long-Decription><![CDATA[/' \
-e 's/([^:]+): (.+)/<\1>\2<\/\1>/' \
-e 's/^$/]]><\/Long-Description><\/entry><entry>/' | \
head -n-1
echo '</Long-Description></entry></packages>'
Reply to: