3 # Initiate a re-mirror of a project
19 undef(*CORE
::GLOBAL
::die);
20 *CORE
::GLOBAL
::die = \
&mydie
;
22 my $project = shift @ARGV || die "Please give project name on command line.";
24 my $p = Girocco
::Project
->load($project) || die "Project '$project' not found!";
27 die "Project '$project' is a push project, not a mirror project."
30 if ($p->{clone_in_progress
} && !$p->{clone_failed
}) {
31 die "Project '$project' already has a clone underway at this moment."
34 unlink($p->_clonefail_path);
35 unlink($p->_clonelog_path);
36 my $cp = $p->_clonep_path;
37 open X
, '>'.$cp or die "failed to create $cp: $!";
40 my $sock = IO
::Socket
::UNIX
->new($Girocco::Config
::chroot.'/etc/taskd.socket') or die "cannot connect to taskd.socket: $!";
41 $sock->print("clone ".$p->{name
}."\n");
42 # Just ignore reply, we are going to succeed anyway and the I/O
43 # would apparently get quite hairy.
48 print "Project '$project' remirror initiated.\n";