chiark / gitweb /
support non-main
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 16 Aug 2013 18:13:11 +0000 (19:13 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 16 Aug 2013 18:13:11 +0000 (19:13 +0100)
dgit
dgit.1

diff --git a/dgit b/dgit
index 3bfdfc46b3c53f4e98ad77f7e9d4614ffab0720a..c353b8e2fd774db2bdcf1046b3afd6ac1b4e5af6 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -134,6 +134,7 @@ sub runcmd_ordryrun {
 
 our %defcfg = ('dgit.default.distro' => 'debian',
               'dgit.default.username' => '',
+              'dgit.default.archive-query-default-component' => 'main',
               'dgit.default.ssh' => 'ssh',
               'dgit-distro.debian.git-host' => 'git.debian.org',
               'dgit-distro.debian.git-proto' => 'git+ssh://',
@@ -216,10 +217,10 @@ sub archive_query () {
     my $url = $'; #';
     die unless $proto eq 'madison';
     $rmad ||= cmdoutput qw(rmadison -asource),"-s$suite","-u$url",$package;
-    $rmad =~ m/^ \s*( [^ \t|]+ )\s* \|
+    $rmad =~ m{^ \s*( [^ \t|]+ )\s* \|
                  \s*( [^ \t|]+ )\s* \|
-                 \s*( [^ \t|]+ )\s* \|
-                 \s*( [^ \t|]+ )\s* /x or die "$rmad $?";
+                 \s*( [^ \t|/]+ )(?:/([^ \t|/]+)) \s* \|
+                 \s*( [^ \t|]+ )\s* }x or die "$rmad $?";
     $1 eq $package or die "$rmad $package ?";
     my $vsn = $2;
     if ($suite ne $3) {
@@ -227,9 +228,15 @@ sub archive_query () {
        print "canonical suite name for $suite is $3\n";
        $suite = $3;
     }
-    $4 eq 'source' or die "$rmad ?";
+    my $component;
+    if (defined $4) {
+       $component = $4;
+    } else {
+       $component = access_cfg('archive-query-default-component');
+    }
+    $5 eq 'source' or die "$rmad ?";
     my $prefix = substr($package, 0, $package =~ m/^l/ ? 4 : 1);
-    my $subpath = "/pool/main/$prefix/$package/${package}_$vsn.dsc";
+    my $subpath = "/pool/$component/$prefix/$package/${package}_$vsn.dsc";
     return ($vsn,$subpath);
 }
 
diff --git a/dgit.1 b/dgit.1
index f949d074a764012754788ef728b4059f83ef14fe..a226350cf7940b82060b79b19d5d36946ab576a7 100644 (file)
--- a/dgit.1
+++ b/dgit.1
@@ -166,19 +166,14 @@ on the dgit command line.
 .TP
 .BI dgit-distro. distro .archive-query
 .TP
+.BI dgit-distro. distro .archive-query-default-component
+.TP
 .BI dgit-distro. distro .ssh
 .TP
 .BR dgit.default. *
 for each
 .BR dgit-distro. \fIdistro\fR . *
 .SH BUGS
-dgit will only work with packages in main. The madison http query API
-does not give the component.
-
-dgit assumes knowledge of the archive layout.  There appears to be no
-sane way to find the path in the archive pool of the .dsc for a
-particular suite.
-
 We should be using some kind of vhost/vpath setup for the git repos on
 alioth, so that they can be moved later if and when this turns out to
 be a good idea.
@@ -221,5 +216,10 @@ line numbers in dgit.
 
 The option parser requires values to be cuddled to the option name.
 
+dgit assumes knowledge of the archive layout.  There appears to be no
+sane way to find the path in the archive pool of the .dsc for a
+particular suite.  I'm assured that the archive layout is a
+`well known algorithm' by now.
+
 --dry-run often does not work with fetch, even though this is a
 logically plausible request.  (It fails, instead.)