diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-07-02 16:12:13 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-07-02 16:12:13 +0200 |
| commit | 945084be45a95fe532a6669e2c85a0ba363ecfd9 (patch) | |
| tree | 58bda31ecea54100d6082b5bf501a7458c80c223 | |
| parent | 850c486cc0c96f2a36a2b405354163fe41d356e7 (diff) | |
| download | python-apt-945084be45a95fe532a6669e2c85a0ba363ecfd9.tar.gz | |
* apt/debfile.py:
- check if the debfiles provides are in conflict with the systems
packages
| -rw-r--r-- | apt/debfile.py | 13 | ||||
| -rw-r--r-- | debian/changelog | 3 |
2 files changed, 15 insertions, 1 deletions
diff --git a/apt/debfile.py b/apt/debfile.py index 3b3a8d97..173521b1 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -301,6 +301,8 @@ class DebPackage(object): size = float(len(self._cache)) steps = int(size/50) debver = self._sections["Version"] + # store what we provide so that we can later check against that + provides = [ x[0][0] for x in self.provides] for (i, pkg) in enumerate(self._cache): if i%steps == 0: self._cache.op_progress.update(float(i)/size*100.0) @@ -331,13 +333,22 @@ class DebPackage(object): if apt_pkg.check_dep(debver, c_or.comp_type, c_or.target_ver): self._dbg(2, "would break (conflicts) %s" % pkg.name) # TRANSLATORS: the first '%s' is the package that conflicts, the second the packagename that it conflicts with (so the name of the deb the user tries to install), the third is the relation (e.g. >=) and the last is the version for the relation - self._failureString += _("Breaks existing package '%(pkgname)s' conflict: %(targetpkg)s (%(comptype)s %(targetver)s)") % { + self._failure_string += _("Breaks existing package '%(pkgname)s' conflict: %(targetpkg)s (%(comptype)s %(targetver)s)") % { 'pkgname' : pkg.name, 'targetpkg' : c_or.target_pkg.name, 'comptype' : c_or.comp_type, 'targetver' : c_or.target_ver } self._cache.op_progress.done() return False + if c_or.target_pkg.name in provides: + self._dbg(2, "would break (conflicts) %s" % provides) + self._failure_string += _("Breaks existing package '%(pkgname)s' that conflict: '%(targetpkg)s'. But the '%(debfile)s' provides it via: '%(provides)s'") % { + 'provides' : ",".join(provides), + 'debfile' : self.filename, + 'targetpkg' : c_or.target_pkg.name, + 'pkgname' : pkg.name } + self._cache.op_progress.done() + return False self._cache.op_progress.done() return True diff --git a/debian/changelog b/debian/changelog index 69db957f..29f37932 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,9 @@ python-apt (0.7.96) UNRELEASED; urgency=low * merged lp:~kiwinote/python-apt/merge-gdebi-changes, this port the DebPackage class fixes from gdebi into python-apt so that gdebi can use the class from python-apt directly + * apt/debfile.py: + - check if the debfiles provides are in conflict with the systems + packages [ Martin Pitt ] * tests/test_apt_cache.py: Test accessing the record of all packages during |
