chiark / gitweb /
Move defaulting out of archive_query into individual methods and the actual default...
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 29 Oct 2014 18:29:32 +0000 (18:29 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 8 Nov 2014 16:16:57 +0000 (16:16 +0000)
debian/changelog
dgit

index a00153e2af4eb30aaa923c87fbaf7cf7e6de32eb..96f829ad249a48bff26de01eb3420ca97fb43f2d 100644 (file)
@@ -9,6 +9,9 @@ dgit (0.23~) unstable; urgency=low
   * Replace many calls to stat with new wrapper stat_exists; improves
     error handling and simplifies the code.
 
   * Replace many calls to stat with new wrapper stat_exists; improves
     error handling and simplifies the code.
 
+  * Distro access configuration handling changes (should not be noticeable
+    to most users).
+
  --
 
 dgit (0.22.1) unstable; urgency=high
  --
 
 dgit (0.22.1) unstable; urgency=high
diff --git a/dgit b/dgit
index 41a7fe2f466c430cbbcb74b759aff74fa57f13c8..25afa6734dfebd9a692c524954a537e2b847dfcc 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -516,13 +516,15 @@ our %defcfg = ('dgit.default.distro' => 'debian',
               'dgit.default.username' => '',
               'dgit.default.archive-query-default-component' => 'main',
               'dgit.default.ssh' => 'ssh',
               'dgit.default.username' => '',
               'dgit.default.archive-query-default-component' => 'main',
               'dgit.default.ssh' => 'ssh',
+              'dgit.default.archive-query' => 'madison:',
+              'dgit.default.sshpsql-dbname' => 'service=projectb',
+              'dgit-distro.debian.archive-query' => 'sshpsql:',
               'dgit-distro.debian.git-host' => 'git.debian.org',
               'dgit-distro.debian.git-proto' => 'git+ssh://',
               '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' => 'mirror.ftp-master.debian.org',
               'dgit-distro.debian.git-host' => 'git.debian.org',
               'dgit-distro.debian.git-proto' => 'git+ssh://',
               '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' => '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/',
  'dgit-distro.debian.backports-quirk' => '(squeeze)-backports*',
               'dgit-distro.debian.upload-host' => 'ftp-master', # for dput
               'dgit-distro.debian.mirror' => 'http://ftp.debian.org/debian/',
  'dgit-distro.debian.backports-quirk' => '(squeeze)-backports*',
@@ -728,16 +730,6 @@ our %rmad;
 sub archive_query ($) {
     my ($method) = @_;
     my $query = access_cfg('archive-query','RETURN-UNDEF');
 sub archive_query ($) {
     my ($method) = @_;
     my $query = access_cfg('archive-query','RETURN-UNDEF');
-    if (!defined $query) {
-       my $distro = access_basedistro();
-       if ($distro eq 'debian') {
-           $query = "sshpsql:".
-               access_someuserhost('sshpsql').':'.
-               access_cfg('sshpsql-dbname');
-       } else {
-           $query = "madison:$distro";
-       }
-    }
     $query =~ s/^(\w+):// or badcfg "invalid archive-query method \`$query'";
     my $proto = $1;
     my $data = $'; #';
     $query =~ s/^(\w+):// or badcfg "invalid archive-query method \`$query'";
     my $proto = $1;
     my $data = $'; #';
@@ -753,6 +745,9 @@ sub pool_dsc_subpath ($$) {
 sub archive_query_madison ($$) {
     my ($proto,$data) = @_;
     die unless $proto eq 'madison';
 sub archive_query_madison ($$) {
     my ($proto,$data) = @_;
     die unless $proto eq 'madison';
+    if (!length $data) {
+       $data= access_cfg('madison-distro',access_basedistro());
+    }
     $rmad{$package} ||= cmdoutput
        qw(rmadison -asource),"-s$isuite","-u$data",$package;
     my $rmad = $rmad{$package};
     $rmad{$package} ||= cmdoutput
        qw(rmadison -asource),"-s$isuite","-u$data",$package;
     my $rmad = $rmad{$package};
@@ -794,6 +789,10 @@ sub canonicalise_suite_madison ($$) {
 
 sub sshpsql ($$) {
     my ($data,$sql) = @_;
 
 sub sshpsql ($$) {
     my ($data,$sql) = @_;
+    if (!length $data) {
+       $data= access_someuserhost('sshpsql').':'.
+           access_cfg('sshpsql-dbname');
+    }
     $data =~ m/:/ or badcfg "invalid sshpsql method string \`$data'";
     my ($userhost,$dbname) = ($`,$'); #';
     my @rows;
     $data =~ m/:/ or badcfg "invalid sshpsql method string \`$data'";
     my ($userhost,$dbname) = ($`,$'); #';
     my @rows;