diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2008-01-04 21:31:32 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2008-01-04 21:31:32 +0100 |
| commit | 7760b4a0ee334ff04a60086d06548d6bda6d55d9 (patch) | |
| tree | 5d0f64a1940e996d51b5ae59bf93b3cf30af73ec /apt/cache.py | |
| parent | 9561c3ddd5f14103ca96042c465586479c75c02d (diff) | |
| download | python-apt-7760b4a0ee334ff04a60086d06548d6bda6d55d9.tar.gz | |
* use the new CacheFile::ListUpdate() code
* add example in doc/examples/update.py
Diffstat (limited to 'apt/cache.py')
| -rw-r--r-- | apt/cache.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/apt/cache.py b/apt/cache.py index 65f3c9d9..dc2f5522 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -166,6 +166,7 @@ class Cache(object): os.close(lock) def update(self, fetchProgress=None): + " run the equivalent of apt-get update " lockfile = apt_pkg.Config.FindDir("Dir::State::Lists") + "lock" lock = apt_pkg.GetLock(lockfile) if lock < 0: @@ -174,14 +175,7 @@ class Cache(object): try: if fetchProgress == None: fetchProgress = apt.progress.FetchProgress() - fetcher = apt_pkg.GetAcquire(fetchProgress) - # this can throw a exception - self._list.GetIndexes(fetcher) - # now run the fetcher, throw exception if something fails to be - # fetched - if self._runFetcher(fetcher) == fetcher.ResultContinue: - return True - return False + return self._cache.Update(fetchProgress, self._list) finally: os.close(lock) |
