chiark / gitweb /
Do not remove destination when clone fails because it already exists (!)
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 87448742fcdfd37b1e6edd8bd1546f13c6fcaca8..d587527cb73c32c271b8d576a846bd3e5061515e 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -465,7 +465,7 @@ our %defcfg = ('dgit.default.distro' => 'debian',
               'dgit-distro.debian.git-path' => '/git/dgit-repos/repos',
               'dgit-distro.debian.git-check' => 'ssh-cmd',
               'dgit-distro.debian.git-create' => 'ssh-cmd',
-              'dgit-distro.debian.sshpsql-host' => 'coccia.debian.org',
+              'dgit-distro.debian.sshpsql-host' => 'mirror.ftp-master.debian.org',
               'dgit-distro.debian.sshpsql-dbname' => 'service=projectb',
               'dgit-distro.debian.upload-host' => 'ftp-master', # for dput
               'dgit-distro.debian.mirror' => 'http://ftp.debian.org/debian/',
@@ -1515,6 +1515,12 @@ sub cmd_clone {
     }
     $dstdir ||= "$package";
 
+    if (stat $dstdir) {
+       fail "$dstdir already exists";
+    } elsif ($! != &ENOENT) {
+       die "$dstdir: $!";
+    }
+
     my $cwd_remove;
     if ($rmonerror && !$dryrun_level) {
        $cwd_remove= getcwd();