Bug#564915: patch is broken
On Wed, Feb 10, 2010 at 01:36:36PM +0100, Holger Levsen wrote:
> I've just applied your patch (for testing it) and ran "make get-orig-source"
> and this is the result:
>
> [...]
Hi Holger,
thanks for considering the patch. I worked now a bit further down the
data processing road to the final translated manuals.
The attached patch should produce a debian-edu-lenny-manual.xml file
with the desired features. So far, I have not tried to regenerate the
*.po.* files with as few destruction on the translations.
I encountered one problem/question we have to answer: When is it
planed to switch to Squeeze as development platform? I am not sure if
a switch might cause another need for modifications due to changes in
the p4a-tools (remember: #565524).
The patch already contains fixes and works on squeeze as well as on
lenny (see also #569191).
Cheers,
Andi
--
-------------------------------------
A N D R E A S B. M U N D T
Scheibbser Str. 111
71277 Rutesheim
phone priv.: 0049 (0) 07152 / 54 004
mobile: 0049 (0) 1577 / 29 222 42
VoIP: sip:andi.mundt@ekiga.net
email: andi.mundt@web.de
andreas.b.mundt@web.de
and1bm@web.de
=====================================
Index: get_images
===================================================================
--- get_images (revision 62612)
+++ get_images (working copy)
@@ -41,12 +41,12 @@
}
sub replace () {
- open(FILE, "< $file") or die "Can't open $file perhaps not in the correct dir?";
+ open(FILE, "< $file") or die "Can't open $file perhaps not in the correct dir? Error: $!";
undef $/;
my $local = <FILE>;
close(FILE);
# look for images...
- if ( $local =~ "m#<imagedata fileref='/".$path."/\w+\?action=AttachFile&do=get&target=([^']+)'/>#" ) {
+ if ( $local =~ "m#<imagedata fileref='/".$path."/\\w+\?action=AttachFile&do=get&target=([^']+)'/>#" ) {
# ..and replace the paths
$local =~ s#<imagedata fileref='([^'"<>]+)'/>#create($1)#eg;
open(FILE, "> $file") or die "Can't open $file for writing";
Index: get_manual
===================================================================
--- get_manual (revision 62612)
+++ get_manual (working copy)
@@ -36,7 +36,7 @@
# the last but one sed "preserves" the 2nd matched regex
# the last sed does the same as dos2unix
# head at the end chops of the last two lines with the Category:Permalink entry
-GET "${url}AllInOne?action=raw"|sed "s%<<Include(%%g" | sed "s%)>>%%g" | sed "s%$path1%%g" |sed 's/.$//'|head -n -2> id
+GET -H User-Agent: "${url}AllInOne?action=raw"|sed "s%<<Include(%%g" | sed "s%)>>%%g" | sed "s%$path1%%g" |sed 's/.$//'|head -n -2> id
for i in `cat id` ; do
TARGET=`echo "${i}" |sed "s/\(.*\)\/\(.*\)/\2/" `.xml
@@ -61,10 +61,12 @@
sed "s#</articleinfo>##g" |
sed "s#</revision>##g" |
sed "s%<para><ulink url='http://wiki.debian.org/CategoryPermalink#'>CategoryPermalink</ulink> </para>%%" |
- sed "s%<\/%\n<\/%g" |
sed "s%<title>%\n<title>%g" |
+ sed "s%<\/title>%\n<\/title>%g" |
sed "s%<section>%\n\n<section>%g" |
+ sed "s%<\/section>%\n\n<\/section>%g" |
sed "s%<para>%\n<para>%g" |
+ sed "s%<\/para>%\n<\/para>%g" |
sed "s%</date>\(.*\)\$%%g" |
sed "s%FIXME%\nFIXME%g" |
sed '1,4d' > $TARGET
@@ -102,10 +104,9 @@
perl -0\777 -pi -e "s/<ulink url='$path2(.*)\/(.*)'>(.*)\n<\/ulink>/<link linkend=\"\2\">\3<\/link>/g" $xmlfile
# make it a docbook article again
-sed -i "1,/</ s#<#<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook XML V4.4//EN\" \"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd\"><article><articleinfo><title>$DEBIAN_EDU_DOC_TITLE</title></articleinfo>\n<#" $xmlfile
+sed -i "0,/</ s#<#<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook XML V4.4//EN\" \"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd\"><article><articleinfo><title>$DEBIAN_EDU_DOC_TITLE</title></articleinfo>\n<#" $xmlfile
sed -i "$ s#>#>\n</article>#" $xmlfile
-# remove the first two empty lines
-sed -i "1,2d" $xmlfile
+
# clean it further
TMPFILE2=$(mktemp)
xmllint $xmlfile > $TMPFILE2
Reply to: