summaryrefslogtreecommitdiff
path: root/cmdline/apt-get.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-01-30 15:08:12 +0100
committerMichael Vogt <mvo@debian.org>2014-01-30 15:08:12 +0100
commit37c61d76869a50110e298b042660eb5120a282c8 (patch)
tree8acdf2275ed9e0e4584ed997d98844d3f5b3b179 /cmdline/apt-get.cc
parentacead5b93cf49ab33cba4be2ea8e1b253ed0f2bf (diff)
parent960975a175c2a21df749727162d5677cdc97a36e (diff)
Merge remote-tracking branch 'mvo/debian/sid' into ubuntu/master
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r--cmdline/apt-get.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 469e8f593..9fae8d55c 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -678,14 +678,17 @@ bool DoDownload(CommandLine &CmdL)
// copy files in local sources to the current directory
for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); ++I)
- if ((*I)->Local == true && (*I)->Status == pkgAcquire::Item::StatDone)
+ {
+ std::string const filename = cwd + flNotDir((*I)->DestFile);
+ if ((*I)->Local == true &&
+ filename != (*I)->DestFile &&
+ (*I)->Status == pkgAcquire::Item::StatDone)
{
- std::string const filename = cwd + flNotDir((*I)->DestFile);
std::ifstream src((*I)->DestFile.c_str(), std::ios::binary);
std::ofstream dst(filename.c_str(), std::ios::binary);
dst << src.rdbuf();
}
-
+ }
return Failed == false;
}
/*}}}*/