- my $fin = "$self->{dst}/manifest.js.gz";
- rename($fn, $fin) or die "E: rename($fn, $fin): $!";
- $ft->unlink_on_destroy(0);
+ if (my $v1 = delete $multi->{v1}) {
+ my $p = $path_pfx.$path;
+ chop($p) if substr($p, -1, 1) eq '/';
+ $uri->path($p);
+ for my $name (@$v1) {
+ local $self->{cur_src} = "$uri";
+ local $self->{cur_dst} = $self->{dst};
+ if ($n > 1) {
+ $self->{cur_dst} .= $name;
+ $self->{cur_src} .= $name;
+ }
+ index($self->{cur_dst}, "\n") >= 0 and die <<EOM;
+E: `$self->{cur_dst}' must not contain newline
+EOM
+ $self->{cur_src} .= '/';
+ clone_v1($self, 1);
+ }
+ }
+ if (delete $self->{-culled_manifest}) { # set by clone_v2
+ # write the smaller manifest if epochs were skipped so
+ # users won't have to delete manifest if they +w an
+ # epoch they no longer want to skip
+ my $json = PublicInbox::Config->json->encode($m);
+ my $mtime = (stat($fn))[9];
+ gzip(\$json => $fn) or die "gzip: $GzipError";
+ utime($mtime, $mtime, $fn) or die "utime(..., $fn): $!";
+ }
+ ft_rename($ft, "$self->{dst}/manifest.js.gz", 0666);
+ open my $x, '>', "$self->{dst}/mirror.done"; # for _wq_done_wait