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

Bug#172702: www.debian.org: update_excuses.html is generated with sloppy code



Gabriele 'LightKnight' Stilli said:
> As of today, update-excuses.html is displayed "strikeout" from a certain
> point onwards when using Galeon (1.2.5). With Opera it's shown cleanly, but
> the code is not pretty anyway.
> 
> The problem comes at this point:
> 
> <ul>
> <li>Maintainer: Stephan Kaufhold <s.kaufhold@1stbna.com>
> <li>Too young, only 7 of 10 days old
> <li>Not considered
> <li>Depends: libpam-pwgen <a href="#glibc">glibc</a>
> </ul>
> 
> when meeting the "<s", galeon interprets it as a "strikeout" tag and shows
> the rest of the text "struck".
> 
> While this may well be a bug in Galeon, that way of showing the developers'
> addresses is not quite nice. It should be better if the "<>" signs were
> replaced by their HTML codes "&lt; &gt;" or, at your choice, by something
> like
> 
> <li>Maintainer: <a href="mailto:s.kaufhold@1stbna.com";>Stephan Kaufhold</a>
> 
> I'm sorry if there are some reasons unknown to me (or technical issues) for
> this syntax: just let me know if it's the case :-) I'm not asking for a
> total HTML-compliant file: just something cleaner :-)

That's absolutely right; however the updates-excuses.html page is
generated by a script running on ftp-master.debian.org and is
(confusingly) not actually under the control of the Debian WWW team.

Interpreting "<s.kaufhold@1stbna.com>" as "<s>" is a bug in galeon.
Anything that looks like an HTML entity (<foo>) but doesn't appear in
the HTML renderer's list of entities should be ignored.  Hence in most
browsers, the Maintainer field looks like:

  Maintainer: Stephan Kaufhold

rather than:

  Maintainer: Stephan Kaufhold <s.kaufhold@1stbna.com>

Try viewing the page in 'links', as it doesn't suffer the strikeout
problem of galeon.

I submitted a patch a while ago (June 2002) to ajt, which addressed some
of the issues with the script that generates the update-excuses.html,
but I don't think he's used it.  I've attached it here as maybe someone
else has write access to /cvs/dak and can apply it ... (please?)

The main problem is that the script doesn't generate the Maintainer
lines itself, but gets them from the package descriptions.  All that is
really needed is for the strings self.maint and t[0] to be given the
Python equivalent of Perl's "$_ =~ s/</&lt;/g; $_ =~ s/>/&gt;/g;" or a
routine like encode_entities from HTML::Entities.  I don't know any
Python at all so didn't know how to do this; if someone else does,
please submit the fix to ajt or straight to dak CVS and close this bug.

Thanks,

Andrew.

-- 
Andrew Shugg <andrew@neep.com.au>                   http://www.neep.com.au/

"Just remember, Mr Fawlty, there's always someone worse off than yourself."
"Is there?  Well I'd like to meet him.  I could do with a good laugh."
Index: update_out.py
===================================================================
RCS file: /cvs/dak/testing/testing/update_out.py,v
retrieving revision 1.24
diff -u -r1.24 update_out.py
--- update_out.py	2002/04/10 06:51:13	1.24
+++ update_out.py	2002/06/25 03:00:39
@@ -241,6 +241,8 @@
 		res = "<a id=\"%s\" name=\"%s\">%s</a> (%s to %s)\n<ul>\n" % \
 			(self.name, self.name, self.name, self.ver[0], self.ver[1])
 		if self.maint:
+			# Python equivalent of Perl's HTML entity cleaner needed here
+			# (the string self.maint will contain "<" and ">" characters)
 			res = res + "<li>Maintainer: " + self.maint + "\n"
 		if self.daysold != None:
 			if self.daysold < self.mindays:
@@ -374,6 +376,8 @@
 				if s not in l: l.append(s)
 			if src in l: continue
 			if l == []:
+				# Python equivalent of Perl's HTML entity cleaner needed here
+				# (the string t[0] may contain ">" and/or "<" characters)
 				exc.addhtml("%s/%s unsatisfiable %s: %s" % (pkg, arch, d, t[0]))
 			for s in l: exc.add_dep(s)
 
@@ -453,9 +457,9 @@
 			oodtxt = ""
 			for v in oodbins.keys():
 				if oodtxt: oodtxt = oodtxt + "; "
-				oodtxt = oodtxt + "%s (from <a href=\"http://buildd.debian.org/build.php?arch=%s&pkg=%s&ver=%s\"; target=\"_blank\">%s</a>)" % \
+				oodtxt = oodtxt + "%s (from <a href=\"http://buildd.debian.org/build.php?arch=%s&amp;pkg=%s&amp;ver=%s\"; target=\"_blank\">%s</a>)" % \
 					(string.join(oodbins[v], ", "), arch, src, v, v)
-			text = "out of date on <a href=\"http://buildd.debian.org/build.php?arch=%s&pkg=%s&ver=%s\"; target=\"_blank\">%s</a>: %s" % (arch, src, srcv, arch, oodtxt)
+			text = "out of date on <a href=\"http://buildd.debian.org/build.php?arch=%s&amp;pkg=%s&amp;ver=%s\"; target=\"_blank\">%s</a>: %s" % (arch, src, srcv, arch, oodtxt)
 
 			if arch in fuckedarches:
 				text = text + " (but %s isn't keeping up," % \
@@ -475,12 +479,12 @@
 		if not unstablebugs.has_key(pkg): unstablebugs[pkg] = 0
 
 		if unstablebugs[pkg] > testingbugs[pkg]:
-			exc.addhtml("%s (%s) is <a href=\"http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&data=%s&sev-inc=critical&sev-inc=grave&sev-inc=serious\"; target=\"_blank\">buggy</a>! (%d > %d)" % \
+			exc.addhtml("%s (%s) is <a href=\"http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&amp;data=%s&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious\"; target=\"_blank\">buggy</a>! (%d &gt; %d)" % \
 				(pkg, string.join(pkgs[pkg], ", "), pkg,
 				unstablebugs[pkg], testingbugs[pkg]))
 			updatecand = 0
 		elif unstablebugs[pkg] > 0:
-			exc.addhtml("%s (%s) is (less) <a href=\"http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&data=%s&sev-inc=critical&sev-inc=grave&sev-inc=serious\"; target=\"_blank\">buggy</a>! (%d <= %d)" % \
+			exc.addhtml("%s (%s) is (less) <a href=\"http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&amp;data=%s&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious\"; target=\"_blank\">buggy</a>! (%d &lt;= %d)" % \
 				(pkg, string.join(pkgs[pkg], ", "), pkg,
 				unstablebugs[pkg], testingbugs[pkg]))
 
@@ -893,13 +897,17 @@
 
 f = open("update.EXCUSES_py", 'w')
 
+f.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\";>"\n)
 f.write("<html><head><title>excuses...</title></head><body>\n")
-f.write("<p>Generated: " + time.strftime("%Y.%m.%d %H:%M:%S %z", time.gmtime(time.time())) + "\n")
+f.write("<p>Generated: " + time.strftime("%Y.%m.%d %H:%M:%S %z", time.gmtime(time.time())) + "</p>\n")
+f.write("<p><small>[<a href=\"http://ftp-master.debian.org/testing/\";>Back to Testing page</a>]</small></p>\n")
+f.write("<h1>Testing pool excuses</h1>\n")
 f.write("<ul>\n")
 
 for exc in excuses:
 	f.write("<li>%s" % exc.html())
 f.write("</ul>\n")
+f.write("</body></html>\n")
 
 f.close()
 

Reply to: