From 7760b4a0ee334ff04a60086d06548d6bda6d55d9 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 4 Jan 2008 21:31:32 +0100 Subject: * use the new CacheFile::ListUpdate() code * add example in doc/examples/update.py --- apt/cache.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'apt/cache.py') 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) -- cgit v1.2.3