httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Benson <gben...@redhat.com>
Subject Patch to make vhost_alias.t mkdir() properly
Date Tue, 28 Aug 2001 15:22:08 GMT

This was silently failing to make the directories on my box (according to
the camel book, the second, MODE, argument to mkdir is mandatory)

Gary

[ Gary Benson, Red Hat Europe ][ gbenson@redhat.com ][ GnuPG 60E8793A ]

Index: t/modules/vhost_alias.t
===================================================================
RCS file: /home/cvspublic/httpd-test/perl-framework/t/modules/vhost_alias.t,v
retrieving revision 1.1
diff -u -r1.1 vhost_alias.t
--- t/modules/vhost_alias.t	2001/08/27 22:55:39	1.1
+++ t/modules/vhost_alias.t	2001/08/28 15:16:53
@@ -18,7 +18,12 @@
 local $vars->{port} = $config->port('mod_vhost_alias');

 ## test environment setup ##
-mkdir "htdocs/modules/vhost_alias" unless -e "htdocs/modules/vhost_alias";
+my $mode = oct('755');
+unless( -e  "htdocs/modules/vhost_alias" ) {
+    mkdir("htdocs/modules/vhost_alias", $mode)
+	or die "can't mkdir htdocs/modules/vhost_alias: $!";
+}
+
 my @d = ();
 foreach (@vh) {
     my @part = split /\./, $_;
@@ -31,7 +36,7 @@
     } else {
         $d .= "_";
     }
-    mkdir $d or die "cant mkdir $d: $!";
+    mkdir($d, $mode) or die "cant mkdir $d: $!";
     $d .= "/";

     ## %1.4 ##
@@ -40,7 +45,7 @@
     } else {
         $d .= substr($part[0], 3, 1);
     }
-    mkdir $d or die "cant mkdir $d: $!";
+    mkdir($d, $mode) or die "cant mkdir $d: $!";
     $d .= "/";

     ## %-2 ##
@@ -49,7 +54,7 @@
     } else {
         $d .= "_";
     }
-    mkdir $d or die "cant mkdir $d: $!";
+    mkdir($d, $mode) or die "cant mkdir $d: $!";
     $d .= "/";

     ## %2+ ##
@@ -57,7 +62,7 @@
         $d .= $part[$i];
         $d .= "." if $part[$i+1];
     }
-    mkdir $d or die "cant mkdir $d: $!";
+    mkdir($d, $mode) or die "cant mkdir $d: $!";

     ## save directory for later deletion ##
     push (@d, $d);
@@ -69,7 +74,7 @@

     ## create directories for VirtualScriptAlias tests ##
     $d = "htdocs/modules/vhost_alias/$_";
-    mkdir $d or die "cant create $d: $!";
+    mkdir($d, $mode) or die "cant create $d: $!";
     push(@d, $d);
     $d .= "/";



Mime
View raw message