]> git.saurik.com Git - apt.git/commitdiff
if there is only deb-src pick higest version in deb-src release matching
authorMichael Vogt <mvo@debian.org>
Tue, 10 Dec 2013 15:35:44 +0000 (16:35 +0100)
committerMichael Vogt <mvo@debian.org>
Tue, 10 Dec 2013 15:37:16 +0000 (16:37 +0100)
cmdline/apt-get.cc
test/integration/test-apt-get-source

index 7e59f3d6792c6a6dd7c2a34dcb65c6e8e759b7ff..3853f94c235581f8484b12ab853b2dc4735e9892 100644 (file)
@@ -337,11 +337,9 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
 
             if (Rel == RelTag)
             {
-               ioprintf(c1out, "Selectied version '%s' (%s) for %s\n", 
-                        Ver.c_str(), RelTag.c_str(), Src.c_str());
                Last = Parse;
                Offset = Parse->Offset();
-               break;
+               Version = Ver;
             }
          }
 
@@ -362,6 +360,10 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
          if (VerTag.empty() == false && (VerTag == Ver))
            break;
       }
+      if (Version != "" && RelTag != "")
+         ioprintf(c1out, "Selectied version '%s' (%s) for %s\n", 
+                  Version.c_str(), RelTag.c_str(), Src.c_str());
+
       if (Last != 0 || VerTag.empty() == true)
         break;
       _error->Error(_("Ignore unavailable version '%s' of package '%s'"), VerTag.c_str(), TmpSrc.c_str());
index 5bef781f1f3135df3c865ccec237f7875e905dc3..6bca221455c831350a5ba8b9bce004b700f39107 100755 (executable)
@@ -15,10 +15,14 @@ insertpackage 'wheezy' 'unreleated-package' 'all' '1.0'
 insertpackage 'unstable' 'foo' 'all' '2.0'
 insertsource 'unstable' 'foo' 'all' '2.0'
 
+# its possible to have multiple src versions in the sources file, do not break
+# in this case (bts #731853)
+insertsource 'stable' 'foo' 'all' '1.5'
 insertpackage 'stable' 'foo' 'all' '1.0'
 insertsource 'stable' 'foo' 'all' '1.0'
 
-# this package exists only as source
+# this packages exists only as source
+insertsource 'wheezy' 'foo' 'all' '0.0.1'
 insertsource 'wheezy' 'foo' 'all' '0.1'
 
 setupaptarchive
@@ -46,7 +50,8 @@ Need to get 0 B of source archives.
 'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
 'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo=1.0
 
-# select by release with no binary package (Bug#731102)
+# select by release with no binary package (Bug#731102) but ensure to get
+# higest version
 testequal "$HEADER
 Selectied version '0.1' (wheezy) for foo
 Need to get 0 B of source archives.