summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-07-30 15:46:11 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2009-07-30 15:46:11 +0200
commit2215d046a10508c0d3950db6d924727b2a2db336 (patch)
treecb0183883ecf997f671fa77015d9436673266999
parent0695e2f15f7a2dd905fd437a72671b9ba9776f17 (diff)
parent82166c78d6b21754bdad32ed8a94773a874d528f (diff)
downloadpython-apt-2215d046a10508c0d3950db6d924727b2a2db336.tar.gz
merged from debian-sid
-rw-r--r--apt/cache.py65
-rw-r--r--apt/package.py16
-rw-r--r--apt/progress/__init__.py22
-rw-r--r--debian/changelog44
-rw-r--r--debian/control9
-rw-r--r--debian/python-apt.doc-base11
-rw-r--r--po/python-apt.pot127
-rw-r--r--python/cache.cc2
-rw-r--r--python/tag.cc24
9 files changed, 233 insertions, 87 deletions
diff --git a/apt/cache.py b/apt/cache.py
index 94a77fd8..c1e2428c 100644
--- a/apt/cache.py
+++ b/apt/cache.py
@@ -20,6 +20,7 @@
# USA
import os
+import weakref
import apt_pkg
from apt import Package
@@ -47,6 +48,8 @@ class Cache(object):
def __init__(self, progress=None, rootdir=None, memonly=False):
self._callbacks = {}
+ self._weakref = weakref.WeakValueDictionary()
+ self._set = set()
if memonly:
# force apt to build its caches in memory
apt_pkg.Config.Set("Dir::Cache::pkgcache", "")
@@ -63,6 +66,9 @@ class Cache(object):
# create required dirs/files when run with special rootdir
# automatically
self._check_and_create_required_dirs(rootdir)
+ # Call InitSystem so the change to Dir::State::Status is actually
+ # recognized (LP: #320665)
+ apt_pkg.InitSystem()
self.open(progress)
def _check_and_create_required_dirs(self, rootdir):
@@ -93,7 +99,7 @@ class Cache(object):
for callback in self._callbacks[name]:
callback()
- def open(self, progress):
+ def open(self, progress=None):
""" Open the package cache, after that it can be used like
a dictionary
"""
@@ -105,7 +111,8 @@ class Cache(object):
self._records = apt_pkg.GetPkgRecords(self._cache)
self._list = apt_pkg.GetPkgSourceList()
self._list.ReadMainList()
- self._dict = {}
+ self._set.clear()
+ self._weakref.clear()
progress.Op = "Building data structures"
i=last=0
@@ -116,7 +123,7 @@ class Cache(object):
last=i
# drop stuff with no versions (cruft)
if len(pkg.VersionList) > 0:
- self._dict[pkg.Name] = Package(self, pkg)
+ self._set.add(pkg.Name)
i += 1
@@ -125,30 +132,36 @@ class Cache(object):
def __getitem__(self, key):
""" look like a dictionary (get key) """
- return self._dict[key]
+ try:
+ return self._weakref[key]
+ except KeyError:
+ if key in self._set:
+ pkg = self._weakref[key] = Package(self, self._cache[key])
+ return pkg
+ else:
+ raise KeyError('The cache has no package named %r' % key)
def __iter__(self):
- for pkgname in self._dict.keys():
- yield self._dict[pkgname]
+ for pkgname in self._set:
+ yield self[pkgname]
raise StopIteration
def has_key(self, key):
- return (key in self._dict)
+ return (key in self._set)
def __contains__(self, key):
- return (key in self._dict)
+ return (key in self._set)
def __len__(self):
- return len(self._dict)
+ return len(self._set)
def keys(self):
- return self._dict.keys()
+ return list(self._set)
def getChanges(self):
""" Get the marked changes """
changes = []
- for name in self._dict.keys():
- p = self._dict[name]
+ for p in self:
if p.markedUpgrade or p.markedInstall or p.markedDelete or \
p.markedDowngrade or p.markedReinstall:
changes.append(p)
@@ -329,6 +342,26 @@ class Cache(object):
self._callbacks[name] = []
self._callbacks[name].append(callback)
+ @property
+ def broken_count(self):
+ """Return the number of packages with broken dependencies."""
+ return self._depcache.broken_count
+
+ @property
+ def delete_count(self):
+ """Return the number of packages marked for deletion."""
+ return self._depcache.del_count
+
+ @property
+ def install_count(self):
+ """Return the number of packages marked for installation."""
+ return self._depcache.inst_count
+
+ @property
+ def keep_count(self):
+ """Return the number of packages marked as keep."""
+ return self._depcache.keep_count
+
# ----------------------------- experimental interface
@@ -373,7 +406,7 @@ class FilteredCache(object):
return len(self._filtered)
def __getitem__(self, key):
- return self.cache._dict[key]
+ return self.cache[key]
def __iter__(self):
for pkgname in self._filtered:
@@ -391,10 +424,10 @@ class FilteredCache(object):
def _reapplyFilter(self):
" internal helper to refilter "
self._filtered = {}
- for pkg in self.cache._dict.keys():
+ for pkg in self.cache:
for f in self._filters:
- if f.apply(self.cache._dict[pkg]):
- self._filtered[pkg] = 1
+ if f.apply(pkg):
+ self._filtered[pkg.name] = 1
break
def setFilter(self, filter):
diff --git a/apt/package.py b/apt/package.py
index ec88a456..f5bdc47d 100644
--- a/apt/package.py
+++ b/apt/package.py
@@ -486,15 +486,25 @@ class Package(object):
def __repr__(self):
return '<Package: name:%r id:%r>' % (self._pkg.Name, self._pkg.ID)
- @property
def candidate(self):
"""Return the candidate version of the package.
-
- :since: 0.7.9"""
+
+ This property is writeable to allow you to set the candidate version
+ of the package. Just assign a Version() object, and it will be set as
+ the candidate version.
+ """
cand = self._pcache._depcache.GetCandidateVer(self._pkg)
if cand is not None:
return Version(self, cand)
+ def __set_candidate(self, version):
+ """Set the candidate version of the package."""
+ self._pcache.cachePreChange()
+ self._pcache._depcache.SetCandidateVer(self._pkg, version._cand)
+ self._pcache.cachePostChange()
+
+ candidate = property(candidate, __set_candidate)
+
@property
def installed(self):
"""Return the currently installed version of the package.
diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py
index 3be197f7..b9288c2c 100644
--- a/apt/progress/__init__.py
+++ b/apt/progress/__init__.py
@@ -286,11 +286,20 @@ class InstallProgress(DumbInstallProgress):
def waitChild(self):
"""Wait for child progress to exit."""
while True:
- select.select([self.statusfd], [], [], self.selectTimeout)
- self.updateInterface()
- (pid, res) = os.waitpid(self.child_pid, os.WNOHANG)
- if pid == self.child_pid:
+ try:
+ select.select([self.statusfd], [], [], self.selectTimeout)
+ except select.error, (errno_, errstr):
+ if errno_ != errno.EINTR:
+ raise
break
+ self.updateInterface()
+ try:
+ (pid, res) = os.waitpid(self.child_pid, os.WNOHANG)
+ if pid == self.child_pid:
+ break
+ except OSError, (errno_, errstr):
+ if errno_ != errno.EINTR:
+ raise
return res
def run(self, pm):
@@ -335,7 +344,7 @@ class DpkgInstallProgress(InstallProgress):
if pid == 0:
# child
res = os.system("/usr/bin/dpkg --status-fd %s -i %s" % \
- (self.writefd, self.debfile))
+ (self.writefd, debfile))
os._exit(os.WEXITSTATUS(res))
self.child_pid = pid
res = self.waitChild()
@@ -361,10 +370,11 @@ class DpkgInstallProgress(InstallProgress):
print "got garbage from dpkg: '%s'" % self.read
self.read = ""
break
+ pkg_name = statusl[1].strip()
status = statusl[2].strip()
#print status
if status == "error":
- self.error(self.debname, status)
+ self.error(pkg_name, status)
elif status == "conffile-prompt":
# we get a string like this:
# 'current-conffile' 'new-conffile' useredited distedited
diff --git a/debian/changelog b/debian/changelog
index c7016fc5..298c0ac6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,47 @@
+python-apt (0.7.11.2) unstable; urgency=low
+
+ [ Julian Andres Klode ]
+ * python/cache.cc:
+ - Support Breaks, Enhances dependency types (Closes: #416247)
+ * debian/control:
+ - Only recommend libjs-jquery (Closes: #527543)
+ - Build-depend on libapt-pkg-dev (>= 0.7.22~)
+ - Update Standards-Version to 3.8.2
+ * apt/cache.py:
+ - Correctly handle rootdir on second and later invocations of
+ open(), by calling InitSystem again. (LP: #320665).
+ - Provide broken_count, delete_count, install_count, keep_count
+ properties (Closes: #532338)
+ - Only create Package objects when they are requested, do not keep them in
+ a dict. Saves 10MB for 25,000 packages on my machine.
+ * apt/package.py:
+ - Allow to set the candidate of a package (Closes: #523997)
+ + Support assignments to the 'candidate' property of Package objects.
+ + Initial patch by Sebastian Heinlein
+
+ [ Stefano Zacchiroli ]
+ * debian/python-apt.doc-base: register the documentation with the
+ doc-base system (Closes: #525134)
+
+ [ Sebastian Heinlein ]
+ * apt/progress.py: Extract the package name from the status message
+ (Closes: #532660)
+
+ -- Julian Andres Klode <jak@debian.org> Thu, 30 Jul 2009 14:08:30 +0200
+
+python-apt (0.7.11.1) unstable; urgency=low
+
+ [ Stephan Peijnik ]
+ * apt/progress/__init__.py:
+ - Exception handling fixes in InstallProgress class.
+
+ [ Michael Vogt ]
+ * python/tag.cc:
+ - merge patch from John Wright that adds FindRaw method
+ (closes: #538723)
+
+ -- Michael Vogt <mvo@debian.org> Wed, 29 Jul 2009 19:15:56 +0200
+
python-apt (0.7.11.0) unstable; urgency=low
[ Julian Andres Klode ]
diff --git a/debian/control b/debian/control
index 4c7b542f..83b2e421 100644
--- a/debian/control
+++ b/debian/control
@@ -3,12 +3,12 @@ Section: python
Priority: optional
Maintainer: APT Development Team <deity@lists.debian.org>
Uploaders: Michael Vogt <mvo@debian.org>, Julian Andres Klode <jak@debian.org>
-Standards-Version: 3.8.1
+Standards-Version: 3.8.2
XS-Python-Version: all
Build-Depends: apt-utils,
cdbs,
debhelper (>= 5.0.37.1),
- libapt-pkg-dev (>= 0.7.10),
+ libapt-pkg-dev (>= 0.7.22~),
python-all-dbg,
python-all-dev,
python-central (>= 0.5),
@@ -22,9 +22,8 @@ Vcs-Browser: http://bzr.debian.org/loggerhead/apt/python-apt/debian-sid/changes
Package: python-apt
Architecture: any
-Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, lsb-release,
- libjs-jquery
-Recommends: iso-codes
+Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, lsb-release
+Recommends: iso-codes, libjs-jquery
Breaks: debdelta (<< 0.28~)
Provides: ${python:Provides}
Suggests: python-apt-dbg, python-gtk2, python-vte
diff --git a/debian/python-apt.doc-base b/debian/python-apt.doc-base
new file mode 100644
index 00000000..d25926b7
--- /dev/null
+++ b/debian/python-apt.doc-base
@@ -0,0 +1,11 @@
+Document: python-apt-api-reference
+Title: Python APT: API reference manual
+Abstract: API reference manual for Python bindings to libapt-pkg
+Section: Programming/Python
+
+Format: HTML
+Index: /usr/share/doc/python-apt/html/index.html
+Files: /usr/share/doc/python-apt/html/*
+
+Format: Text
+Files: /usr/share/doc/python-apt/text/*
diff --git a/po/python-apt.pot b/po/python-apt.pot
index 02120bfa..f904a0c5 100644
--- a/po/python-apt.pot
+++ b/po/python-apt.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-07-03 12:55+0200\n"
+"POT-Creation-Date: 2009-07-24 13:56+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -24,236 +24,246 @@ msgstr ""
#. Description
#: ../data/templates/Ubuntu.info.in:13
-msgid "Ubuntu 9.04 'Jaunty Jackalope'"
+msgid "Ubuntu 9.10 'Karmic Koala'"
msgstr ""
#. Description
#: ../data/templates/Ubuntu.info.in:31
-msgid "Cdrom with Ubuntu 9.04 'Jaunty Jackalope'"
+msgid "Cdrom with Ubuntu 9.10 'Karmic Koala'"
msgstr ""
#. Description
#: ../data/templates/Ubuntu.info.in:74
-msgid "Ubuntu 8.10 'Intrepid Ibex'"
+msgid "Ubuntu 9.04 'Jaunty Jackalope'"
msgstr ""
#. Description
#: ../data/templates/Ubuntu.info.in:92
+msgid "Cdrom with Ubuntu 9.04 'Jaunty Jackalope'"
+msgstr ""
+
+#. Description
+#: ../data/templates/Ubuntu.info.in:135
+msgid "Ubuntu 8.10 'Intrepid Ibex'"
+msgstr ""
+
+#. Description
+#: ../data/templates/Ubuntu.info.in:153
msgid "Cdrom with Ubuntu 8.10 'Intrepid Ibex'"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:136
+#: ../data/templates/Ubuntu.info.in:197
msgid "Ubuntu 8.04 'Hardy Heron'"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:154
+#: ../data/templates/Ubuntu.info.in:215
msgid "Cdrom with Ubuntu 8.04 'Hardy Heron'"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:191
+#: ../data/templates/Ubuntu.info.in:252
msgid "Ubuntu 7.10 'Gutsy Gibbon'"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:209
+#: ../data/templates/Ubuntu.info.in:270
msgid "Cdrom with Ubuntu 7.10 'Gutsy Gibbon'"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:244
+#: ../data/templates/Ubuntu.info.in:305
msgid "Ubuntu 7.04 'Feisty Fawn'"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:262
+#: ../data/templates/Ubuntu.info.in:323
msgid "Cdrom with Ubuntu 7.04 'Feisty Fawn'"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:296
+#: ../data/templates/Ubuntu.info.in:357
msgid "Ubuntu 6.10 'Edgy Eft'"
msgstr ""
#. CompDescription
-#: ../data/templates/Ubuntu.info.in:301
+#: ../data/templates/Ubuntu.info.in:362
msgid "Community-maintained"
msgstr ""
#. CompDescription
-#: ../data/templates/Ubuntu.info.in:307
+#: ../data/templates/Ubuntu.info.in:368
msgid "Restricted software"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:314
+#: ../data/templates/Ubuntu.info.in:375
msgid "Cdrom with Ubuntu 6.10 'Edgy Eft'"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:348
+#: ../data/templates/Ubuntu.info.in:409
msgid "Ubuntu 6.06 LTS 'Dapper Drake'"
msgstr ""
#. CompDescriptionLong
-#: ../data/templates/Ubuntu.info.in:351
+#: ../data/templates/Ubuntu.info.in:412
msgid "Canonical-supported Open Source software"
msgstr ""
#. CompDescription
-#: ../data/templates/Ubuntu.info.in:353
+#: ../data/templates/Ubuntu.info.in:414
msgid "Community-maintained (universe)"
msgstr ""
#. CompDescriptionLong
-#: ../data/templates/Ubuntu.info.in:354
+#: ../data/templates/Ubuntu.info.in:415
msgid "Community-maintained Open Source software"
msgstr ""
#. CompDescription
-#: ../data/templates/Ubuntu.info.in:356
+#: ../data/templates/Ubuntu.info.in:417
msgid "Non-free drivers"
msgstr ""
#. CompDescriptionLong
-#: ../data/templates/Ubuntu.info.in:357
+#: ../data/templates/Ubuntu.info.in:418
msgid "Proprietary drivers for devices"
msgstr ""
#. CompDescription
-#: ../data/templates/Ubuntu.info.in:359
+#: ../data/templates/Ubuntu.info.in:420
msgid "Restricted software (Multiverse)"
msgstr ""
#. CompDescriptionLong
-#: ../data/templates/Ubuntu.info.in:360
+#: ../data/templates/Ubuntu.info.in:421
msgid "Software restricted by copyright or legal issues"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:366
+#: ../data/templates/Ubuntu.info.in:427
msgid "Cdrom with Ubuntu 6.06 LTS 'Dapper Drake'"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:378
+#: ../data/templates/Ubuntu.info.in:439
msgid "Important security updates"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:383
+#: ../data/templates/Ubuntu.info.in:444
msgid "Recommended updates"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:388
+#: ../data/templates/Ubuntu.info.in:449
msgid "Pre-released updates"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:393
+#: ../data/templates/Ubuntu.info.in:454
msgid "Unsupported updates"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:400
+#: ../data/templates/Ubuntu.info.in:461
msgid "Ubuntu 5.10 'Breezy Badger'"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:414
+#: ../data/templates/Ubuntu.info.in:475
msgid "Cdrom with Ubuntu 5.10 'Breezy Badger'"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:426
+#: ../data/templates/Ubuntu.info.in:487
msgid "Ubuntu 5.10 Security Updates"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:431
+#: ../data/templates/Ubuntu.info.in:492
msgid "Ubuntu 5.10 Updates"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:436
+#: ../data/templates/Ubuntu.info.in:497
msgid "Ubuntu 5.10 Backports"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:443
+#: ../data/templates/Ubuntu.info.in:504
msgid "Ubuntu 5.04 'Hoary Hedgehog'"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:457
+#: ../data/templates/Ubuntu.info.in:518
msgid "Cdrom with Ubuntu 5.04 'Hoary Hedgehog'"
msgstr ""
#. CompDescription
-#: ../data/templates/Ubuntu.info.in:460 ../data/templates/Debian.info.in:123
+#: ../data/templates/Ubuntu.info.in:521 ../data/templates/Debian.info.in:148
msgid "Officially supported"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:469
+#: ../data/templates/Ubuntu.info.in:530
msgid "Ubuntu 5.04 Security Updates"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:474
+#: ../data/templates/Ubuntu.info.in:535
msgid "Ubuntu 5.04 Updates"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:479
+#: ../data/templates/Ubuntu.info.in:540
msgid "Ubuntu 5.04 Backports"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:485
+#: ../data/templates/Ubuntu.info.in:546
msgid "Ubuntu 4.10 'Warty Warthog'"
msgstr ""
#. CompDescription
-#: ../data/templates/Ubuntu.info.in:491
+#: ../data/templates/Ubuntu.info.in:552
msgid "Community-maintained (Universe)"
msgstr ""
#. CompDescription
-#: ../data/templates/Ubuntu.info.in:493
+#: ../data/templates/Ubuntu.info.in:554
msgid "Non-free (Multiverse)"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:499
+#: ../data/templates/Ubuntu.info.in:560
msgid "Cdrom with Ubuntu 4.10 'Warty Warthog'"
msgstr ""
#. CompDescription
-#: ../data/templates/Ubuntu.info.in:502
+#: ../data/templates/Ubuntu.info.in:563
msgid "No longer officially supported"
msgstr ""
#. CompDescription
-#: ../data/templates/Ubuntu.info.in:504
+#: ../data/templates/Ubuntu.info.in:565
msgid "Restricted copyright"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:511
+#: ../data/templates/Ubuntu.info.in:572
msgid "Ubuntu 4.10 Security Updates"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:516
+#: ../data/templates/Ubuntu.info.in:577
msgid "Ubuntu 4.10 Updates"
msgstr ""
#. Description
-#: ../data/templates/Ubuntu.info.in:521
+#: ../data/templates/Ubuntu.info.in:582
msgid "Ubuntu 4.10 Backports"
msgstr ""
@@ -265,51 +275,56 @@ msgstr ""
#. Description
#: ../data/templates/Debian.info.in:8
-msgid "Debian 5.0 'Lenny' "
+msgid "Debian 6.0 'Squeeze' "
msgstr ""
#. Description
#: ../data/templates/Debian.info.in:33
-msgid "Debian 4.0 'Etch'"
+msgid "Debian 5.0 'Lenny' "
msgstr ""
#. Description
#: ../data/templates/Debian.info.in:58
+msgid "Debian 4.0 'Etch'"
+msgstr ""
+
+#. Description
+#: ../data/templates/Debian.info.in:83
msgid "Debian 3.1 'Sarge'"
msgstr ""
#. Description
-#: ../data/templates/Debian.info.in:69
+#: ../data/templates/Debian.info.in:94
msgid "Proposed updates"
msgstr ""
#. Description
-#: ../data/templates/Debian.info.in:76
+#: ../data/templates/Debian.info.in:101
msgid "Security updates"
msgstr ""
#. Description
-#: ../data/templates/Debian.info.in:83
+#: ../data/templates/Debian.info.in:108
msgid "Debian current stable release"
msgstr ""
#. Description
-#: ../data/templates/Debian.info.in:96
+#: ../data/templates/Debian.info.in:121
msgid "Debian testing"
msgstr ""
#. Description
-#: ../data/templates/Debian.info.in:121
+#: ../data/templates/Debian.info.in:146
msgid "Debian 'Sid' (unstable)"
msgstr ""
#. CompDescription
-#: ../data/templates/Debian.info.in:125
+#: ../data/templates/Debian.info.in:150
msgid "DFSG-compatible Software with Non-Free Dependencies"
msgstr ""
#. CompDescription
-#: ../data/templates/Debian.info.in:127
+#: ../data/templates/Debian.info.in:152
msgid "Non-DFSG-compatible Software"
msgstr ""
diff --git a/python/cache.cc b/python/cache.cc
index 0c59f561..c7e5e76e 100644
--- a/python/cache.cc
+++ b/python/cache.cc
@@ -502,7 +502,7 @@ static PyObject *MakeDepends(PyObject *Owner,pkgCache::VerIterator &Ver,
{
"", "Depends","PreDepends","Suggests",
"Recommends","Conflicts","Replaces",
- "Obsoletes"
+ "Obsoletes", "Breaks", "Enhances"
};
PyObject *Dep = PyString_FromString(Types[Start->Type]);
LastDepType = Start->Type;
diff --git a/python/tag.cc b/python/tag.cc
index 217be290..6fe97ed5 100644
--- a/python/tag.cc
+++ b/python/tag.cc
@@ -92,6 +92,29 @@ static PyObject *TagSecFind(PyObject *Self,PyObject *Args)
return PyString_FromStringAndSize(Start,Stop-Start);
}
+static char *doc_FindRaw = "FindRaw(Name) -> String/None";
+static PyObject *TagSecFindRaw(PyObject *Self,PyObject *Args)
+{
+ char *Name = 0;
+ char *Default = 0;
+ if (PyArg_ParseTuple(Args,"s|z",&Name,&Default) == 0)
+ return 0;
+
+ unsigned Pos;
+ if (GetCpp<pkgTagSection>(Self).Find(Name,Pos) == false)
+ {
+ if (Default == 0)
+ Py_RETURN_NONE;
+ return PyString_FromString(Default);
+ }
+
+ const char *Start;
+ const char *Stop;
+ GetCpp<pkgTagSection>(Self).Get(Start,Stop,Pos);
+
+ return PyString_FromStringAndSize(Start,Stop-Start);
+}
+
static char *doc_FindFlag = "FindFlag(Name) -> integer/none";
static PyObject *TagSecFindFlag(PyObject *Self,PyObject *Args)
{
@@ -355,6 +378,7 @@ static PyMethodDef TagSecMethods[] =
{
// Query
{"Find",TagSecFind,METH_VARARGS,doc_Find},
+ {"FindRaw",TagSecFindRaw,METH_VARARGS,doc_FindRaw},
{"FindFlag",TagSecFindFlag,METH_VARARGS,doc_FindFlag},
{"Bytes",TagSecBytes,METH_VARARGS,doc_Bytes},