#1465.. cli'de de görelim..

This commit is contained in:
A. Murat Eren
2006-03-17 22:21:24 +00:00
parent 492cac2c4c
commit 52afa761f5
2 changed files with 17 additions and 1 deletions
+10
View File
@@ -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
+7 -1
View File
@@ -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