summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-11-06 18:21:50 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-11-06 18:21:50 +0000
commite28f906f107c69d18d68f47538077c868cc1e77c (patch)
tree3cd359150e20eaa85d098a9bde0ef43c21252516
parent00be23b629b1a1dd04cfa1c9d10a778d30d904b6 (diff)
dgit: Introduce archive_query_prepend_mirror
Now the archive_query functions return urls, not subpaths. No overall functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-xdgit19
1 files changed, 13 insertions, 6 deletions
diff --git a/dgit b/dgit
index bdd6841..11ca5f5 100755
--- a/dgit
+++ b/dgit
@@ -986,6 +986,11 @@ sub archive_query ($;@) {
{ no strict qw(refs); &{"${method}_${proto}"}($proto,$data,@_); }
}
+sub archive_query_prepend_mirror {
+ my $m = access_cfg('mirror');
+ return map { [ $_->[0], $m.$_->[1], @$_[2..$#$_] ] } @_;
+}
+
sub pool_dsc_subpath ($$) {
my ($vsn,$component) = @_; # $package is implict arg
my $prefix = substr($package, 0, $package =~ m/^l/ ? 4 : 1);
@@ -1092,7 +1097,7 @@ sub archive_query_ftpmasterapi {
if length $@;
}
@rows = sort { -version_compare($a->[0],$b->[0]) } @rows;
- return @rows;
+ return archive_query_prepend_mirror @rows;
}
sub file_in_archive_ftpmasterapi {
@@ -1134,7 +1139,8 @@ sub file_in_archive_dummycatapi ($$$) {
#---------- `madison' archive query method ----------
sub archive_query_madison {
- return map { [ @$_[0..1] ] } madison_get_parse(@_);
+ return archive_query_prepend_mirror
+ map { [ @$_[0..1] ] } madison_get_parse(@_);
}
sub madison_get_parse {
@@ -1240,7 +1246,7 @@ END
my ($vsn,$component,$filename,$sha256sum) = @$_;
[ $vsn, "/pool/$component/$filename",$digester,$sha256sum ];
} @rows;
- return @rows;
+ return archive_query_prepend_mirror @rows;
}
sub canonicalise_suite_sshpsql ($$) {
@@ -1296,7 +1302,8 @@ sub archive_query_dummycat ($$) {
}
C->error and die "$dpath: $!";
close C;
- return sort { -version_compare($a->[0],$b->[0]); } @rows;
+ return archive_query_prepend_mirror
+ sort { -version_compare($a->[0],$b->[0]); } @rows;
}
sub file_in_archive_dummycat () { return undef; }
@@ -1358,8 +1365,8 @@ sub get_archive_dsc () {
canonicalise_suite();
my @vsns = archive_query('archive_query');
foreach my $vinfo (@vsns) {
- my ($vsn,$subpath,$digester,$digest) = @$vinfo;
- $dscurl = access_cfg('mirror').$subpath;
+ my ($vsn,$vsn_dscurl,$digester,$digest) = @$vinfo;
+ $dscurl = $vsn_dscurl;
$dscdata = url_get($dscurl);
if (!$dscdata) {
$skew_warning_vsn = $vsn if !defined $skew_warning_vsn;