Browse Source

don't lock dpkg in update commands

The update command acquires a lock on lists/, but at the end it will
also require the dpkg/lock while building the binary caches. That seems
rather pointless as we are only reading those files, not causing writing
in them. This can also cause problems if a package installation is
running and a background process (like cron) starts an update: If you
are "lucky" enough the update process will pick the dpkg lock in between
apt calls causing the installation process to fail.
tags/debian/1.4_rc1
David Kalnischkies 4 years ago
parent
commit
0d9081598a
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      apt-private/private-update.cc

+ 2
- 2
apt-private/private-update.cc View File

@@ -76,14 +76,14 @@ bool DoUpdate(CommandLine &CmdL)

// Rebuild the cache.
pkgCacheFile::RemoveCaches();
if (Cache.BuildCaches() == false)
if (Cache.BuildCaches(false) == false)
return false;

// show basic stats (if the user whishes)
if (_config->FindB("APT::Cmd::Show-Update-Stats", false) == true)
{
int upgradable = 0;
if (Cache.Open() == false)
if (Cache.Open(false) == false)
return false;
for (pkgCache::PkgIterator I = Cache->PkgBegin(); I.end() != true; ++I)
{


Loading…
Cancel
Save