diff options
-rw-r--r-- | python/rpm/transaction.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/python/rpm/transaction.py b/python/rpm/transaction.py index dcb28d405..9c8de0c73 100644 --- a/python/rpm/transaction.py +++ b/python/rpm/transaction.py @@ -44,7 +44,16 @@ class TransactionSet(_rpm.ts): else: return tuple(keys) - def addInstall(self, header, key, how="u"): + def addInstall(self, item, key, how="u"): + if isinstance(item, str): + f = file(item) + header = self.hdrFromFdno(f) + f.close() + elif isinstance(item, file): + header = self.hdrFromFdno(item) + else: + header = item + if not how in ['u', 'i']: raise ValueError, 'how argument must be "u" or "i"' upgrade = (how == "u") |