--- Begin Message ---
Package: doc-central
Version: 1.8.2
Severity: normal
Tags: patch
Hi,
Attached is diff for NMU I've just uploaded to DELAYED/10-day.
Regards,
robert
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (990, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.24
Locale: LANG=pl_PL, LC_CTYPE=pl_PL (charmap=ISO-8859-2)
Shell: /bin/sh linked to /bin/bash
Versions of packages doc-central depends on:
ii apache2 2.2.8-3 Next generation, scalable, extenda
ii apache2-mpm-prefork [httpd 2.2.8-3 Traditional model for Apache HTTPD
ii boa [httpd-cgi] 0.94.14rc21-3 Lightweight and high performance w
ii doc-base 0.8.14 utilities to manage online documen
ii info2www 1.2.2.9-23 Read info files with a WWW browser
ii python 2.5.2-1 An interactive high-level object-o
Versions of packages doc-central recommends:
ii dillo [www-browser] 0.8.6-2 Small and fast web browser
ii elinks [www-browser] 0.11.3-7 advanced text-mode WWW browser
ii iceape-browser [www- 1.1.9-3 Iceape Navigator (Internet browser
ii iceweasel [www-brows 2.0.0.14-2 lightweight web browser based on M
ii konqueror [www-brows 4:3.5.9.dfsg.1-2+b1 KDE's advanced file manager, web b
ii links [www-browser] 2.1pre33-1 Web browser running in text mode
ii links2 [www-browser] 2.1pre33-1 Web browser running in both graphi
ii lynx-cur [www-browse 2.8.7dev8-1 Text-mode WWW Browser with NLS sup
ii w3m [www-browser] 0.5.1-5.1+b1 WWW browsable pager with excellent
-- no debconf information
diff -Nur doc-central-1.8.2/cgi/browse.cgi doc-central-1.8.2+nmu1/cgi/browse.cgi
--- doc-central-1.8.2/cgi/browse.cgi 2005-01-27 23:11:11.000000000 +0100
+++ doc-central-1.8.2+nmu1/cgi/browse.cgi 2008-04-27 14:27:22.000000000 +0200
@@ -22,7 +22,7 @@
print '''<DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Doc-base section index</title>
</head>
@@ -41,7 +41,7 @@
''' % Section
for doc in docutils.documents:
- if (doc.section == string.lower(Section)):
+ if (doc.section == Section):
print '<tr><td bgcolor="#ffffff">'
print '<table cellpadding=3 cellspacing=0 border=0>'
print '<tr><td bgcolor="#eeeeff" align="right" valign="top"><strong>title:</strong></td><td bgcolor="#ffffff"><a href="%s">%s</a> <br></td></tr>' % (docutils.makedoclink(doc), doc.title)
diff -Nur doc-central-1.8.2/cgi/contents.cgi doc-central-1.8.2+nmu1/cgi/contents.cgi
--- doc-central-1.8.2/cgi/contents.cgi 2005-02-26 03:53:44.000000000 +0100
+++ doc-central-1.8.2+nmu1/cgi/contents.cgi 2008-04-27 14:27:22.000000000 +0200
@@ -23,7 +23,7 @@
print "<UL>"
hdr=1
print '<LI><A HREF="%s">%s</A>' % \
- (docutils.makesectionlink(subsect), string.capitalize(docutils.stripsection(subsect, mydepth)))
+ (docutils.makesectionlink(subsect), docutils.stripsection(subsect, mydepth))
showsection(subsect)
if (hdr==1):
print "</UL>"
@@ -41,7 +41,7 @@
print '''<DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Doc-Base section index</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000cc" vlink="#000066"
diff -Nur doc-central-1.8.2/cgi/docconfig.py doc-central-1.8.2+nmu1/cgi/docconfig.py
--- doc-central-1.8.2/cgi/docconfig.py 2005-01-27 23:11:11.000000000 +0100
+++ doc-central-1.8.2+nmu1/cgi/docconfig.py 2008-04-27 14:27:22.000000000 +0200
@@ -18,24 +18,20 @@
## System defaults
# Location of the doc-base registries.
-docbasedirs = [ "/usr/share/doc-base" ]
+docbasedirs = [ "/var/lib/doc-base/documents" ]
# Descriptions for the various documentation settings. These should probably
# also be in some policy document.
SectionDescr = {
- "apps" : "Documents applications available on your system",
- "apps/graphics" : "Image processing and other graphics programs",
- "apps/math" : "Mathematics software",
- "apps/net" : "Network, mail, news and websoftware ",
- "apps/programming" : "Programming tools",
- "apps/shells" : "Shells",
- "apps/sound" : "Audio software",
- "apps/system" : "System management tools",
- "apps/text" : "Text processing software",
- "apps/tools" : "General utilities",
- "apps/viewers" : "Documentation and graphics viewers",
- "debian" : "Documentation on the Debian distribution and project",
- "devel" : "Information for software developers",
- "help" : "General documentation, FAQs and HOWTOs",
- "text" : "Document and text formats",
+ "Graphics" : "Image processing and other graphics programs",
+ "Science/Mathematics" : "Mathematics software",
+ "Network" : "Network, mail, news and websoftware ",
+ "Programming" : "Programming tools",
+ "Shells" : "Shells",
+ "Sound" : "Audio software",
+ "System" : "System management tools",
+ "Text" : "Text processing software",
+ "Viewers" : "Documentation and graphics viewers",
+ "Debian" : "Documentation on the Debian distribution and project",
+ "Help" : "General documentation, FAQs and HOWTOs"
}
diff -Nur doc-central-1.8.2/cgi/docinfo.py doc-central-1.8.2+nmu1/cgi/docinfo.py
--- doc-central-1.8.2/cgi/docinfo.py 2005-01-27 23:11:11.000000000 +0100
+++ doc-central-1.8.2+nmu1/cgi/docinfo.py 2008-04-27 14:37:52.000000000 +0200
@@ -3,7 +3,7 @@
# about a single document.
# Import all system packages we need
-import sys, os, rfc822, string
+import sys, os, rfc822, string, re
# Import all our own packages
import sectionedfile
@@ -13,6 +13,10 @@
# Default sorting order
SortMethod = [ SORT_TITLE ]
+pat_paragraph = re.compile('^ \.\n', re.MULTILINE)
+pat_verbatim = re.compile('((^ +[^ ].*\n)+)', re.MULTILINE)
+pat_url = re.compile('((http|ftp)s?://[a-zA-Z0-9-]+\.[a-zA-Z0-9-./]+)')
+
class DocumentationInfo:
def __init__(self,docfile=None):
'''DocumentationInfo constructor. If a filename is passed assume
@@ -48,6 +52,23 @@
elif (a>b):
return 1
return 0
+
+ def _html_encode(self, text):
+ '''HTML encodes text '''
+ text=string.replace(text, '&', '&')
+ text=string.replace(text, '<', '<')
+ text=string.replace(text, '>', '>')
+ return text
+
+
+ def _parse_abstract(self, abstract):
+ '''This function converts abstract section'''
+ abstract=self._html_encode(abstract)
+ abstract=re.sub(pat_paragraph, '<P>', abstract)
+ abstract=re.sub(pat_verbatim, '<PRE>\n\g<1></PRE>', abstract)
+ abstract=re.sub(pat_url, '<A HREF="\g<1>">\g<1></A>', abstract)
+ return abstract
+
def parse_info(self,docfile):
'''This function reads a doc-base registry file. We use the
@@ -64,9 +85,9 @@
if part.has_key("Author"):
self.author=part.getheader("Author")
if part.has_key("Abstract"):
- self.abstract=part.getheader("Abstract")
+ self.abstract=self._parse_abstract(part.getrawheader("Abstract"))
if part.has_key("Section"):
- self.section=string.lower(part.getheader("Section"))
+ self.section=part.getheader("Section")
while dd.unblock():
part=rfc822.Message(dd,0)
diff -Nur doc-central-1.8.2/cgi/docutils.py doc-central-1.8.2+nmu1/cgi/docutils.py
--- doc-central-1.8.2/cgi/docutils.py 2005-12-13 02:08:27.000000000 +0100
+++ doc-central-1.8.2+nmu1/cgi/docutils.py 2008-04-27 14:36:12.000000000 +0200
@@ -38,9 +38,6 @@
This means that we make sure that all intermediate sections are also
in the list, and that the list is sorter alphabetically.'''
- for i in range(len(sections)):
- sections[i]=string.capitalize(sections[i])
-
for sect in sections:
lst=string.split(sect,'/')
subsect=lst[0]
diff -Nur doc-central-1.8.2/cgi/search.cgi doc-central-1.8.2+nmu1/cgi/search.cgi
--- doc-central-1.8.2/cgi/search.cgi 2005-01-27 23:11:11.000000000 +0100
+++ doc-central-1.8.2+nmu1/cgi/search.cgi 2008-04-27 14:27:22.000000000 +0200
@@ -34,7 +34,7 @@
print '''<DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Doc-Base section index</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000cc" vlink="#000066"
@@ -59,7 +59,7 @@
links = docutils.makedoclinks(doc)
if links != '':
print '<tr><th bgcolor="#eeeeff" align="right" valign="top"><strong>formats:</strong></th><td bgcolor="#ffffff">%s <br></td></tr>' % links
- print '<tr><th bgcolor="#eeeeff" align="right" valign="top"><strong>section:</strong></th><td bgcolor="#ffffff"><a href="%s">%s</a> <br></td></tr>' % (docutils.makesectionlink(doc.section), string.capitalize(doc.section))
+ print '<tr><th bgcolor="#eeeeff" align="right" valign="top"><strong>section:</strong></th><td bgcolor="#ffffff"><a href="%s">%s</a> <br></td></tr>' % (docutils.makesectionlink(doc.section), doc.section)
print '<tr><th bgcolor="#eeeeff" align="right" valign="top"><strong>author:</strong></th><td bgcolor="#ffffff">%s <br></td></tr>' % doc.author
print '<tr><th bgcolor="#eeeeff" align="right" valign="top"><strong>abstract:</strong></th><td bgcolor="#ffffff">%s <br></td></tr>' % doc.abstract
if docutils.makeextralinks(doc.package):
diff -Nur doc-central-1.8.2/cgi/viewdoc.cgi doc-central-1.8.2+nmu1/cgi/viewdoc.cgi
--- doc-central-1.8.2/cgi/viewdoc.cgi 2005-01-27 23:11:11.000000000 +0100
+++ doc-central-1.8.2+nmu1/cgi/viewdoc.cgi 2008-04-27 14:27:22.000000000 +0200
@@ -17,7 +17,7 @@
print '''<DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>%s</title>
</head>
diff -Nur doc-central-1.8.2/debian/changelog doc-central-1.8.2+nmu1/debian/changelog
--- doc-central-1.8.2/debian/changelog 2005-12-13 02:08:27.000000000 +0100
+++ doc-central-1.8.2+nmu1/debian/changelog 2008-04-27 14:47:04.000000000 +0200
@@ -1,3 +1,17 @@
+doc-central (1.8.2+nmu1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Update for a new doc-base (closes: #454187):
+ - switch to /var/lib/doc-base/documents;
+ - set charset of generated pages to UTF-8;
+ - don't lowerize section names;
+ - depend on appropriate versions of doc-base.
+ * Encode HTML special chars (closes: #360354) and handle the space+dot
+ lines in doc-base files (closes: #360326).
+ * Depend on apache2 | httpd-cgi (closes: #472387).
+
+ -- Robert Luberda <rob...@debian.org> Sun, 27 Apr 2008 14:47:02 +0200
+
doc-central (1.8.2) unstable; urgency=low
* The "How can people still use that?" Release
diff -Nur doc-central-1.8.2/debian/control doc-central-1.8.2+nmu1/debian/control
--- doc-central-1.8.2/debian/control 2005-12-13 02:08:27.000000000 +0100
+++ doc-central-1.8.2+nmu1/debian/control 2008-04-27 14:27:36.000000000 +0200
@@ -7,7 +7,7 @@
Package: doc-central
Architecture: all
-Depends: apache | httpd, python, info2www
+Depends: apache2 | httpd-cgi, python, info2www, doc-base (>= 0.8.10)
Recommends: w3m | www-browser
Description: web-based documentation browser
Doc-Central is a tool to browse the documentation installed on your
signature.asc
Description: Digital signature
--- End Message ---