debdu

measure debian package disk space usage
git clone https://a3nm.net/git/debdu/
Log | Files | Refs

commit 7b57e2b4d8b7e41fbfaaeafb97243641b1e66841
parent ce9e99275dc5d1494dd665eb31dfe7550c55f9b8
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Wed, 29 Apr 2020 14:17:10 +0200

python3

Diffstat:
debdu.py | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/debdu.py b/debdu.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import apt_pkg @@ -16,7 +16,7 @@ def init(p): graph[p]['n_in'] = 0 def dfs(v): - if graph[v].has_key('full'): + if 'full' in graph[v].keys(): return graph[v]['full'] graph[v]['full'] = 0 # TODO this marking is wrong for cycles, think about it s = graph[v]['size'] @@ -66,11 +66,11 @@ for root in roots: dfs(root) for result in sorted(results, reverse=True): - print str(result[0]) + ' ' + result[1] + print (str(result[0]) + ' ' + result[1]) for e in result[2]: # TODO shared should be between non-descendant packages - print ' %d from %s%s' % (e[0], e[1], + print (' %d from %s%s' % (e[0], e[1], (" shared between "+str(e[3])+" package(s)" if e[3] != 1 else '') if - e[2] else ' manually installed and accounted in a separate entry') - print + e[2] else ' manually installed and accounted in a separate entry')) + print()