Skip to content

Commit

Permalink
upgrade to new API of python-apt
Browse files Browse the repository at this point in the history
  • Loading branch information
gebi committed Oct 20, 2010
1 parent 4439d3f commit e03cc7c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions upgrade-bloatscanner
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@ if len(sys.argv) >1:
sys.exit(0)

cache = apt.Cache()
packages = [ i for i in cache if i.isUpgradable == 1 ]
packages = [ i for i in cache if i.is_upgradable == 1 ]
package_upgrade_size = [] # [(size, package_name), ...]
for p in packages:
r = p.candidateRecord
# both in kB
# diff_size = int(r['Size']) - p.packageSize # p.packageSize wrong
diff_isize = int(r['Installed-Size']) - p.installedSize/1024
diff_isize = p.candidate.installed_size/1024 - p.installed.installed_size/1024
package_upgrade_size.append((diff_isize, p.name))

package_upgrade_size.sort(key=lambda i: i.__getitem__(0), reverse=True)
Expand Down

0 comments on commit e03cc7c

Please sign in to comment.