lintian: r399 - in trunk: debian lib testset
Author: djpig
Date: 2005-01-08 23:47:00 +0100 (Sat, 08 Jan 2005)
New Revision: 399
Modified:
trunk/debian/changelog
trunk/lib/Lab.pm
trunk/testset/runtests
Log:
* lib/Lab.pm:
+ In temporary lab mode, try to create the directory several
times
* testset/runtests: Extend the static lab test
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2005-01-08 20:45:35 UTC (rev 398)
+++ trunk/debian/changelog 2005-01-08 22:47:00 UTC (rev 399)
@@ -1,7 +1,12 @@
lintian (1.23.7) unstable; urgency=high
- * lib/Lab.pm: Since the last release, creation of static lab failed
- if the directory already existed
+ * lib/Lab.pm:
+ + Since the last release, creation of static lab failed
+ if the directory already existed
+ + In temporary lab mode, try to create the directory several
+ times
+
+ * testset/runtests: Extend the static lab test
-- Frank Lichtenheld <djpig@debian.org> Sat, 8 Jan 2005 21:41:21 +0100
Modified: trunk/lib/Lab.pm
===================================================================
--- trunk/lib/Lab.pm 2005-01-08 20:45:35 UTC (rev 398)
+++ trunk/lib/Lab.pm 2005-01-08 22:47:00 UTC (rev 399)
@@ -65,9 +65,18 @@
} else {
$self->{mode} = 'temporary';
- $dir = tmpnam();
+ my $created = 0;
+ for (1..10) {
+ $dir = tmpnam();
- $self->setup_force( $dir, $dist );
+ if ($self->setup_force( $dir, $dist )) {
+ $created = 1;
+ last;
+ }
+ }
+ unless ($created) {
+ fail("cannot create lab directory $dir");
+ }
}
return 1;
@@ -95,7 +104,7 @@
# create lab directory
# (Note, that the mode 0777 is reduced by the current umask.)
unless (-d $dir && ( $self->{mode} eq 'static' )) {
- mkdir($dir,0777) or fail("cannot create lab directory $dir");
+ mkdir($dir,0777) or return 0;
}
# create base directories
Modified: trunk/testset/runtests
===================================================================
--- trunk/testset/runtests 2005-01-08 20:45:35 UTC (rev 398)
+++ trunk/testset/runtests 2005-01-08 22:47:00 UTC (rev 399)
@@ -156,10 +156,23 @@
}
# can I make a lab?
-print "Running static lab test ... ";
+print "Running static lab test ... create ... ";
$testok = runsystem_ok("$lintian_path --lab $rundir/test_lab --setup-lab");
+# can I renew a lab?
+print " renew ... ";
+$testok = runsystem_ok("$lintian_path --lab $rundir/test_lab --setup-lab")
+ if $testok;
+# can I remove a lab?
+print " remove ...";
+$testok = runsystem_ok("$lintian_path --lab $rundir/test_lab --remove-lab")
+ if $testok;
+# should be empty now
+print " rmdir ...";
+$testok = runsystem_ok("rmdir $rundir/test_lab")
+ if $testok;
+# cleanup
+runsystem("rm -r $rundir/test_lab") if -d "$rundir/test_lab";
if ($testok) {
- runsystem("rm -r $rundir/test_lab");
print "done.\n";
} else {
print "FAILED!\n";
Reply to: