[SCM] Debian package checker branch, lab-refactor, updated. 2.5.3-147-g000e7bc
The following commit has been merged in the lab-refactor branch:
commit 000e7bc70296a503928ec0ba6b4dc6105f7d8720
Author: Niels Thykier <niels@thykier.net>
Date: Thu Oct 27 12:46:18 2011 +0200
Lintian::Lab: Minor fix ups
Made create_lab do nothing if the lab already exists. Removed a
"not implemented" error that has been fixed a while ago and split
an error message for (user) clarity.
Signed-off-by: Niels Thykier <niels@thykier.net>
diff --git a/lib/Lintian/Lab.pm b/lib/Lintian/Lab.pm
index ac30fef..2753368 100644
--- a/lib/Lintian/Lab.pm
+++ b/lib/Lintian/Lab.pm
@@ -358,7 +358,6 @@ sub generate_diffs {
my @diffs;
croak "$labdir is not a valid lab (run lintian --setup-lab first?).\n"
unless $self->is_open;
- croak "Not support"; # Manifest does not support this yet
foreach my $list (@lists) {
my $type = $list->type;
my $lab_list;
@@ -399,6 +398,8 @@ croak if these does not exists.
Note: This may update the value of $lab->dir as resolving the path
requires it to exists.
+Note: This does nothing if the lab appears to already exists.
+
=cut
sub create_lab {
@@ -406,6 +407,9 @@ sub create_lab {
my $dir = $self->dir;
my $mid = 0;
my $mode = 0777;
+
+ return if $self->lab_exists;
+
$opts = {} unless $opts;
$mode = $opts->{'mode'} if exists $opts->{'mode'};
if ( !$dir or $self->{'mode'} eq LAB_MODE_TEMP) {
@@ -516,8 +520,12 @@ sub open_lab {
}
}
- croak "$msg: Lab is too old or corrupt - $dir/info/lab-info does not exists"
- unless -e "$dir/info/lab-info";
+ unless ( -e "$dir/info/lab-info") {
+ if ( $self->lab_exists ) {
+ croak "$msg: The Lab format is not supported";
+ }
+ croak "$msg: Lab is corrupt - $dir/info/lab-info does not exists";
+ }
# Check the lab-format - this ought to be redundant for temp labs, but
# it simple to do it that way.
--
Debian package checker
Reply to: