[svn:parrot] r39955 - in trunk: lib/Parrot lib/Parrot/IO t/configure t/tools/install t/tools/ops2pm tools/dev

jkeenan at svn.parrot.org jkeenan at svn.parrot.org
Thu Jul 9 00:02:28 UTC 2009


Author: jkeenan
Date: Thu Jul  9 00:02:26 2009
New Revision: 39955
URL: https://trac.parrot.org/parrot/changeset/39955

Log:
Use most traditional form of File::Path::mkpath(), as it seems to work best across all versions of Perl and File::Path.

Modified:
   trunk/lib/Parrot/IO/Directory.pm
   trunk/lib/Parrot/IO/Path.pm
   trunk/lib/Parrot/Ops2pm.pm
   trunk/t/configure/017-revision_from_cache.t
   trunk/t/configure/018-revision_to_cache.t
   trunk/t/configure/061-revision_from_cache.t
   trunk/t/tools/install/01-create_directories.t
   trunk/t/tools/install/dev_overall.t
   trunk/t/tools/install/overall.t
   trunk/t/tools/ops2pm/05-renum_op_map_file.t
   trunk/t/tools/ops2pm/10-print_module.t
   trunk/t/tools/ops2pm/11-print_h.t
   trunk/tools/dev/create_language.pl
   trunk/tools/dev/mk_language_shell.pl

Modified: trunk/lib/Parrot/IO/Directory.pm
==============================================================================
--- trunk/lib/Parrot/IO/Directory.pm	Wed Jul  8 23:39:28 2009	(r39954)
+++ trunk/lib/Parrot/IO/Directory.pm	Thu Jul  9 00:02:26 2009	(r39955)
@@ -131,7 +131,7 @@
     unless ( -e $self->path ) {
 
         # This dies if it fails.
-        mkpath( $self->path );
+        mkpath( [ $self->path ], 0, 0777 );
     }
 
     return -d $self->path;

Modified: trunk/lib/Parrot/IO/Path.pm
==============================================================================
--- trunk/lib/Parrot/IO/Path.pm	Wed Jul  8 23:39:28 2009	(r39954)
+++ trunk/lib/Parrot/IO/Path.pm	Thu Jul  9 00:02:26 2009	(r39955)
@@ -101,7 +101,7 @@
     unless ( -e $self->parent_path ) {
 
         # This dies if it fails.
-        mkpath( $self->parent_path );
+        mkpath( [ $self->parent_path ], 0, 0777 );
     }
 
     return -e $self->parent_path;

Modified: trunk/lib/Parrot/Ops2pm.pm
==============================================================================
--- trunk/lib/Parrot/Ops2pm.pm	Wed Jul  8 23:39:28 2009	(r39954)
+++ trunk/lib/Parrot/Ops2pm.pm	Thu Jul  9 00:02:26 2009	(r39955)
@@ -323,7 +323,7 @@
     my $cwd     = cwd();
     my $fulldir = File::Spec->catdir( $cwd, $self->{moddir} );
     if ( !-d $fulldir ) {
-        if ( !File::Path::mkpath( $fulldir, { mode => 0755 } ) ) {
+        if ( !File::Path::mkpath( [ $fulldir ], 0, 0755 ) ) {
             -d $fulldir
                 or die "$self->{script}: Could not mkdir $fulldir: $!!\n";
         }
@@ -412,7 +412,7 @@
     my $cwd     = cwd();
     my $fulldir = File::Spec->catdir( $cwd, $self->{inc_dir} );
     if ( !-d $fulldir ) {
-        if ( !File::Path::mkpath( $fulldir, { mode => 0755 } ) ) {
+        if ( !File::Path::mkpath( [ $fulldir ], 0, 0755 ) ) {
             -d $fulldir
                 or die "$self->{script}: Could not mkdir $fulldir: $!!\n";
         }

Modified: trunk/t/configure/017-revision_from_cache.t
==============================================================================
--- trunk/t/configure/017-revision_from_cache.t	Wed Jul  8 23:39:28 2009	(r39954)
+++ trunk/t/configure/017-revision_from_cache.t	Thu Jul  9 00:02:26 2009	(r39955)
@@ -41,10 +41,10 @@
     my $tdir = tempdir( CLEANUP => 1 );
     ok( chdir $tdir, "Changed to temporary directory for testing" );
     my $libdir = qq{$tdir/lib};
-    ok( (File::Path::mkpath( $libdir )), "Able to make libdir");
+    ok( (File::Path::mkpath( [ $libdir ], 0, 0777 )), "Able to make libdir");
     local @INC;
     unshift @INC, $libdir;
-    ok( (File::Path::mkpath( qq{$libdir/Parrot} )), "Able to make Parrot dir");
+    ok( (File::Path::mkpath( [ qq{$libdir/Parrot} ], 0, 0777 )), "Able to make Parrot dir");
     ok( (copy qq{$cwd/lib/Parrot/Revision.pm},
             qq{$libdir/Parrot}), "Able to copy Parrot::Revision");
     my $cache = q{.parrot_current_rev};

Modified: trunk/t/configure/018-revision_to_cache.t
==============================================================================
--- trunk/t/configure/018-revision_to_cache.t	Wed Jul  8 23:39:28 2009	(r39954)
+++ trunk/t/configure/018-revision_to_cache.t	Thu Jul  9 00:02:26 2009	(r39955)
@@ -23,10 +23,10 @@
     my $tdir = tempdir( CLEANUP => 1 );
     ok( chdir $tdir, "Changed to temporary directory for testing" );
     my $libdir = qq{$tdir/lib};
-    ok( (File::Path::mkpath( $libdir )), "Able to make libdir");
+    ok( (File::Path::mkpath( [ $libdir ], 0, 0777 )), "Able to make libdir");
     local @INC;
     unshift @INC, $libdir;
-    ok( (File::Path::mkpath( qq{$libdir/Parrot} )), "Able to make Parrot dir");
+    ok( (File::Path::mkpath( [ qq{$libdir/Parrot} ], 0, 0777 )), "Able to make Parrot dir");
     ok( (copy qq{$cwd/lib/Parrot/Revision.pm},
             qq{$libdir/Parrot}), "Able to copy Parrot::Revision");
     require Parrot::Revision;

Modified: trunk/t/configure/061-revision_from_cache.t
==============================================================================
--- trunk/t/configure/061-revision_from_cache.t	Wed Jul  8 23:39:28 2009	(r39954)
+++ trunk/t/configure/061-revision_from_cache.t	Thu Jul  9 00:02:26 2009	(r39955)
@@ -101,10 +101,10 @@
     my $tdir = tempdir( CLEANUP => 1 );
     ok( chdir $tdir, "Changed to temporary directory for testing" );
     my $libdir = qq{$tdir/lib};
-    ok( (File::Path::mkpath( $libdir )), "Able to make libdir");
+    ok( (File::Path::mkpath( [ $libdir ], 0, 0777 )), "Able to make libdir");
     local @INC;
     unshift @INC, $libdir;
-    ok( (File::Path::mkpath( qq{$libdir/Parrot} )), "Able to make Parrot dir");
+    ok( (File::Path::mkpath( [ qq{$libdir/Parrot} ], 0, 0777 )), "Able to make Parrot dir");
     ok( (copy qq{$cwd/lib/Parrot/Revision.pm},
             qq{$libdir/Parrot}), "Able to copy Parrot::Revision");
     my $cache = q{.parrot_current_rev};

Modified: trunk/t/tools/install/01-create_directories.t
==============================================================================
--- trunk/t/tools/install/01-create_directories.t	Wed Jul  8 23:39:28 2009	(r39954)
+++ trunk/t/tools/install/01-create_directories.t	Thu Jul  9 00:02:26 2009	(r39955)
@@ -34,7 +34,7 @@
     $tdir .= '/';
 
     my @dirs = qw(foo/bar foo/bar/baz);
-    my @created = mkpath( "$tdir$dirs[0]" );
+    my @created = mkpath( [ "$tdir$dirs[0]" ], 0, 0777 );
     ok( ( -d $created[0] ),
         "one directory created before create_directories() is called" );
 
@@ -52,7 +52,7 @@
     $tdir .= '/';
 
     my @dirs = qw(foo/bar foo/bar/baz);
-    my @created = mkpath( $tdir . 'foo' );
+    my @created = mkpath( [ $tdir . 'foo' ], 0, 0777 );
     ok( ( -d $created[0] ),
         "one directory created before create_directories() is called" );
 

Modified: trunk/t/tools/install/dev_overall.t
==============================================================================
--- trunk/t/tools/install/dev_overall.t	Wed Jul  8 23:39:28 2009	(r39954)
+++ trunk/t/tools/install/dev_overall.t	Thu Jul  9 00:02:26 2009	(r39955)
@@ -115,9 +115,11 @@
         runtime/parrot/library
         src/pmc
     );
-    my @created =
-        mkpath( ( map { File::Spec->catdir( $builddir, $_ ) } @dirs_needed ),
-            { mode => 0777} );
+    my @created = mkpath(
+        [ map { File::Spec->catdir( $builddir, $_ ) } @dirs_needed ],
+        0,
+        0777
+    );
     print STDERR "dirs created:  @created\n" if $DEBUG;
     foreach my $f ( keys %testfiles ) {
         my $src = File::Spec->catfile( $cwd, $testlibdir, $f );

Modified: trunk/t/tools/install/overall.t
==============================================================================
--- trunk/t/tools/install/overall.t	Wed Jul  8 23:39:28 2009	(r39954)
+++ trunk/t/tools/install/overall.t	Thu Jul  9 00:02:26 2009	(r39955)
@@ -100,9 +100,11 @@
         runtime/parrot/include
         compilers/pge
     );
-    my @created =
-        mkpath( ( map { File::Spec->catdir( $builddir, $_ ) } @dirs_needed ),
-            { mode => 0777 } );
+    my @created = mkpath(
+        [ map { File::Spec->catdir( $builddir, $_ ) } @dirs_needed ],
+        0,
+        0777
+    );
     print STDERR "dirs created:  @created\n" if $DEBUG;
     foreach my $f ( keys %testfiles ) {
         my $src = File::Spec->catfile( $cwd, $testlibdir, $f );

Modified: trunk/t/tools/ops2pm/05-renum_op_map_file.t
==============================================================================
--- trunk/t/tools/ops2pm/05-renum_op_map_file.t	Wed Jul  8 23:39:28 2009	(r39954)
+++ trunk/t/tools/ops2pm/05-renum_op_map_file.t	Thu Jul  9 00:02:26 2009	(r39955)
@@ -32,7 +32,7 @@
     my $tdir = tempdir( CLEANUP => 1 );
     chdir $tdir or croak "Unable to change to testing directory: $!";
     my $opsdir = File::Spec->catdir ( $tdir, 'src', 'ops' );
-    mkpath( $opsdir, { mode => 0755 } ) or croak "Unable to make testing directory";
+    mkpath( [ $opsdir ], 0, 0755 ) or croak "Unable to make testing directory";
 
     ##### Stage 1:  Generate ops.num de novo #####
 

Modified: trunk/t/tools/ops2pm/10-print_module.t
==============================================================================
--- trunk/t/tools/ops2pm/10-print_module.t	Wed Jul  8 23:39:28 2009	(r39954)
+++ trunk/t/tools/ops2pm/10-print_module.t	Thu Jul  9 00:02:26 2009	(r39955)
@@ -188,7 +188,7 @@
 Directory failure:  can it be provoked?
 
   if ( !-d $fulldir ) {
-    File::Path::mkpath( $fulldir, { mode => 0755 } )
+    File::Path::mkpath( [ $fulldir ], 0, 0755 )
       or die "$self->{script}: Could not mkdir $fulldir: $!!\n";
   }
 

Modified: trunk/t/tools/ops2pm/11-print_h.t
==============================================================================
--- trunk/t/tools/ops2pm/11-print_h.t	Wed Jul  8 23:39:28 2009	(r39954)
+++ trunk/t/tools/ops2pm/11-print_h.t	Thu Jul  9 00:02:26 2009	(r39955)
@@ -120,7 +120,7 @@
 Directory failure:  can it be provoked?
 
   if ( !-d $fulldir ) {
-    File::Path::mkpath( $fulldir, { mode => 0755 } )
+    File::Path::mkpath( [ $fulldir ], 0, 0755 )
       or die "$self->{script}: Could not mkdir $fulldir: $!!\n";
   }
 

Modified: trunk/tools/dev/create_language.pl
==============================================================================
--- trunk/tools/dev/create_language.pl	Wed Jul  8 23:39:28 2009	(r39954)
+++ trunk/tools/dev/create_language.pl	Thu Jul  9 00:02:26 2009	(r39955)
@@ -116,7 +116,7 @@
     my $filedir = File::Spec->catpath($volume, $dir);
     unless (-d $filedir) {
         print "creating $filedir\n";
-        mkpath($filedir);
+        mkpath( [ $filedir ], 0, 0777 );
     }
     print "creating $filepath\n";
     open $fh, '>', $filepath;

Modified: trunk/tools/dev/mk_language_shell.pl
==============================================================================
--- trunk/tools/dev/mk_language_shell.pl	Wed Jul  8 23:39:28 2009	(r39954)
+++ trunk/tools/dev/mk_language_shell.pl	Thu Jul  9 00:02:26 2009	(r39955)
@@ -173,7 +173,7 @@
     my $filedir = File::Spec->catpath($volume, $dir);
     unless (-d $filedir) {
         print "creating $filedir\n";
-        mkpath($filedir);
+        mkpath( [ $filedir ], 0, 0777 );
     }
     print "creating $filepath\n";
     open $fh, '>', $filepath;


More information about the parrot-commits mailing list