aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-12-09 16:33:35 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-12-09 16:33:35 +0000
commitd74f9f928084167275d1faf57a038d08d2db3586 (patch)
tree61557af81edc02dfcb2ec367e9cb781216fa1af0
parent91b74697195769cbcd4b2a9bfc6ff8e6d6ddd852 (diff)
downloadperl-URPM-d74f9f928084167275d1faf57a038d08d2db3586.tar
perl-URPM-d74f9f928084167275d1faf57a038d08d2db3586.tar.gz
perl-URPM-d74f9f928084167275d1faf57a038d08d2db3586.tar.bz2
perl-URPM-d74f9f928084167275d1faf57a038d08d2db3586.tar.xz
perl-URPM-d74f9f928084167275d1faf57a038d08d2db3586.zip
correctly clean temp directories
-rw-r--r--t/00prepare.t9
1 files changed, 5 insertions, 4 deletions
diff --git a/t/00prepare.t b/t/00prepare.t
index 25b5c37..c9bb5fd 100644
--- a/t/00prepare.t
+++ b/t/00prepare.t
@@ -5,12 +5,13 @@ use warnings;
use Test::More tests => 1;
use Cwd;
+@tmpdirs = qw(BUILD SOURCES RPMS RPMS/noarch tmp);
+
chdir 't' if -d 't';
-for (qw(BUILD SOURCES RPMS RPMS/noarch tmp)) {
- mkdir $_;
-}
+mkdir $_ foreach @tmpdirs;
+
# locally build a test rpm
system(rpmbuild => '--define', '_topdir ' . Cwd::cwd(), '--define', '_tmppath ' . Cwd::cwd() . '/tmp/', '-bb', 'test-rpm.spec');
ok( -f 'RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm', 'rpm created' );
-END { system('rm -rf BUILD tmp') };
+END { system('rm', '-rf', @tmpdirs) };