From e8378e07fc5e3bf9e9f3812384d29905b4db794f Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Wed, 8 Jul 2009 17:23:52 -0400 Subject: Use a method yum provides, rather than inventing our own. --- yuminstall.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'yuminstall.py') diff --git a/yuminstall.py b/yuminstall.py index 623911d51..478b22b1a 100644 --- a/yuminstall.py +++ b/yuminstall.py @@ -743,17 +743,12 @@ class AnacondaYum(YumSorter): downloadpkgs = [] totalSize = 0 totalFiles = 0 - for txmbr in self.tsInfo.getMembers(): - if txmbr.ts_state in ['i', 'u']: - po = txmbr.po - else: - continue - - if po: - totalSize += int(po.returnSimple("installedsize")) / 1024 - for filetype in po.returnFileTypes(): - totalFiles += len(po.returnFileEntries(ftype=filetype)) - downloadpkgs.append(po) + for txmbr in self.tsInfo.getMembersWithState(output_states=TS_INSTALL_STATES): + if txmbr.po: + totalSize += int(txmbr.po.returnSimple("installedsize")) / 1024 + for filetype in txmbr.po.returnFileTypes(): + totalFiles += len(txmbr.po.returnFileEntries(ftype=filetype)) + downloadpkgs.append(txmbr.po) return (downloadpkgs, totalSize, totalFiles) -- cgit