From 52afa761f57f8ec4d4f30a736cd6cc808465f564 Mon Sep 17 00:00:00 2001 From: "A. Murat Eren" Date: Fri, 17 Mar 2006 22:21:24 +0000 Subject: [PATCH] =?UTF-8?q?=20#1465..=20cli'de=20de=20g=C3=B6relim..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/operations.py | 10 ++++++++++ pisi/package.py | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/pisi/operations.py b/pisi/operations.py index 5bd2c8b3..100d589a 100644 --- a/pisi/operations.py +++ b/pisi/operations.py @@ -223,6 +223,16 @@ def install_pkg_names(A, reinstall = False): in the respective order to satisfy dependencies: """) + util.strlist(order)) + #this silly try/except block will be removed soon.. + try: + total_size = sum([packagedb.get_package(p).packageSize for p in order]) + except: + total_size = 0 + + if total_size: + total_size, symbol = util.human_readable_size(total_size) + ctx.ui.warning(_('Total size of packages: %.2f %s' % (total_size, symbol))) + if ctx.get_option('dry_run'): return diff --git a/pisi/package.py b/pisi/package.py index 027c8c43..7a928d1f 100644 --- a/pisi/package.py +++ b/pisi/package.py @@ -24,6 +24,7 @@ _ = __trans.ugettext import pisi import pisi.context as ctx import pisi.archive as archive +from pisi.packagedb import get_package from pisi.uri import URI from pisi.metadata import MetaData from pisi.files import Files @@ -48,9 +49,14 @@ class Package: # get current package name without version info (like tasma) current_pkg = util.pure_package_name(url.filename()) + package_size = get_package(current_pkg).packageSize + if package_size: + package_size, symbol = util.human_readable_size(package_size) + ctx.ui.warning(_("Package size: %.2f %s" % (package_size, symbol))) + # if package is installed (which means we are upgrading it), # calculate needed info - if ctx.installdb.is_installed(current_pkg): + if ctx.installdb.is_installed(current_pkg): installed = True # calculate currently installed package's name and pisi file's location