diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-10-05 12:09:26 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-10-05 12:09:26 +0300 |
commit | 44ee4e164e340c0d4e4725cc57811ce637deaef3 (patch) | |
tree | 750dc56935ff94ee6856f98d20b63c85d9625f96 /python/rpm/transaction.py | |
parent | a15bfa40adc826dfa91f9bdc24b3e680cd8aecb6 (diff) | |
download | librpm-tizen-44ee4e164e340c0d4e4725cc57811ce637deaef3.tar.gz librpm-tizen-44ee4e164e340c0d4e4725cc57811ce637deaef3.tar.bz2 librpm-tizen-44ee4e164e340c0d4e4725cc57811ce637deaef3.zip |
Push the interpretation of ts.run() result code to python side
- at least this lets sub-typers override the hysterical return values
Diffstat (limited to 'python/rpm/transaction.py')
-rw-r--r-- | python/rpm/transaction.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/python/rpm/transaction.py b/python/rpm/transaction.py index 4c4bba75c..f7019ecd5 100644 --- a/python/rpm/transaction.py +++ b/python/rpm/transaction.py @@ -82,3 +82,20 @@ class TransactionSet(_rpm.ts): # garbage collection should take care but just in case... if isinstance(hdrs, _rpm.mi): del hdrs + + def run(self, callback, data): + rc = _rpm.ts.run(self, callback, data) + + # crazy backwards compatibility goo: None for ok, list of problems + # if transaction didnt complete and empty list if it completed + # with errors + if rc == 0: + return None + + res = [] + if rc > 0: + for prob in self.problems(): + item = ("%s" % prob, (prob.type, prob._str, prob._num)) + res.append(item) + return res + |