From: Ian Jackson Date: Wed, 29 Oct 2014 21:56:02 +0000 (+0000) Subject: Fix handling of rmadison-based and gitless distros (e.g., Ubuntu). X-Git-Tag: debian/0.30~310 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=3fb6b8936cb3d476f3122a04c1fa2d9a3d911b7a;hp=cd8d74f752554d8fdb896712225b63d9877a3c09;ds=sidebyside Fix handling of rmadison-based and gitless distros (e.g., Ubuntu). --- diff --git a/debian/changelog b/debian/changelog index 96f829ad..9a3d7443 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). diff --git a/dgit b/dgit index fa09ca35..8d4588fc 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;".