Now that MacPerl is up to 5.6.1, we can use Template.  Yay!  Some liberal use of 
File::Spec and $Config{path_sep} for the PATH separator.  This allows config/install 
to go mostly through with MacPerl; I didn't test XS, the extra installed programs, 
etc. yet; I've not tested most of the functions, just a simple 
$tt->process(\$template, \%vars).  If we need any more portability patches, I'll pass 
'em along as I find 'em.

Enjoy,

--Chris


--- Bourque:Desktop Folder:Template-Toolkit-2.06:Makefile.PL.old        Wed Apr 17 
09:01:09 2002
+++ Bourque:Desktop Folder:Template-Toolkit-2.06:Makefile.PL    Wed Apr 17 09:04:29 
+2002
@@ -3,6 +3,8 @@
 use strict;
 
 use lib qw( ./lib );
+use Config;
+use File::Spec::Functions qw( catfile );
 use Template;
 use ExtUtils::MakeMaker;
 use Cwd;
@@ -116,9 +118,9 @@
 my $TT_SPLASH_BT  = '';
 
 my $DEFAULTS_FILE   = '.defaults.cfg';
-my $DBI_CONFIG_FILE = 't/dbi_test.cfg';
-my $TT_DOCS_CFG     = 'docs/ttree.cfg';
-my $TT_EXAMPLE_CFG  = 'examples/ttree.cfg';
+my $DBI_CONFIG_FILE = catfile('t', 'dbi_test.cfg');
+my $TT_DOCS_CFG     = catfile('docs','ttree.cfg');
+my $TT_EXAMPLE_CFG  = catfile('examples','ttree.cfg');
 my $DEFAULTS = '';
 
 if (-f $DEFAULTS_FILE) {
@@ -468,7 +470,7 @@
        $TT_XS_DEFAULT = (ttprompt('Do you want to use the XS Stash for all 
Templates?', 
                                   $TT_XS_DEFAULT) =~ /^y/i); 
 
-       fix_file('lib/Template/Config.pm',
+       fix_file(catfile('lib','Template','Config.pm'),
                 '$STASH', 
                 $TT_XS_DEFAULT ? 'Template::Stash::XS' : 'Template::Stash');
     }
@@ -532,9 +534,9 @@
        $TT_PDFLATEX_PATH = $TT_LATEX_PATH = $TT_DVIPS_PATH = "";
     }
 
-    fix_file('lib/Template/Config.pm', '$PDFLATEX_PATH', $TT_PDFLATEX_PATH);
-    fix_file('lib/Template/Config.pm', '$LATEX_PATH',    $TT_LATEX_PATH);
-    fix_file('lib/Template/Config.pm', '$DVIPS_PATH',    $TT_DVIPS_PATH);
+    fix_file(catfile('lib','Template','Config.pm'), '$PDFLATEX_PATH', 
+$TT_PDFLATEX_PATH);
+    fix_file(catfile('lib','Template','Config.pm'), '$LATEX_PATH',    $TT_LATEX_PATH);
+    fix_file(catfile('lib','Template','Config.pm'), '$DVIPS_PATH',    $TT_DVIPS_PATH);
 }
 
 
@@ -585,7 +587,7 @@
        $TT_PREFIX = '';
     }
 
-    fix_file('lib/Template/Config.pm', '$INSTDIR', $TT_PREFIX);
+    fix_file(catfile('lib','Template','Config.pm'), '$INSTDIR', $TT_PREFIX);
 }
 
 
@@ -648,7 +650,7 @@
     $TT_IMAGES = ttprompt('URL base for TT2 images?', $TT_IMAGES || $IMAGES);
     $TT_IMAGES =~ s[/$][]g;    # just in case
 
-    fix_file('templates/splash/config', 'images', "$TT_IMAGES/splash");
+    fix_file(catfile('templates','splash','config'), 'images', "$TT_IMAGES/splash");
 }
 
 
@@ -1096,8 +1098,9 @@
 
 sub find_program {
     my($path, $prog) = @_;
-    my $sep = $WIN32 ? qr/;/ : qr/:/;
-    foreach my $dir ( split($sep, $path) ) {
+#     my $sep = $WIN32 ? qr/;/ : qr/:/;
+#     foreach my $dir ( split($sep, $path) ) {
+    foreach my $dir ( split($Config{path_sep}, $path) ) {
         my $file = File::Spec->catfile($dir, $prog);
         if ( !$WIN32 ) {
             return $file if ( -x $file );


-- 
Chris Nandor                      [EMAIL PROTECTED]    http://pudge.net/
Open Source Development Network    [EMAIL PROTECTED]     http://osdn.com/


Reply via email to