|
|
@@ -42,6 +42,8 @@ sub init_options {
|
|
|
my ($self) = @_;
|
|
|
$self->{'options'}{'single-debian-patch'} = 0
|
|
|
unless exists $self->{'options'}{'single-debian-patch'};
|
|
|
+ $self->{'options'}{'allow-version-of-quilt-db'} = []
|
|
|
+ unless exists $self->{'options'}{'allow-version-of-quilt-db'};
|
|
|
|
|
|
$self->SUPER::init_options();
|
|
|
}
|
|
|
@@ -52,6 +54,9 @@ sub parse_cmdline_option {
|
|
|
if ($opt =~ /^--single-debian-patch$/) {
|
|
|
$self->{'options'}{'single-debian-patch'} = 1;
|
|
|
return 1;
|
|
|
+ } elsif ($opt =~ /^--allow-version-of-quilt-db=(.*)$/) {
|
|
|
+ push @{$self->{'options'}{'allow-version-of-quilt-db'}}, $1;
|
|
|
+ return 1;
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -216,6 +221,29 @@ sub prepare_build {
|
|
|
$self->{'diff_options'}{'diff_ignore_func'} = $func;
|
|
|
}
|
|
|
|
|
|
+sub do_build {
|
|
|
+ my ($self, $dir) = @_;
|
|
|
+ my $pc_ver = File::Spec->catfile($dir, ".pc", ".version");
|
|
|
+ if (-f $pc_ver) {
|
|
|
+ open(VER, "<", $pc_ver) || syserr(_g("cannot read %s"), $pc_ver);
|
|
|
+ my $version = <VER>;
|
|
|
+ chomp $version;
|
|
|
+ close(VER);
|
|
|
+ if ($version != 2) {
|
|
|
+ if (scalar grep { $version eq $_ }
|
|
|
+ @{$self->{'options'}{'allow-version-of-quilt-db'}})
|
|
|
+ {
|
|
|
+ warning(_g("unsupported version of the quilt metadata: %s"),
|
|
|
+ $version);
|
|
|
+ } else {
|
|
|
+ error(_g("unsupported version of the quilt metadata: %s"),
|
|
|
+ $version);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $self->SUPER::do_build($dir);
|
|
|
+}
|
|
|
+
|
|
|
sub check_patches_applied {
|
|
|
my ($self, $dir) = @_;
|
|
|
my $pc_applied = File::Spec->catfile($dir, ".pc", "applied-patches");
|