Re: [perl #75388] Possible typos in Perl's 5.12.1 Policy_sh.SH

[email protected] (Andy Dougherty)
Newsgroups perl.perl5.porters
Message-ID <[email protected]>
On Thu, 27 May 2010, Stoned Elipot wrote:

> Perl's 5.12.1 Policy_sh.SH script handles a bunch of
> configuration variables related to installation directories.
> 
> A foor loop is used to go through them.
> 
> The loop's words list reads:
> ... html3dir ... siteman1dir siteman3dir sitehtml1dir sitehtml3dir ...
> vendorman1dir vendorman3dir vendorhtml1dir vendorhtml3dir
> 
> But the loop's body seems to be handling, kindof respectively:
> 
> htm31dir siteman1 siteman3 sitehtml1 sitehtm31dir vendorman1 vendorman3
> vendorhtml1 vendorhtm3
>
> Also the body seems to be handling man1ext and man3ext which are
> not in the loop's words list.
> 
> AFAICT pastos and typos could explain these discrepancies.

[That, and historical confusion over what names to use.]

Thanks for catching this.  The following patch (also attached for 
redundancy) ought to fix it. 

This patch fixes several long-standing typos and naming confusions in
Policy_sh.SH, standardizing on the variable names used in config.sh.
This will change the behavior of Policy.sh if you happen to have been
accidentally relying on the Policy.sh incorrect behavior.  I'd appreciate
feedback from anyone using Policy.sh to be sure nothing is broken by
this change.  Thanks to Stoned Elipot for pointing this out.
---
 Policy_sh.SH |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/Policy_sh.SH b/Policy_sh.SH
index a618d23..cc310dd 100644
--- a/Policy_sh.SH
+++ b/Policy_sh.SH
@@ -130,7 +130,8 @@ esac
 #	$vendorman1dir $vendorman3dir $vendorhtml1dir $vendorhtml3dir
 
 for var in \
-	bin scriptdir privlib archlib man1dir man3dir html1dir html3dir \
+	bin scriptdir privlib archlib man1dir man3dir man1ext man3ext \
+	html1dir html3dir \
 	sitebin sitescript sitelib sitearch \
 		siteman1dir siteman3dir sitehtml1dir sitehtml3dir \
 	vendorbin vendorscript vendorlib vendorarch \
@@ -165,7 +166,7 @@ do
 
     # We don't know what to do with these yet.
     html1dir)	dflt='' ;;
-    htm31dir)	dflt='' ;;
+    html3dir)	dflt='' ;;
  
     # Directories for site-specific add-on files
     sitebin)	dflt=$siteprefix/bin ;;
@@ -184,11 +185,11 @@ do
 	;;
     sitearch)	dflt="$sitelib/$archname" ;;
 
-    siteman1)	dflt="$siteprefix/man/man1" ;;
-    siteman3)	dflt="$siteprefix/man/man3" ;;
+    siteman1dir) dflt="$siteprefix/man/man1" ;;
+    siteman3dir) dflt="$siteprefix/man/man3" ;;
     # We don't know what to do with these yet.
-    sitehtml1)	dflt='' ;;
-    sitehtm31dir)	dflt='' ;;
+    sitehtml1dir)	dflt='' ;;
+    sitehtml3dir)	dflt='' ;;
     
     # Directories for vendor-supplied add-on files
     # These are all usually empty.
@@ -213,11 +214,11 @@ do
 		;;
 	    vendorarch)	dflt="$vendorlib/$archname" ;;
 
-	    vendorman1)	dflt="$vendorprefix/man/man1" ;;
-	    vendorman3)	dflt="$vendorprefix/man/man3" ;;
+	    vendorman1dir)	dflt="$vendorprefix/man/man1" ;;
+	    vendorman3dir)	dflt="$vendorprefix/man/man3" ;;
 	    # We don't know what to do with these yet.
-	    vendorhtml1)	dflt='' ;;
-	    vendorhtm3)	dflt='' ;;
+	    vendorhtml1dir)	dflt='' ;;
+	    vendorhtml3dir)	dflt='' ;;
 
 	    esac  # End of vendorprefix != ''
 	fi
-- 
1.5.6.5


-- 
    Andy Dougherty		[email protected]
    Dept. of Physics
    Lafayette College, Easton PA 18042
0001--perl-75388-Fix-long-standing-typos-in-Policy_sh.S.patch (text/x-diff, 2.6 KB)
From afc3d215bfe7991268a5a95cf18afd0d5fb03479 Mon Sep 17 00:00:00 2001
From: Andy Dougherty <[email protected]>
Date: Tue, 8 Jun 2010 08:50:03 -0400
Subject: [PATCH] [perl #75388] Fix long-standing typos in Policy_sh.SH

This patch fixes several long-standing typos and naming confusions in
Policy_sh.SH, standardizing on the variable names used in config.sh.
This will change the behavior of Policy.sh if you happen to have been
accidentally relying on the Policy.sh incorrect behavior.  I'd appreciate
feedback from anyone using Policy.sh to be sure nothing is broken by
this change.  Thanks to Stoned Elipot for pointing this out.
---
 Policy_sh.SH |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/Policy_sh.SH b/Policy_sh.SH
index a618d23..cc310dd 100644
--- a/Policy_sh.SH
+++ b/Policy_sh.SH
@@ -130,7 +130,8 @@ esac
 #	$vendorman1dir $vendorman3dir $vendorhtml1dir $vendorhtml3dir
 
 for var in \
-	bin scriptdir privlib archlib man1dir man3dir html1dir html3dir \
+	bin scriptdir privlib archlib man1dir man3dir man1ext man3ext \
+	html1dir html3dir \
 	sitebin sitescript sitelib sitearch \
 		siteman1dir siteman3dir sitehtml1dir sitehtml3dir \
 	vendorbin vendorscript vendorlib vendorarch \
@@ -165,7 +166,7 @@ do
 
     # We don't know what to do with these yet.
     html1dir)	dflt='' ;;
-    htm31dir)	dflt='' ;;
+    html3dir)	dflt='' ;;
 
     # Directories for site-specific add-on files
     sitebin)	dflt=$siteprefix/bin ;;
@@ -184,11 +185,11 @@ do
 	;;
     sitearch)	dflt="$sitelib/$archname" ;;
 
-    siteman1)	dflt="$siteprefix/man/man1" ;;
-    siteman3)	dflt="$siteprefix/man/man3" ;;
+    siteman1dir) dflt="$siteprefix/man/man1" ;;
+    siteman3dir) dflt="$siteprefix/man/man3" ;;
     # We don't know what to do with these yet.
-    sitehtml1)	dflt='' ;;
-    sitehtm31dir)	dflt='' ;;
+    sitehtml1dir)	dflt='' ;;
+    sitehtml3dir)	dflt='' ;;
     
     # Directories for vendor-supplied add-on files
     # These are all usually empty.
@@ -213,11 +214,11 @@ do
 		;;
 	    vendorarch)	dflt="$vendorlib/$archname" ;;
 
-	    vendorman1)	dflt="$vendorprefix/man/man1" ;;
-	    vendorman3)	dflt="$vendorprefix/man/man3" ;;
+	    vendorman1dir)	dflt="$vendorprefix/man/man1" ;;
+	    vendorman3dir)	dflt="$vendorprefix/man/man3" ;;
 	    # We don't know what to do with these yet.
-	    vendorhtml1)	dflt='' ;;
-	    vendorhtm3)	dflt='' ;;
+	    vendorhtml1dir)	dflt='' ;;
+	    vendorhtml3dir)	dflt='' ;;
 
 	    esac  # End of vendorprefix != ''
 	fi
-- 
1.5.6.5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.