chiark / gitweb /
configurable mirror
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 0818e371e79885dee6f1828ce19ba77cdd06dfac..23c5f812a50a7411e8664155f7dea09f1c41fec1 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -26,7 +26,6 @@ use Dpkg::Control::Hash;
 use File::Path;
 use POSIX;
 
-our $mirror = 'http://mirror.relativity.greenend.org.uk/mirror/debian-ftp/';
 our $suite = 'sid';
 our $package;
 
@@ -139,11 +138,12 @@ our %defcfg = ('dgit.default.distro' => 'debian',
               'dgit-distro.debian.git-proto' => 'git+ssh://',
               'dgit-distro.debian.git-path' => '/git/dgit-repos',
               'dgit-distro.debian.git-check' => 'ssh-cmd',
-              'dgit-distro.debian.git-create' => 'ssh-cmd');
+              'dgit-distro.debian.git-create' => 'ssh-cmd',
+              'dgit-distro.debian.mirror' => 'http://ftp.debian.org/debian/');
 
 sub cfg {
     foreach my $c (@_) {
-       my $v = cmdoutput_errok(qw(git config --), $c);
+       my $v = cmdoutput_errok(@git, qw(config --), $c);
        if ($?==0) {
            chomp $v;
            return $v;
@@ -224,7 +224,8 @@ sub get_archive_dsc () {
     my $vsn = askmadison();
     # fixme madison does not show us the component
     my $prefix = substr($package, 0, $package =~ m/^l/ ? 4 : 1);
-    $dscurl = "$mirror/pool/main/$prefix/$package/${package}_$vsn.dsc";
+    $dscurl = access_cfg('mirror').
+       "/pool/main/$prefix/$package/${package}_$vsn.dsc";
     $dscdata = url_get($dscurl);
     my $dscfh = new IO::File \$dscdata, '<' or die $!;
     print DEBUG Dumper($dscdata);
@@ -542,7 +543,9 @@ sub dopush () {
        runcmd_ordryrun @debsign_cmd;
     }
     runcmd_ordryrun @git, qw(push),access_giturl(),"refs/tags/$tag";
-    runcmd_ordryrun @dput, $changesfile;
+    my $host = access_cfg('upload-host');
+    my @hostarg = defined($host) ? ($host,) : ();
+    runcmd_ordryrun @dput, @hostarg, $changesfile;
 }
 
 sub cmd_clone {
@@ -654,7 +657,7 @@ sub parseopts () {
                } elsif (s/^-D/-/) {
                    open DEBUG, ">&STDERR" or die $!;
                } elsif (s/^-c(.*=.*)//s) {
-                   push @git, $1;
+                   push @git, '-c', $1;
                } elsif (s/^-C(.*)//s) {
                    $changesfile = $1;
                } elsif (s/^-k(.*)//s) {