~ubuntu-core-dev/ubuntu/xenial/ubuntu-release-upgrader/xenial

1759 by Michael Vogt
utils/est_kernel_size.py: add helper to estimate kernel size in /boot
1
#!/usr/bin/python
2
2394 by Colin Watson
Use Python 3-style print functions.
3
from __future__ import print_function
4
1759 by Michael Vogt
utils/est_kernel_size.py: add helper to estimate kernel size in /boot
5
import apt_pkg
6
import glob
7
import os
8
9
(sysname, nodename, krelease, version, machine) = os.uname()
10
11
sum = 0
12
for entry in glob.glob("/boot/*%s*" % krelease):
13
    sum += os.path.getsize(entry)
14
2446.3.15 by Colin Watson
Use apt_pkg.size_to_str rather than apt_pkg.SizeToStr.
15
print("Sum of kernel related files: ", sum, apt_pkg.size_to_str(sum))