* report total size for install and upgrade ops correctly
This commit is contained in:
@@ -127,7 +127,7 @@ class CLI(UI):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def display_progress(self, **ka):
|
def display_progress(self, **ka):
|
||||||
totalsize = '%4.1f %s' % pisi.util.human_readable_size(ka['total_size'])
|
totalsize = '%.1f %s' % pisi.util.human_readable_size(ka['total_size'])
|
||||||
out = '\r%-30.30s (%s)%3d%% %9.2f %s [%s]' % \
|
out = '\r%-30.30s (%s)%3d%% %9.2f %s [%s]' % \
|
||||||
(ka['filename'], totalsize, ka['percent'],
|
(ka['filename'], totalsize, ka['percent'],
|
||||||
ka['rate'], ka['symbol'], ka['eta'])
|
ka['rate'], ka['symbol'], ka['eta'])
|
||||||
|
|||||||
+8
-10
@@ -285,19 +285,13 @@ def install_pkg_names(A, reinstall = False, bypass_safety = False):
|
|||||||
G_f = None
|
G_f = None
|
||||||
order = A
|
order = A
|
||||||
|
|
||||||
ctx.ui.info(_("""The following minimal list of packages will be installed
|
ctx.ui.info(_("""Following packages will be installed
|
||||||
in the respective order to satisfy dependencies:
|
in the respective order to satisfy dependencies:
|
||||||
""") + util.strlist(order))
|
""") + util.strlist(order))
|
||||||
|
|
||||||
#this silly try/except block will be removed soon..
|
total_size = sum([ctx.packagedb.get_package(p).packageSize for p in order])
|
||||||
try:
|
total_size, symbol = util.human_readable_size(total_size)
|
||||||
total_size = sum([packagedb.get_package(p).packageSize for p in order])
|
ctx.ui.info(_('Total size of packages: %.2f %s') % (total_size, symbol))
|
||||||
except:
|
|
||||||
total_size = 0
|
|
||||||
|
|
||||||
if total_size:
|
|
||||||
total_size, symbol = util.human_readable_size(total_size)
|
|
||||||
ctx.ui.info(_('Total size of packages: %.2f %s') % (total_size, symbol))
|
|
||||||
|
|
||||||
if ctx.get_option('dry_run'):
|
if ctx.get_option('dry_run'):
|
||||||
return
|
return
|
||||||
@@ -400,6 +394,10 @@ def upgrade_pkg_names(A = [], bypass_safety = False):
|
|||||||
ctx.ui.info(_('The following packages will be upgraded: ') +
|
ctx.ui.info(_('The following packages will be upgraded: ') +
|
||||||
util.strlist(order))
|
util.strlist(order))
|
||||||
|
|
||||||
|
total_size = sum([ctx.packagedb.get_package(p).packageSize for p in order])
|
||||||
|
total_size, symbol = util.human_readable_size(total_size)
|
||||||
|
ctx.ui.info(_('Total size of packages: %.2f %s') % (total_size, symbol))
|
||||||
|
|
||||||
if ctx.get_option('dry_run'):
|
if ctx.get_option('dry_run'):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user