From 3fb6b8936cb3d476f3122a04c1fa2d9a3d911b7a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 29 Oct 2014 21:56:02 +0000 Subject: Fix handling of rmadison-based and gitless distros (e.g., Ubuntu). --- dgit | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'dgit') diff --git a/dgit b/dgit index fa09ca3..8d4588f 100755 --- a/dgit +++ b/dgit @@ -745,20 +745,21 @@ sub pool_dsc_subpath ($$) { return "/pool/$component/$prefix/$package/".dscfn($vsn); } -sub archive_query_madison ($$) { +sub archive_query_madison { + return map { [ @$_[0..1] ] } madison_get_parse(@_); +} + +sub madison_get_parse { my ($proto,$data) = @_; die unless $proto eq 'madison'; if (!length $data) { - $data= access_cfg('madison-distro',access_basedistro()); + $data= access_cfg('madison-distro','RETURN-UNDEF'); + $data //= access_basedistro(); } - $rmad{$package} ||= cmdoutput + $rmad{$proto,$data,$package} ||= cmdoutput qw(rmadison -asource),"-s$isuite","-u$data",$package; - my $rmad = $rmad{$package}; - return madison_parse($rmad); -} + my $rmad = $rmad{$proto,$data,$package}; -sub madison_parse ($) { - my ($rmad) = @_; my @out; foreach my $l (split /\n/, $rmad) { $l =~ m{^ \s*( [^ \t|]+ )\s* \| @@ -780,9 +781,9 @@ sub madison_parse ($) { return sort { -version_compare($a->[0],$b->[0]); } @out; } -sub canonicalise_suite_madison ($$) { +sub canonicalise_suite_madison { # madison canonicalises for us - my @r = archive_query_madison($_[0],$_[1]); + my @r = madison_get_parse(@_); @r or fail "unable to canonicalise suite using package $package". " which does not appear to exist in suite $isuite;". -- cgit v1.2.3