diff options
Diffstat (limited to 'apt/debfile.py')
| -rw-r--r-- | apt/debfile.py | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/apt/debfile.py b/apt/debfile.py index f24f19f4..0406a250 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -1,24 +1,21 @@ -# Copyright (c) 2005-2007 Canonical +# Copyright (c) 2005-2009 Canonical # -# AUTHOR: -# Michael Vogt <mvo@ubuntu.com> +# Author: Michael Vogt <michael.vogt@ubuntu.com> # -# This file is part of GDebi +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. # -# GDebi is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as published -# by the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# GDebi is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GDebi; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA """Classes for working with locally available Debian packages.""" from gettext import gettext as _ import os @@ -108,9 +105,8 @@ class DebPackage(object): return True continue - inst = self._cache[depname] - instver = inst.installedVersion - if instver is not None and apt_pkg.CheckDep(instver, oper, ver): + inst = self._cache[depname].installed + if inst is not None and apt_pkg.CheckDep(inst.version, oper, ver): return True return False @@ -163,9 +159,9 @@ class DebPackage(object): pkg = self._cache[pkgname] if pkg.isInstalled: - pkgver = pkg.installedVersion + pkgver = pkg.installed.version elif pkg.markedInstall: - pkgver = pkg.candidateVersion + pkgver = pkg.candidate.version else: return False #print "pkg: %s" % pkgname @@ -202,7 +198,8 @@ class DebPackage(object): if self.pkgname == pkg.name: self._dbg(3, "conflict on self, ignoring") continue - if self._check_single_pkg_conflict(pkg.name, ver, oper): + if self._check_single_pkg_conflict(pkg.name, ver, + oper): self._installed_conflicts.add(pkg.name) continue if self._check_single_pkg_conflict(depname, ver, oper): @@ -257,9 +254,9 @@ class DebPackage(object): self._dbg(3, "replacesPkg() %s %s %s" % (pkgname, oper, ver)) pkg = self._cache[pkgname] if pkg.isInstalled: - pkgver = pkg.installedVersion + pkgver = pkg.installed.version elif pkg.markedInstall: - pkgver = pkg.candidateVersion + pkgver = pkg.candidate.version else: pkgver = None for or_group in self.replaces: @@ -296,10 +293,10 @@ class DebPackage(object): debver = self._sections["Version"] self._dbg(1, "debver: %s" % debver) if pkgname in self._cache: - if use_installed: - cachever = self._cache[pkgname].installedVersion + if use_installed and self._cache[pkgname].installed: + cachever = self._cache[pkgname].installed.version else: - cachever = self._cache[pkgname].candidateVersion + cachever = self._cache[pkgname].candidate.version if cachever is not None: cmp = apt_pkg.VersionCompare(cachever, debver) self._dbg(1, "CompareVersion(debver,instver): %s" % cmp) @@ -366,7 +363,8 @@ class DebPackage(object): # check depends for or_group in depends: #print "or_group: %s" % or_group - #print "or_group satified: %s" % self._is_or_group_satisfied(or_group) + #print "or_group satified: %s" % self._is_or_group_satisfied( + # or_group) if not self._is_or_group_satisfied(or_group): if not self._satisfy_or_group(or_group): return False @@ -403,7 +401,7 @@ class DebPackage(object): # check authentication, one authenticated origin is enough # libapt will skip non-authenticated origins then authenticated = False - for origin in pkg.candidateOrigin: + for origin in pkg.candidate.origins: authenticated |= origin.trusted if not authenticated: unauthenticated.append(pkg.name) |
