From: David Kalnischkies Date: Fri, 14 May 2010 10:12:23 +0000 (+0200) Subject: handle multiple --{tar,diff,dsc}-only options correctly X-Git-Tag: 0.8.0~9^2~46^2~8 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/8545b536e3459a06fa007e2c307a77188e5de4b1?ds=inline;hp=-c handle multiple --{tar,diff,dsc}-only options correctly --- 8545b536e3459a06fa007e2c307a77188e5de4b1 diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 00da0855f..dd5ef1743 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2271,6 +2271,14 @@ bool DoSource(CommandLine &CmdL) // insert all downloaded uris into this set to avoid downloading them // twice set queued; + + // Diff only mode only fetches .diff files + bool const diffOnly = _config->FindB("APT::Get::Diff-Only", false); + // Tar only mode only fetches .tar files + bool const tarOnly = _config->FindB("APT::Get::Tar-Only", false); + // Dsc only mode only fetches .dsc files + bool const dscOnly = _config->FindB("APT::Get::Dsc-Only", false); + // Load the requestd sources into the fetcher unsigned J = 0; for (const char **I = CmdL.FileList + 1; *I != 0; I++, J++) @@ -2297,21 +2305,17 @@ bool DoSource(CommandLine &CmdL) Dsc[J].Version = Last->Version(); Dsc[J].Dsc = flNotDir(I->Path); } - - // Diff only mode only fetches .diff files - if (_config->FindB("APT::Get::Diff-Only",false) == true && - I->Type != "diff") - continue; - - // Tar only mode only fetches .tar files - if (_config->FindB("APT::Get::Tar-Only",false) == true && - I->Type != "tar") - continue; - // Dsc only mode only fetches .dsc files - if (_config->FindB("APT::Get::Dsc-Only",false) == true && - I->Type != "dsc") - continue; + // Handle the only options so that multiple can be used at once + if (diffOnly == true || tarOnly == true || dscOnly == true) + { + if ((diffOnly == true && I->Type == "diff") || + (tarOnly == true && I->Type == "tar") || + (dscOnly == true && I->Type == "dsc")) + ; // Fine, we want this file downloaded + else + continue; + } // don't download the same uri twice (should this be moved to // the fetcher interface itself?) diff --git a/debian/changelog b/debian/changelog index 2ad9fbdd2..cb0bd6aa9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ apt (0.7.26~exp5) UNRELEASED; urgency=low * cmdline/apt-get.cc: - rerun dpkg-source in source if --fix-broken is given (Closes: #576752) - don't suggest held packages as they are installed (Closes: #578135) + - handle multiple --{tar,diff,dsc}-only options correctly * cmdline/apt-cache.cc: - use GroupCount for package names in stats and add a package struct line * methods/rred.cc: