List:Commits« Previous MessageNext Message »
From:paul Date:September 11 2007 4:52pm
Subject:svn commit - mysqldoc@docsrva: r7796 - in trunk: . tools
View as plain text  
Author: paul
Date: 2007-09-11 18:52:04 +0200 (Tue, 11 Sep 2007)
New Revision: 7796

Log:
 r24776@frost:  paul | 2007-09-11 08:35:53 -0500
 map-expired-nodes.pl error pages:
 Fix bug in URL "shortening" (I performed the calculation but did not
 use the result!).
 Print full URL even for local pages (in current document).


Modified:
   trunk/tools/map-expired-nodes.pl

Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:30129
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:24745
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:20005
   + 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:30102
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:24776
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:20005


Modified: trunk/tools/map-expired-nodes.pl
===================================================================
--- trunk/tools/map-expired-nodes.pl	2007-09-11 16:49:31 UTC (rev 7795)
+++ trunk/tools/map-expired-nodes.pl	2007-09-11 16:52:04 UTC (rev 7796)
Changed blocks: 2, Lines Added: 14, Lines Deleted: 7; 2180 bytes

@@ -23,6 +23,10 @@
 # of old pages forever, but eventually require users to click through an
 # error page explicitly.
 
+# Input renamed-nodes.txt line format: old-name new-name [date]
+# Output lines have only old-name new-name pairs
+
+# Input line interpretation:
 # 1) If there is no date, redirect old_name to new_name.
 # 2) If there is a date and it hasn't been reached, redirect old_name
 #    to new_name.

@@ -267,32 +271,35 @@
   elsif ($new_name =~ m|/|) # Pathname to external page in another MySQL doc?
   {
     # Add .html to get page name
-    $url = $doc_url_base;
     my $page = $new_name . ".html";
+    # Construct full URL of page. In some cases, a "shortening" can be done:
     # Trim a component from the base URL end for each "../" at the beginning
     # of the page path. Example:
     # From: http://host/dir1/dir2/dir3/ and ../../page.html
     # To:   http://host/dir1/ and page.html
     # The resulting URL is http://host/dir1/page.html rather than
     # http://host/dir1/dir2/dir3/../../page.html.
-    while ($page =~ m|^\.\./| && $url =~ m|[^/]*/$|)
+    $url = $doc_url_base;
+    while ($url =~ m|[^/]*/$| && $page =~ m|^\.\./|)
     {
+      $url =~ s|[^/]*/$||;
       $page =~ s|^\.\./||;
-      $url =~ s|[^/]*/$||;
     }
-    $url = (defined ($doc_url_base) ? $doc_url_base : "") . $new_name . ".html";
+    $url .= $page;
   }
   elsif ($new_name =~ /^[-_a-zA-Z0-9]+$/) # Local page (in current document)?
   {
     # Add .html to get page name (this has no leading directory because it's
     # in the same directory as the page for the old name)
-    $url = $new_name . ".html";
+    my $page = $new_name . ".html";
     # Verify that page really exists in output directory
-    if (! -e "$output_dir/$url")
+    if (! -e "$output_dir/$page")
     {
-      ++$new_name_nonexistent{$url};
+      ++$new_name_nonexistent{$page};
       next;
     }
+    # Construct full URL of page
+    $url = $doc_url_base . $page;
   }
   else
   {


Thread
svn commit - mysqldoc@docsrva: r7796 - in trunk: . toolspaul11 Sep