[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#564915: more research



Hi Holger,

On Fri, Feb 12, 2010 at 03:39:58PM +0100, Holger Levsen wrote:
> I've tried it now and noticed the following issue with the rosegarden manual:
> 
> rosegarden-manual.xml:1328: parser error : Opening and ending tag mismatch: 
> article line 1 and para
> </section></para>
>                  ^
> rosegarden-manual.xml:1329: parser error : Extra content at the end of the 
> document
> <para>Swami have a nice GUI and looks like this: 
> ^

I have fixed this, new patch attached (apply to svn).

> (And the change to get_images was on purpose as well? :)

One change to get_images removes the following warning:
    "Unrecognized escape \w passed through at ../scripts/get_images line 49"

The other change prints the system error when not finding the file. (I
used that to find the cause when testing on Squeeze and the download
failed, it is not necessary but does not hurt.)   

Here's a little recipe to test:

Check if repo is up to date (if the wiki changed (much): make get-orig-source), 
     .../debian-edu-doc$ make status (for reference)
Apply patch:
     .../debian-edu-doc$ patch -p0< patch 
Now prepare po-files to get low fuzzy number:
     .../debian-edu-doc$ find . -name "*.po" | xargs sed -i "s/[ \t]*<\//<\//g"
Get the new source:
     .../debian-edu-doc$ make get-orig-source
Check fuzzies with: 
     .../debian-edu-doc$ make status

My results:

unpatched:

debian-edu-etch-manual.de.po: 655 translated messages, 119 fuzzy
translations, 136 untranslated messages.
debian-edu-etch-manual.es.po: 85 translated messages, 200 fuzzy
translations, 625 untranslated messages.
debian-edu-etch-manual.fr.po: 645 translated messages, 141 fuzzy
translations, 124 untranslated messages.
debian-edu-etch-manual.it.po: 896 translated messages, 5 fuzzy
translations, 9 untranslated messages.
debian-edu-etch-manual.nb.po: 723 translated messages, 139 fuzzy
translations, 48 untranslated messages.

debian-edu-lenny-manual.de.po: 1080 translated messages, 31 fuzzy
translations.
debian-edu-lenny-manual.es.po: 235 translated messages, 215 fuzzy
translations, 661 untranslated messages.
debian-edu-lenny-manual.fr.po: 420 translated messages, 320 fuzzy
translations, 371 untranslated messages.
debian-edu-lenny-manual.it.po: 1111 translated messages.
debian-edu-lenny-manual.nb.po: 902 translated messages, 209 fuzzy
translations.
debian-edu-lenny-manual.zh.po: 63 translated messages, 52 fuzzy
translations, 996 untranslated messages.

rosegarden-manual.fr.po: 103 translated messages, 79 fuzzy
translations, 426 untranslated messages.
rosegarden-manual.nb.po: 604 translated messages, 4 fuzzy
translations.

==========================================================
patched:

debian-edu-etch-manual.de.po: 652 translated messages, 122 fuzzy
translations, 136 untranslated messages.
debian-edu-etch-manual.es.po: 85 translated messages, 200 fuzzy
translations, 625 untranslated messages.
debian-edu-etch-manual.fr.po: 641 translated messages, 145 fuzzy
translations, 124 untranslated messages.
debian-edu-etch-manual.it.po: 892 translated messages, 9 fuzzy
translations, 9 untranslated messages.
debian-edu-etch-manual.nb.po: 719 translated messages, 143 fuzzy
translations, 48 untranslated messages.

debian-edu-lenny-manual.de.po: 1071 translated messages, 40 fuzzy
translations.
debian-edu-lenny-manual.es.po: 233 translated messages, 219 fuzzy
translations, 659 untranslated messages.
debian-edu-lenny-manual.fr.po: 418 translated messages, 322 fuzzy
translations, 371 untranslated messages.
debian-edu-lenny-manual.it.po: 1100 translated messages, 11 fuzzy
translations.
debian-edu-lenny-manual.nb.po: 898 translated messages, 213 fuzzy
translations.
debian-edu-lenny-manual.zh.po: 63 translated messages, 52 fuzzy
translations, 996 untranslated messages.

rosegarden-manual.fr.po: 103 translated messages, 79 fuzzy
translations, 426 untranslated messages.
rosegarden-manual.nb.po: 591 translated messages, 17 fuzzy translations.

I could not find any changes when comparing the html-manual patched
and unpatched. (It's difficult to see real changes, because space and
linebreaks are slightly different and spoil the diff). The next days I
plan to check the pdfs. 

Cheers

	Andi
Index: documentation/scripts/get_images
===================================================================
--- documentation/scripts/get_images	(revision 62760)
+++ documentation/scripts/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&amp;do=get&amp;target=([^']+)'/>#" ) {
+	if ( $local =~ "m#<imagedata fileref='/".$path."/\\w+\?action=AttachFile&amp;do=get&amp;target=([^']+)'/>#" ) {
 		# ..and replace the paths
 		$local =~ s#<imagedata fileref='([^'"<>]+)'/>#create($1)#eg;
 		open(FILE, "> $file") or die "Can't open $file for writing";
Index: documentation/scripts/get_manual
===================================================================
--- documentation/scripts/get_manual	(revision 62760)
+++ documentation/scripts/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,13 @@
 	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<\/section>%g" |
 	sed "s%<para>%\n<para>%g" |
+	sed "s%<\/para>%\n<\/para>%g" |
+	sed "s%<\/date%\n<\/date%g" |
 	sed "s%</date>\(.*\)\$%%g" |
 	sed "s%FIXME%\nFIXME%g" |
 	sed '1,4d' > $TARGET
@@ -79,9 +82,10 @@
 # (replace with the second match of the regular expression)
 sed -i "s/\(.*\)\/\(.*\)/\2/" id
 
-# add id= to <section>s
+# add id= to <section>s and a linebreak at the end
 for i in `cat id` ; do
 	sed -i "0,/<section>/ s/<section>/<section id=\"$i\">/" ${i}.xml 
+	sed -i "$ s#>#>\n#" ${i}.xml
 done
 
 # paste it together
@@ -102,10 +106,11 @@
 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
+# remove the first empty line
+sed -i "1d" $xmlfile
+
 # clean it further
 TMPFILE2=$(mktemp)
 xmllint $xmlfile > $TMPFILE2

Reply to: