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

r10285 - /man-cgi/man.cgi



Author: jfs
Date: Wed Oct 30 01:13:13 2013
New Revision: 10285

URL: http://svn.debian.org/wsvn/?sc=1&rev=10285
Log:
Distinguish between out of date timestamp and no timestamp and output proper messages accordingly. There might be no timestamp if the extractor scripts have not run yet (or are running)

Modified:
    man-cgi/man.cgi

Modified: man-cgi/man.cgi
URL: http://svn.debian.org/wsvn/man-cgi/man.cgi?rev=10285&op=diff
==============================================================================
--- man-cgi/man.cgi	(original)
+++ man-cgi/man.cgi	Wed Oct 30 01:13:13 2013
@@ -957,7 +957,8 @@
     print &html_header("$www{'title'}: Index Page") .
 	 "<H1>$www{'head'}</H1>\n\n" . &intro;
 # If the content is out of date print a warning:
-    &out_of_date if is_out_of_date();
+    &no_content if is_empty();
+    &out_of_date if is_out_of_date() && !is_empty();
     &formquery;
 
     local($m) = ($manpath ? $manpath : $manPathDefault);
@@ -994,6 +995,13 @@
     print "<br>\n";
     print &html_footer();
     0;
+}
+
+sub is_empty {
+    my $ret = 0;
+    my $file = $manLocalDir."/timestamp";
+    return 1 if ! -e $file;
+    return $ret;
 }
 
 sub is_out_of_date {
@@ -1007,12 +1015,27 @@
 }
 
 
+sub no_content {
+    print <<ETX;
+<p><STRONG><font color="#FF0000">NOTE:</font></STRONG> This service is
+currently not working as there are no manpages available in the server.
+This might happen if the archive is being (re)generated. Please wait
+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
+inconvenience.
+</p>
+ETX
+
+}
 
 sub out_of_date {
     print <<ETX;
 <p><STRONG><font color="#FF0000">NOTE:</font></STRONG> The content
-use by this service is currently out of date.  As a consequence newer Debian
-releases might not be listed yet and manpages of previous releases are not
+used by this service is currently out of date.  As a consequence newer Debian
+releases might not be listed yet and manpages of previous releases might not
 fully up to date. We are working on restoring the service.  Sorry for the
 inconvenience.
 </p>


Reply to: