From b3a5d00f729cd7e2d819d67f68d494a1ad5cea9a Mon Sep 17 00:00:00 2001 From: "martin@piware.de" <> Date: Wed, 4 Aug 2010 21:22:28 +0200 Subject: [PATCH] remove iso-deb-size-compare, moved to ubuntu-archive-tools --- iso-deb-size-compare | 68 -------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100755 iso-deb-size-compare diff --git a/iso-deb-size-compare b/iso-deb-size-compare deleted file mode 100755 index c98bb28..0000000 --- a/iso-deb-size-compare +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import subprocess, sys - -def deb_size_map(iso_path): - map = {} # package -> (version, size) - isoinfo = subprocess.Popen(['isoinfo', '-lR', '-i', iso_path], - stdout=subprocess.PIPE) - out = isoinfo.communicate()[0] - assert isoinfo.returncode == 0 - - for l in out.splitlines(): - l = l.strip() - if not l.endswith('.deb'): - continue - - fields = l.split() - size = int(fields[4]) - fname = fields[11] - - (pkg, version, _) = fname.split('_') - map[pkg] = (version, size) - - return map - -# -# main -# - -if len(sys.argv) != 3: - print >> sys.stderr, 'Usage: %s ' % sys.argv[0] - sys.exit(1) - -old_map = deb_size_map(sys.argv[1]) -new_map = deb_size_map(sys.argv[2]) - -print '== Removed packages ==' -sum = 0 -for p, (v, s) in old_map.iteritems(): - if p not in new_map: - print '%s (%.1f MB)' % (p, s / 1000000.) - sum += s -print 'TOTAL: -%.1f MB' % (sum/1000000.) - -sum = 0 -print '\n== Added packages ==' -for p, (v, s) in new_map.iteritems(): - if p not in old_map: - print '%s (%.1f MB)' % (p, s / 1000000.) - sum += s -print 'TOTAL: +%.1f MB' % (sum/1000000.) - -print '\n== Changed packages ==' -sum = 0 -for p, (v, s) in old_map.iteritems(): - if p not in new_map: - continue - - new_s = new_map[p][1] - sum += new_s - s - - # only show differences > 100 kB to filter out noise - if new_s - s > 100000: - print '%s (Δ %.1f MB - %s: %.1f MB %s: %.1f MB)' % ( - p, (new_s-s)/1000000., v, s/1000000., new_map[p][0], new_s/1000000.) - -print 'TOTAL difference: %.1f MB' % (sum/1000000.) -- 2.39.5