summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt/package.py17
-rw-r--r--debian/changelog1
2 files changed, 14 insertions, 4 deletions
diff --git a/apt/package.py b/apt/package.py
index 88c81681..4691b482 100644
--- a/apt/package.py
+++ b/apt/package.py
@@ -118,21 +118,30 @@ class Package(object):
depends_list.append(Dependency(base_deps))
return depends_list
- @property
def candidateDependencies(self):
""" return a list of candidate dependencies """
candver = self._depcache.GetCandidateVer(self._pkg)
if candver == None:
return []
return self._getDependencies(candver)
+ candidateDependencies = property(candidateDependencies)
- @property
def installedDependencies(self):
""" return a list of installed dependencies """
ver = self._pkg.CurrentVer
if ver == None:
return []
return self._getDependencies(ver)
+ installedDependencies = property(installedDependencies)
+
+ def architecture(self):
+ if not self._lookupRecord():
+ return None
+ sec = apt_pkg.ParseSection(self._records.Record)
+ if sec.has_key("Architecture"):
+ return sec["Architecture"]
+ return None
+ architecture = property(architecture)
def _downloadable(self, useCandidate=True):
""" helper, return if the version is downloadable """
@@ -405,8 +414,8 @@ if __name__ == "__main__":
print "Dependencies: %s" % pkg.installedDependencies
for dep in pkg.candidateDependencies:
print ",".join(["%s (%s) (%s) (%s)" % (o.name,o.version,o.relation, o.preDepend) for o in dep.or_dependencies])
-
-
+ print "arch: %s" % pkg.architecture
+
# now test install/remove
import apt
diff --git a/debian/changelog b/debian/changelog
index c266f128..55b4e978 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ python-apt (0.6.20ubuntu11) feisty; urgency=low
* apt/packages.py:
- support candidateDependencies, installedDependencies
+ - support pkg.architecture
-- Michael Vogt <michael.vogt@ubuntu.com> Tue, 6 Mar 2007 12:39:35 +0100