diff options
author | Otavio Salvador <otavio@debian.org> | 2005-03-23 21:01:54 +0000 |
---|---|---|
committer | Otavio Salvador <otavio@debian.org> | 2005-03-23 21:01:54 +0000 |
commit | a52f938bcf7f31d348c6ce1d462a8ce14a38b8cc (patch) | |
tree | b287d522de4385886df155edb56d8b92fb69e440 /cmdline/apt-get.cc | |
parent | 92c3292594a26f8ba248300dc91d8c855f008e13 (diff) |
Port DDTP to APT 0.6 branch
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r-- | cmdline/apt-get.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index cdefd0034..591e0ff1a 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1380,6 +1380,15 @@ bool DoUpgrade(CommandLine &CmdL) /* Install named packages */ bool DoInstall(CommandLine &CmdL) { + // Lock the list directory + FileFd Lock; + if (_config->FindB("Debug::NoLocking",false) == false) + { + Lock.Fd(GetLock(_config->FindDir("Dir::State::Lists") + "lock")); + if (_error->PendingError() == true) + return _error->Error(_("Unable to lock the list directory")); + } + CacheFile Cache; if (Cache.OpenForInstall() == false || Cache.CheckDeps(CmdL.FileSize() != 1) == false) @@ -1580,8 +1589,8 @@ bool DoInstall(CommandLine &CmdL) { pkgCache::PkgIterator I(Cache,Cache.List[J]); - /* Just look at the ones we want to install */ - if ((*Cache)[I].Install() == false) + /* Just look at the ones we want to install but skip all already selected */ + if ((*Cache)[I].Install() == false || (*Cache)[I].NewInstall() == true) continue; for (pkgCache::VerIterator V = I.VersionList(); V.end() == false; V++) |