diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2013-08-16 16:46:00 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2013-08-16 16:46:00 +0100 |
commit | e8d0ce66b7e4929117c8429601db325f840d088b (patch) | |
tree | d2046075a60af72770d67891d2d8dd4159aa3695 | |
parent | 12dc1b71aa58bd4d044077b4f921580cedb0c347 (diff) |
archive-query config
-rwxr-xr-x | dgit | 30 | ||||
-rw-r--r-- | dgit.1 | 2 |
2 files changed, 22 insertions, 10 deletions
@@ -156,10 +156,14 @@ sub cfg { return undef; } +sub access_distro () { + return cfg("dgit-suite.$suite.distro", + "dgit.default.distro"); +} + sub access_cfg ($) { my ($key) = @_; - my $distro = cfg("dgit-suite.$suite.distro", - "dgit.default.distro"); + my $distro = access_distro(); my $value = cfg("dgit-distro.$distro.$key", "dgit.default.$key"); return $value; @@ -199,8 +203,14 @@ sub parsechangelog { our $rmad; -sub askmadison () { - $rmad ||= cmdoutput qw(rmadison -asource),"-s$suite",$package; +sub archive_query () { + my $query = access_cfg('archive-query'); + $query ||= "madison:".access_distro(); + $query =~ s/^(\w+):// or die "$query ?"; + my $proto = $1; + my $url = $'; #'; + die unless $proto eq 'madison'; + $rmad ||= cmdoutput qw(rmadison -asource),"-s$suite","-u$url",$package; $rmad =~ m/^ \s*( [^ \t|]+ )\s* \| \s*( [^ \t|]+ )\s* \| \s*( [^ \t|]+ )\s* \| @@ -213,19 +223,19 @@ sub askmadison () { $suite = $3; } $4 eq 'source' or die "$rmad ?"; - return $vsn; + my $prefix = substr($package, 0, $package =~ m/^l/ ? 4 : 1); + my $subpath = "/pool/main/$prefix/$package/${package}_$vsn.dsc"; + return ($vsn,$subpath); } sub canonicalise_suite () { - askmadison(); + archive_query(); } sub get_archive_dsc () { - my $vsn = askmadison(); + my ($vsn,$subpath) = archive_query(); # fixme madison does not show us the component - my $prefix = substr($package, 0, $package =~ m/^l/ ? 4 : 1); - $dscurl = access_cfg('mirror'). - "/pool/main/$prefix/$package/${package}_$vsn.dsc"; + $dscurl = access_cfg('mirror').$subpath; $dscdata = url_get($dscurl); my $dscfh = new IO::File \$dscdata, '<' or die $!; print DEBUG Dumper($dscdata); @@ -162,6 +162,8 @@ on the dgit command line. .TP .BI dgit-distro. distro .mirror .TP +.BI dgit-distro. distro .archive-query +.TP .BI dgit-distro. distro .ssh .TP .BR dgit.default. * |