summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-09-18 08:53:58 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2009-09-18 08:53:58 +0200
commit2b120e26a62d75fc882ed1d9d9e3566037e10157 (patch)
tree7d5eaf7e76d1ba4b4ad5c44eef2fcc93ef5192e1
parent7acb16fc4baa43cf2cbbc4de948973bdc099d878 (diff)
parentbe85eeaeadf8b93021413ab7ed79e639b65102a6 (diff)
downloadpython-apt-2b120e26a62d75fc882ed1d9d9e3566037e10157.tar.gz
merged from debian
-rw-r--r--apt/cache.py11
-rw-r--r--apt/package.py7
-rw-r--r--apt/progress/__init__.py4
-rw-r--r--debian/changelog10
4 files changed, 23 insertions, 9 deletions
diff --git a/apt/cache.py b/apt/cache.py
index bb944041..fa6c404c 100644
--- a/apt/cache.py
+++ b/apt/cache.py
@@ -270,7 +270,7 @@ class Cache(object):
providers.append(pkg)
return providers
- def update(self, fetchProgress=None, pulseInterval=0):
+ def update(self, fetchProgress=None, pulseInterval=0, raiseOnError=False):
" run the equivalent of apt-get update "
lockfile = apt_pkg.Config.FindDir("Dir::State::Lists") + "lock"
lock = apt_pkg.GetLock(lockfile)
@@ -280,7 +280,14 @@ class Cache(object):
try:
if fetchProgress is None:
fetchProgress = apt.progress.FetchProgress()
- return self._cache.Update(fetchProgress, self._list, pulseInterval)
+ res = self._cache.Update(fetchProgress, self._list, pulseInterval)
+
+ if res == 2 and raiseOnError:
+ raise FetchCancelledException()
+ elif res == 1 and raiseOnError:
+ raise FetchFailedException()
+ else:
+ return res
finally:
os.close(lock)
diff --git a/apt/package.py b/apt/package.py
index 27e0dc90..6a85d2b5 100644
--- a/apt/package.py
+++ b/apt/package.py
@@ -478,10 +478,11 @@ class Version(object):
acq = apt_pkg.GetAcquire(progress or apt.progress.TextFetchProgress())
dsc = None
- src.Lookup(self.package.name)
+ record = self._records
+ src.Lookup(record.SourcePkg)
try:
- while self.version != src.Version:
- src.Lookup(self.package.name)
+ while record.SourceVer != src.Version:
+ src.Lookup(record.SourcePkg)
except AttributeError:
raise ValueError("No source for %r" % self)
for md5, size, path, type in src.Files:
diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py
index ca60810f..8a9eb86f 100644
--- a/apt/progress/__init__.py
+++ b/apt/progress/__init__.py
@@ -301,10 +301,10 @@ class InstallProgress(DumbInstallProgress):
if pid == self.child_pid:
break
except OSError, (errno_, errstr):
- if errno_ != errno.EINTR:
- raise
if errno_ == errno.ECHILD:
break
+ if errno_ != errno.EINTR:
+ raise
return res
def run(self, pm):
diff --git a/debian/changelog b/debian/changelog
index 3f23a368..e22014a3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-python-apt (0.7.13.3) UNRELEASED; urgency=low
+python-apt (0.7.13.3) unstable; urgency=low
[ Michael Vogt ]
* apt/cache.py:
@@ -16,8 +16,14 @@ python-apt (0.7.13.3) UNRELEASED; urgency=low
* python/depcache.cc:
- Make ActionGroups context managers so apt.Cache.actiongroup() has
the same behavior as in 0.7.92
+ * apt/cache.py:
+ - Add raiseOnError option to Cache.update() (Closes: #545474)
+ * apt/package.py:
+ - Use the source version instead of the binary version in fetch_source().
+ * apt/progress/__init__.py:
+ - Correctly ignore ECHILD by checking before EINTR (Closes: #546007)
- -- Julian Andres Klode <jak@debian.org> Mon, 24 Aug 2009 15:43:00 +0200
+ -- Julian Andres Klode <jak@debian.org> Tue, 15 Sep 2009 15:18:45 +0200
python-apt (0.7.13.2) unstable; urgency=low