chiark / gitweb /
Fix handling of rmadison-based and gitless distros (e.g., Ubuntu).
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 29 Oct 2014 21:56:02 +0000 (21:56 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 8 Nov 2014 16:16:57 +0000 (16:16 +0000)
debian/changelog
dgit

index 96f829ad249a48bff26de01eb3420ca97fb43f2d..9a3d74439c91683cf818ca0b291cc57cd0de86a5 100644 (file)
@@ -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.
 
   * 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).
 
   * Distro access configuration handling changes (should not be noticeable
     to most users).
 
diff --git a/dgit b/dgit
index fa09ca35be8f536a5a31093a5dbd611e29c00b72..8d4588fc3f93aea9baeb0dd4a58aaa23b047d9c6 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -745,20 +745,21 @@ sub pool_dsc_subpath ($$) {
     return "/pool/$component/$prefix/$package/".dscfn($vsn);
 }
 
     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) {
     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;
        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* \|
     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;
 }
 
     return sort { -version_compare($a->[0],$b->[0]); } @out;
 }
 
-sub canonicalise_suite_madison ($$) {
+sub canonicalise_suite_madison {
     # madison canonicalises for us
     # 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;".
     @r or fail
        "unable to canonicalise suite using package $package".
        " which does not appear to exist in suite $isuite;".