Specifying a UIDVALIDITY value allows the user to enforce
a strict match and force failure. This necessitated changes
to NetReader to allow die() and make error reporting more
suitable for CLI usage rather than daemonized usage of -watch.
$lei->err("# --sync is not supported for: @{$sync->{no}}");
}
if ($net) {
$lei->err("# --sync is not supported for: @{$sync->{no}}");
}
if ($net) {
if (my $err = $net->errors) {
return $lei->fail($err);
}
if (my $err = $net->errors) {
return $lei->fail($err);
}
sub process_inputs {
my ($self) = @_;
sub process_inputs {
my ($self) = @_;
for my $input (@{$self->{inputs}}) {
for my $input (@{$self->{inputs}}) {
- $self->input_path_url($input);
+ eval { $self->input_path_url($input) };
+ next unless $@;
+ $err = "$input: $@";
+ last;
+ # always commit first, even on error partial work is acceptable for
+ # lei <import|tag|convert>
my $wait = $self->{lei}->{sto}->ipc_do('done') if $self->{lei}->{sto};
my $wait = $self->{lei}->{sto}->ipc_do('done') if $self->{lei}->{sto};
+ $self->{lei}->fail($err) if $err;
}
sub input_only_atfork_child {
}
sub input_only_atfork_child {
return "E: $orig_uri cannot get UIDVALIDITY";
$r_uidnext //= $mic->uidnext($mbx) //
return "E: $orig_uri cannot get UIDNEXT";
return "E: $orig_uri cannot get UIDVALIDITY";
$r_uidnext //= $mic->uidnext($mbx) //
return "E: $orig_uri cannot get UIDNEXT";
+ my $expect = $orig_uri->uidvalidity // $r_uidval;
+ return <<EOF if $expect != $r_uidval;
+E: $orig_uri UIDVALIDITY mismatch (got $r_uidval)
+EOF
+
my $uri = $orig_uri->clone;
my ($itrk, $l_uid, $l_uidval) = _itrk_last($self, $uri, $r_uidval);
return <<EOF if $l_uidval != $r_uidval;
my $uri = $orig_uri->clone;
my ($itrk, $l_uid, $l_uidval) = _itrk_last($self, $uri, $r_uidval);
return <<EOF if $l_uidval != $r_uidval;
} else {
$err = "E: <$uri> not connected: $!";
}
} else {
$err = "E: <$uri> not connected: $!";
}
+ die $err if $err && $self->{-can_die};
warn $err if $err;
$mic;
}
warn $err if $err;
$mic;
}
} else {
$err = "E: <$uri> not connected: $!";
}
} else {
$err = "E: <$uri> not connected: $!";
}
+ die $err if $err && $self->{-can_die};
warn $err if $err;
$nn;
}
warn $err if $err;
$nn;
}
lei_ok('import', $url);
lei_ok 'ls-sync';
like($lei_out, qr!\A\Q$url\E;UIDVALIDITY=\d+\n\z!, 'ls-sync');
lei_ok('import', $url);
lei_ok 'ls-sync';
like($lei_out, qr!\A\Q$url\E;UIDVALIDITY=\d+\n\z!, 'ls-sync');
+ chomp(my $u = $lei_out);
+ lei_ok('import', $u, \'UIDVALIDITY match in URL');
+ $u =~ s/;UIDVALIDITY=(\d+)\s*/;UIDVALIDITY=9$1/s;
+ ok(!lei('import', $u), 'UIDVALIDITY mismatch in URL rejected');
lei_ok('inspect', $url);
my $inspect = json_utf8->decode($lei_out);
lei_ok('inspect', $url);
my $inspect = json_utf8->decode($lei_out);