[Bps-public-commit] Test-Chimps-Client branch, master, updated. b48e85ff0995b4fbd845051fd3d0597b9fcabffb

Alex Vandiver alexmv at bestpractical.com
Mon Jul 26 18:58:48 EDT 2010


The branch, master has been updated
       via  b48e85ff0995b4fbd845051fd3d0597b9fcabffb (commit)
       via  b2757d4385e9077e9bcc3139fcf0b7ad640c55ed (commit)
       via  c4f04f15d2853b0b88e430023bc81a4876644017 (commit)
      from  8ab6039c0c209f7df11456d67bb19fdc396e9034 (commit)

Summary of changes:
 examples/tmp_cleaner.pl          |    8 ++++----
 lib/Test/Chimps/Smoker/Source.pm |   29 +++++++++++++++--------------
 2 files changed, 19 insertions(+), 18 deletions(-)

- Log -----------------------------------------------------------------
commit c4f04f15d2853b0b88e430023bc81a4876644017
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Jul 26 18:59:02 2010 -0400

    Skip our own tmp dirs

diff --git a/examples/tmp_cleaner.pl b/examples/tmp_cleaner.pl
index 729513b..0516904 100644
--- a/examples/tmp_cleaner.pl
+++ b/examples/tmp_cleaner.pl
@@ -11,7 +11,7 @@ unless ( grep $_ eq '--clean', @args ) {
 } else {
     my %skip;
     $skip{$_}++ for split /\n/, do {local $/; scalar <>};
-    my @destroy = grep {!$skip{$_}} file_list();
+    my @destroy = grep {!$skip{$_} and not m{^/tmp/chimps-}} file_list();
     for (@destroy) {
         if (-d $_) {
             rmdir($_) or die "Can't rmdir $_: $!";

commit b2757d4385e9077e9bcc3139fcf0b7ad640c55ed
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Jul 26 18:59:28 2010 -0400

    Failure to remove is a warn; only add files which are -w, anyways

diff --git a/examples/tmp_cleaner.pl b/examples/tmp_cleaner.pl
index 0516904..81f8bac 100644
--- a/examples/tmp_cleaner.pl
+++ b/examples/tmp_cleaner.pl
@@ -14,9 +14,9 @@ unless ( grep $_ eq '--clean', @args ) {
     my @destroy = grep {!$skip{$_} and not m{^/tmp/chimps-}} file_list();
     for (@destroy) {
         if (-d $_) {
-            rmdir($_) or die "Can't rmdir $_: $!";
+            rmdir($_) or warn "Can't rmdir $_: $!";
         } else {
-            unlink($_) or die "Can't unlink $_: $!";
+            unlink($_) or warn "Can't unlink $_: $!";
         }
     }
 }
@@ -37,7 +37,7 @@ sub file_list {
         {
             preprocess => sub {
                 # Skip directories which had open files in them
-                return grep {not $open{$File::Find::dir."/".$_}} @_;
+                return grep {-w $_ and not $open{$File::Find::dir."/".$_}} @_;
             },
             wanted => sub {
                 # Everything else gets listed

commit b48e85ff0995b4fbd845051fd3d0597b9fcabffb
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Jul 26 19:00:20 2010 -0400

    Don't shift off $self->clean_cmd, leaving it empty after one run!

diff --git a/lib/Test/Chimps/Smoker/Source.pm b/lib/Test/Chimps/Smoker/Source.pm
index 72b0e9e..1a44dc9 100644
--- a/lib/Test/Chimps/Smoker/Source.pm
+++ b/lib/Test/Chimps/Smoker/Source.pm
@@ -154,21 +154,22 @@ sub do_clean {
     my $self = shift;
     $self->chdir;
 
-    my $clean = $self->clean_cmd;
-    $clean = [ $clean ] if defined $clean and not ref $clean;
-    for my $pre (@{ $self->cleaner || [] }) {
-        my $cmd = shift @{$clean};
-        my @args = (
-            '--project', $self->name,
-            '--config', $self->smoker->config_file,
-            '--clean',
-        );
-        open my $fh, '|-', join(' ', $cmd, @args)
-            or die "Couldn't run `". join(' ', $cmd, @args) ."`: $!";
-        print $fh $pre;
-        close $fh;
+    if (defined $self->clean_cmd) {
+        my @clean = ref $self->clean_cmd ? @{ $self->clean_cmd } : ($self->clean_cmd) ;
+        for my $pre (@{ $self->cleaner || [] }) {
+            my $cmd = shift @clean;
+            my @args = (
+                '--project', $self->name,
+                '--config', $self->smoker->config_file,
+                '--clean',
+            );
+            open my $fh, '|-', join(' ', $cmd, @args)
+                or die "Couldn't run `". join(' ', $cmd, @args) ."`: $!";
+            print $fh $pre;
+            close $fh or die "Error while closing: $!";
+        }
     }
-
+    $self->cleaner(undef);
     $self->clean;
 
     foreach my $dep (@{$self->dependencies}) {

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list