]> git.saurik.com Git - apt.git/commitdiff
Use a APT::VersionSet instead of a VersionList
authorMichael Vogt <mvo@debian.org>
Wed, 12 Feb 2014 06:59:07 +0000 (07:59 +0100)
committerMichael Vogt <mvo@debian.org>
Wed, 12 Feb 2014 06:59:07 +0000 (07:59 +0100)
Use a APT::VersionSet instead of a APT::VersionList in DoDownload()
to ensure that there is only one version in the set even if the
user passes multiple identical name/versions on the commandline
(Bug#738103)

cmdline/apt-get.cc
test/integration/test-apt-get-download

index 1019ff3250c55ff90cde11e9e862d3e86761a897..4d609104ceb252eae31be4c1335a3b079d80fc10 100644 (file)
@@ -630,8 +630,8 @@ bool DoDownload(CommandLine &CmdL)
       return false;
 
    APT::CacheSetHelper helper(c0out);
-   APT::VersionList verset = APT::VersionList::FromCommandLine(Cache,
-               CmdL.FileList + 1, APT::VersionList::CANDIDATE, helper);
+   APT::VersionSet verset = APT::VersionSet::FromCommandLine(Cache,
+               CmdL.FileList + 1, APT::VersionSet::CANDIDATE, helper);
 
    if (verset.empty() == true)
       return false;
@@ -650,7 +650,7 @@ bool DoDownload(CommandLine &CmdL)
    std::string const cwd = SafeGetCWD();
    _config->Set("Dir::Cache::Archives", cwd);
    int i = 0;
-   for (APT::VersionList::const_iterator Ver = verset.begin();
+   for (APT::VersionSet::const_iterator Ver = verset.begin();
         Ver != verset.end(); ++Ver, ++i)
    {
       pkgAcquire::Item *I = new pkgAcqArchive(&Fetcher, SrcList, &Recs, *Ver, storefile[i]);
index c2a5c3d8eb263aae1fa46a17ecece5a844027612..0d92283f1450f1b7d8c1c9755109d1e1aff7cbe6 100755 (executable)
@@ -39,3 +39,8 @@ aptget download apt
 aptget download apt
 testsuccess test -s apt_2.0_all.deb
 rm -f apt_1.0_all.deb
+
+# deb:738103 - apt-get download foo foo fails
+rm -f apt_*.deb
+aptget download apt apt
+testsuccess test -s apt_2.0_all.deb