Browse Source

support optional PulseInterval in ListUpdate

tags/debian/0.7.21
Michael Vogt 14 years ago
parent
commit
dabe757a0a
2 changed files with 12 additions and 4 deletions
  1. +11
    -3
      apt-pkg/cachefile.cc
  2. +1
    -1
      apt-pkg/cachefile.h

+ 11
- 3
apt-pkg/cachefile.cc View File

@@ -114,8 +114,11 @@ bool pkgCacheFile::Open(OpProgress &Progress,bool WithLock)
/* This is a simple wrapper to update the cache. it will fetch stuff
* from the network (or any other sources defined in sources.list)
*/
bool pkgCacheFile::ListUpdate(pkgAcquireStatus &Stat, pkgSourceList &List)
bool pkgCacheFile::ListUpdate(pkgAcquireStatus &Stat,
pkgSourceList &List,
int PulseInterval)
{
pkgAcquire::RunResult res;
pkgAcquire Fetcher(&Stat);

// Populate it with the source selection
@@ -125,8 +128,13 @@ bool pkgCacheFile::ListUpdate(pkgAcquireStatus &Stat, pkgSourceList &List)
// Run scripts
RunScripts("APT::Update::Pre-Invoke");
// Run it
if (Fetcher.Run() == pkgAcquire::Failed)
// check arguments
if(PulseInterval>0)
res = Fetcher.Run(PulseInterval);
else
res = Fetcher.Run();

if (res == pkgAcquire::Failed)
return false;

bool Failed = false;


+ 1
- 1
apt-pkg/cachefile.h View File

@@ -47,7 +47,7 @@ class pkgCacheFile

bool BuildCaches(OpProgress &Progress,bool WithLock = true);
bool Open(OpProgress &Progress,bool WithLock = true);
bool ListUpdate(pkgAcquireStatus &progress, pkgSourceList &List);
bool ListUpdate(pkgAcquireStatus &progress, pkgSourceList &List, int PulseInterval=0);
void Close();
pkgCacheFile();


Loading…
Cancel
Save