You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by km...@apache.org on 2015/04/28 09:20:31 UTC

svn commit: r1676422 - in /spamassassin/trunk/t: SATest.pm sa_compile.t

Author: kmcgrail
Date: Tue Apr 28 07:20:30 2015
New Revision: 1676422

URL: http://svn.apache.org/r1676422
Log:
work on bug 7181 for make disttest and sa_compile.t

Modified:
    spamassassin/trunk/t/SATest.pm
    spamassassin/trunk/t/sa_compile.t

Modified: spamassassin/trunk/t/SATest.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/SATest.pm?rev=1676422&r1=1676421&r2=1676422&view=diff
==============================================================================
--- spamassassin/trunk/t/SATest.pm (original)
+++ spamassassin/trunk/t/SATest.pm Tue Apr 28 07:20:30 2015
@@ -166,7 +166,9 @@ sub sa_t_init {
   # do not remove prior test results!
   # rmtree ("log");
 
-  mkdir ("log", 0755);
+  unless (-d "log") {
+    mkdir ("log", 0755) or die ("Error creating log dir: $!");
+  }
   chmod (0755, "log"); # set in case log already exists with wrong permissions
   system("chacl -B log 2>/dev/null || setfacl -b log 2>/dev/null"); # remove acls that confuse test
 

Modified: spamassassin/trunk/t/sa_compile.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/sa_compile.t?rev=1676422&r1=1676421&r2=1676422&view=diff
==============================================================================
--- spamassassin/trunk/t/sa_compile.t (original)
+++ spamassassin/trunk/t/sa_compile.t Tue Apr 28 07:20:30 2015
@@ -5,6 +5,8 @@ $ENV{'TEST_PERL_TAINT'} = 'no';     # in
 use SATest; sa_t_init("sa_compile");
 use Test;
 use Config;
+use File::Basename;
+use File::Path qw/mkpath/;
 
 my $temp_binpath = $Config{sitebinexp};
 $temp_binpath =~ s/^\Q$Config{prefix}\E//;
@@ -75,8 +77,14 @@ sub run_makefile_pl {
 
 sub set_rules {
   my $rules = shift;
-  open RULES, ">$instdir/foo/share/spamassassin/20_testrules.cf"
-          or die "cannot write $instdir/foo/share/spamassassin/20_testrules.cf";
+
+  #Create the dir for the cf file
+  my $file = "$instdir/foo/share/spamassassin/20_testrules.cf";
+  my $dir = dirname($file);
+  mkpath($dir);
+
+  open RULES, ">$file"
+          or die "cannot write $file - $!";
   print RULES qq{
 
     use_bayes 0
@@ -86,8 +94,13 @@ sub set_rules {
   };
   close RULES or die;
 
-  open RULES, ">$instdir/foo/etc/mail/spamassassin/v330.pre"
-          or die "cannot write $instdir/foo/etc/mail/spamassassin/v330.pre";
+  #Create the dir for the pre file
+  $file = "$instdir/foo/etc/mail/spamassassin/v330.pre";
+  $dir = dirname($file);
+  mkpath($dir);
+
+  open RULES, ">$file"
+          or die "cannot write $file - $!";
   print RULES qq{
 
     loadplugin Mail::SpamAssassin::Plugin::MIMEHeader