summaryrefslogtreecommitdiff
path: root/python/rpm
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-10-05 14:55:37 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-10-05 14:55:37 +0300
commit60ec5008bd6bc5f9cec43f64dd8129045080fa41 (patch)
tree3fde86f7519f95a612c01c17ba57673a88ce5dcb /python/rpm
parent0503d7f92e94a7986715756da5226fc18a1fba10 (diff)
downloadlibrpm-tizen-60ec5008bd6bc5f9cec43f64dd8129045080fa41.tar.gz
librpm-tizen-60ec5008bd6bc5f9cec43f64dd8129045080fa41.tar.bz2
librpm-tizen-60ec5008bd6bc5f9cec43f64dd8129045080fa41.zip
Push hdrCheck() error code handling over to python side
- return (rpmrc, message) tuple from C to let python do whatever it wishes with the information - let python side worry about generating backwards compatible returns
Diffstat (limited to 'python/rpm')
-rw-r--r--python/rpm/transaction.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/python/rpm/transaction.py b/python/rpm/transaction.py
index c852b86b2..07a8db0fb 100644
--- a/python/rpm/transaction.py
+++ b/python/rpm/transaction.py
@@ -138,3 +138,13 @@ class TransactionSet(_rpm.ts):
res.append(((n, v, r),(needname,needver),needflags,sense,p.key))
return res
+
+ def hdrCheck(self, blob):
+ res, msg = _rpm.ts.hdrCheck(self, blob)
+ # generate backwards compatibly broken exceptions
+ if res == _rpm.RPMRC_NOKEY:
+ raise _rpm.error, "public key not availaiable"
+ elif res == _rpm.RPMRC_NOTTRUSTED:
+ raise _rpm.error, "public key not trusted"
+ elif res != _rpm.RPMRC_OK:
+ raise _rpm.error, msg