summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-05-14 12:12:23 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-05-14 12:12:23 +0200
commit8545b536e3459a06fa007e2c307a77188e5de4b1 (patch)
treedf57c13d1befae5c25d257455abf9f16e27d858a
parent10df254bd756cea401e2564d465bbb4a99ee8e9e (diff)
handle multiple --{tar,diff,dsc}-only options correctly
-rw-r--r--cmdline/apt-get.cc32
-rw-r--r--debian/changelog1
2 files changed, 19 insertions, 14 deletions
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<string> 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: