diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2014-10-29 21:56:02 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2014-11-08 16:16:57 +0000 |
commit | 3fb6b8936cb3d476f3122a04c1fa2d9a3d911b7a (patch) | |
tree | d4ce3ab1621329e9d60112138279ba512d740bb8 | |
parent | cd8d74f752554d8fdb896712225b63d9877a3c09 (diff) |
Fix handling of rmadison-based and gitless distros (e.g., Ubuntu).
-rw-r--r-- | debian/changelog | 2 | ||||
-rwxr-xr-x | dgit | 21 |
2 files changed, 13 insertions, 10 deletions
diff --git a/debian/changelog b/debian/changelog index 96f829a..9a3d744 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,8 @@ dgit (0.23~) unstable; urgency=low * Replace many calls to stat with new wrapper stat_exists; improves error handling and simplifies the code. + * Fix handling of rmadison-based and gitless distros (e.g., Ubuntu). + * Distro access configuration handling changes (should not be noticeable to most users). @@ -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;". |