diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2008-01-18 16:57:57 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2008-01-18 16:57:57 +0100 |
| commit | abfffe610b0f5256117a6af165ee182bbc60b6a5 (patch) | |
| tree | bd58c4a267e6e3fb677e76d06c8a13fa3451119c /apt/cache.py | |
| parent | 46298fbf3cb7ff1e7cae23c0f4de227979add160 (diff) | |
| parent | dbf6dd4e8d576eb8516b11e8d8861113bf4dfc52 (diff) | |
| download | python-apt-abfffe610b0f5256117a6af165ee182bbc60b6a5.tar.gz | |
* use the new apt 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) |
