pf-tools commit: r887 [parmelan-guest] - in /branches/next-gen: lib/PFTools/VCS.pm sbin/mk_pxelinuxcfg

parmelan-guest at users.alioth.debian.org parmelan-guest at users.alioth.debian.org
Tue Sep 7 14:36:21 UTC 2010


Author: parmelan-guest
Date: Tue Sep  7 14:36:20 2010
New Revision: 887

URL: http://svn.debian.org/wsvn/pf-tools/?sc=1&rev=887
Log:
Use make_path instead of forking and calling mkdir (some more complicated cases still need to be converted)

Modified:
    branches/next-gen/lib/PFTools/VCS.pm
    branches/next-gen/sbin/mk_pxelinuxcfg   (contents, props changed)

Modified: branches/next-gen/lib/PFTools/VCS.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/VCS.pm?rev=887&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/VCS.pm (original)
+++ branches/next-gen/lib/PFTools/VCS.pm Tue Sep  7 14:36:20 2010
@@ -27,6 +27,7 @@
 
 use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Exporter;
+use File::Path qw( make_path );
 
 use PFTools::Logger;
 
@@ -85,8 +86,8 @@
     print $cvs_cmd. "\n" if ( $options->{'debug'} || $options->{'verbose'} );
 
     my $co_dir = $pf_config->{'path'}->{'checkout_dir'};
-    if ( !-d $co_dir ) {
-        system( "/bin/mkdir -p '" . $co_dir . "' 2>/dev/null" );
+    unless ( -d $co_dir ) {
+        make_path($co_dir);
     }
     else {
         system( "/bin/rm -rf '".$co_dir."'; /bin/mkdir -p '".
@@ -141,8 +142,8 @@
     print $svn_cmd. "\n" if ( $options->{'debug'} || $options->{'verbose'} );
 
     my $co_dir = $pf_config->{'path'}->{'checkout_dir'};
-    if ( !-d $co_dir ) {
-        system( "/bin/mkdir -p '" . $co_dir . "' 2>/dev/null" );
+    unless ( -d $co_dir ) {
+        make_path($co_dir);
     }
     else {
         system( "/bin/rm -rf '".$co_dir."'; /bin/mkdir -p '".

Modified: branches/next-gen/sbin/mk_pxelinuxcfg
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/sbin/mk_pxelinuxcfg?rev=887&op=diff
==============================================================================
--- branches/next-gen/sbin/mk_pxelinuxcfg (original)
+++ branches/next-gen/sbin/mk_pxelinuxcfg Tue Sep  7 14:36:20 2010
@@ -27,6 +27,7 @@
 use Data::Dumper;
 use English qw( -no_match_vars );    # Avoids regex performance penalty
 use Getopt::Long qw( :config ignore_case_always bundling );
+use File::Path qw( make_path );
 
 use PFTools::Logger;
 use PFTools::Utils;
@@ -88,7 +89,7 @@
     = Init_TOOLS( "", $PF_CONFIG_FILE, $GLOBAL_STORE_FILE );
 
 if ( !-e $PF_CONFIG->{'path'}->{'preseed_dir'} ) {
-    mkdir $PF_CONFIG->{'path'}->{'preseed_dir'};
+    make_path( $PF_CONFIG->{'path'}->{'preseed_dir'} );
     my ( $login, $pass, $uid, $gid ) = getpwnam('www-data');
     chown $uid, $gid, $PF_CONFIG->{'path'}->{'preseed_dir'};
     my $mode = '2750';




More information about the pf-tools-commits mailing list