r10325 - /man-cgi/man.cgi
Author: jfs
Date: Wed Nov 6 20:21:49 2013
New Revision: 10325
URL: http://svn.debian.org/wsvn/?sc=1&rev=10325
Log:
- Add a more verbose description when a manpage (or apropos query) are not found.
- Replace mailto variable with 'author' variable to make it more clear
- Update copyright years
Modified:
man-cgi/man.cgi
Modified: man-cgi/man.cgi
URL: http://svn.debian.org/wsvn/man-cgi/man.cgi?rev=10325&op=diff
==============================================================================
--- man-cgi/man.cgi (original)
+++ man-cgi/man.cgi Wed Nov 6 20:21:49 2013
@@ -33,7 +33,7 @@
# by polk@BSDI.COM 1/10/95
# BSDI Id: bsdi-man,v 1.2 1995/01/11 02:30:01 polk Exp
# Dual CGI/Plexus mode and new interface by sanders@bsdi.com 9/22/1995
-# Modified for Debian by Javier Fernandez-Sanguino <jfs@debian.org> - 08/30/2007 to 2012
+# Modified for Debian by Javier Fernandez-Sanguino <jfs@debian.org> - 08/30/2007 to 2013
#
############################################################################
@@ -258,12 +258,13 @@
# mailto - Author
+$authoremail = 'wosch@FreeBSD.org';
+$authorURL = 'http://wolfram.schneider.org';
+$authorURL = "mailto:$authoremail" if !$authorURL;
# webmaster - who runs this service
-$mailto = 'wosch@FreeBSD.org';
-$mailtoURL = 'http://wolfram.schneider.org';
-$mailtoURL = "mailto:$mailto" if !$mailtoURL;
$webmaster = 'jfs@debian.org';
$webmasterURL = 'mailto:jfs@debian.org';
+$webmasterDesc = 'the service administrator';
#$manstat = 'http://www.de.freebsd.org/de/stat/man';
&secure_env;
@@ -489,6 +490,7 @@
if (!$acounter) {
print "Sorry, no data found for `$query' ($acounter).\n";
+ print ¬_found('apropos',$section);
}
print "</DL>\n";
print &html_footer();
@@ -657,6 +659,7 @@
print "X $command{'man'} @manargs -- $section $name x\n" if $debug;
print "Sorry, no data found for `$html_name" .
($html_section ? "($html_section)": '') . "'.\n";
+ print ¬_found('section',$html_section);
if ( $locale) {
print "You might want to try the ".
qq{<A HREF="$BASE?query=$name&sektion=$section&apropos=0&manpath=$manpath">original (english)</A> version.\n};
@@ -1023,8 +1026,8 @@
until the manpage index is generated, this can take around one day.
</p>
-<p>If the problem persists after a few days please contact the service administrators at the
-following address: <a href="$webmasterURL">$webmaster</a>. Sorry for the
+<p>If the problem persists after a few days please contact <a
+href="$webmasterURL">$webmasterDesc</a>. Sorry for the
inconvenience.
</p>
ETX
@@ -1141,9 +1144,9 @@
sub copyright {
return qq{\
<PRE>
-Copyright (c) 1996-2007 <a href="$mailtoURL">Wolfram Schneider</A>
+Copyright (c) 1996-2007 <a href="$authorURL">Wolfram Schneider</A>
Copyright (c) 1993-1995 Berkeley Software Design, Inc.
-Copyright (c) 2007-2012 <a href="mailto:jfs\@debian.org">Javier Fernandez-Sanguino</A>
+Copyright (c) 2007-2013 <a href="mailto:jfs\@debian.org">Javier Fernandez-Sanguino</A>
This data is part of a licensed program from BERKELEY SOFTWARE
DESIGN, INC. Portions are copyrighted by BSDI, The Regents of
@@ -1177,9 +1180,9 @@
return qq{\
<PRE>
-Copyright (c) 1996-2007 <a href="$mailtoURL">Wolfram Schneider</A>
+Copyright (c) 1996-2007 <a href="$authorURL">Wolfram Schneider</A>
Copyright (c) 1993-1995 Berkeley Software Design, Inc.
-Copyright (c) 2007-2012 <a href="mailto:jfs\@debian.org">Javier Fernandez-Sanguino</A>
+Copyright (c) 2007-2013 <a href="mailto:jfs\@debian.org">Javier Fernandez-Sanguino</A>
This data is part of a licensed program from BERKELEY SOFTWARE
DESIGN, INC. Portions are copyrighted by BSDI, The Regents of
@@ -1253,7 +1256,7 @@
href="http://packages.debian.org/">packages.debian.org</a>.</p>
<H1>Service history</H1>
-<p>This service has been running since August 2007. It used to run in a
+<p>This service has been running since August 2007. It used to run in an
Debian official mirror (Spain's: ftp.es.debian.org). Following <a
href="http://lists.debian.org/debian-doc/2009/06/msg00022.html">several
issues</a> with the server (now solved) it was moved (in may 2010) to paganini.debian.org.
@@ -1315,7 +1318,7 @@
<H1>Contact information</H1>
-<p>If you want to contact the maintainer of this service you can use the
+<p>If you want to contact $webmasterDesc you can use the
following address: <a href="$webmasterURL">$webmaster</a>. Alternatively,
you can contact the <a href="http://lists.debian.org/debian-doc/">Debian
Documentation Mailing List</a>. Patches improving the CGI interface are most
@@ -1382,6 +1385,40 @@
return $header;
}
+sub not_found {
+ local($type, $section) = @_;
+ my $text ="";
+ $text = qq{
+<p>This might happen because:
+<ul>
+};
+ if ( $type eq 'apropos' ) {
+ $text = $text. "<li>The keyword cannot be found in any manpage name or title."
+ }
+ if ( $type eq 'section' ) {
+ $text = $text. "<li>The manpage does not exist in the archive."
+ }
+ if ( $section != 0 ) {
+ $text = $text. "<li>The manpage exists but not in the section you selected. Try searching in 'All sections'.</li>\n";
+ }
+ $text = $text.qq{
+<li>There was an error in the archive extraction scripts and the package that provides this manpage was not handled properly.</li>
+</ul>
+};
+ if ( -e $manLocalDir."/UPDATE_IN_PROGRESS" ) {
+ $text = $text. "<p><STRONG><font color=\"#FF0000\">PLEASE NOTE:</font></STRONG> an archive update is currently in progress. The manpage might be new and has not been extracted yet from a package. You can try again later, when the extraction has finished (typically, in the next day). This warning will disappear then.</p>\n";
+ }
+
+ $text = $text.qq{
+<p>If you are sure the manpage exists in a Debian package, please contact
+$webmasterDesc at the following address: <a
+href="$webmasterURL">$webmaster</a>. Please include in your message: the error
+received, the package name, manpage and the full URL above. Thank you.</p>
+};
+
+ return $text;
+}
+
sub html_footer {
my $footer ="";
$footer = qq{
Reply to: