From e46d39178317169a17e1124d3337bf5f8ac18837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Thu, 23 Mar 2006 01:28:56 +0000 Subject: [PATCH] * fix: try to report package size only if it's known (careful next time boyz!) --- pisi/package.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pisi/package.py b/pisi/package.py index a04d0d35..72f1ef1e 100644 --- a/pisi/package.py +++ b/pisi/package.py @@ -48,10 +48,11 @@ 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 ctx.packagedb.has_package(current_pkg): + package_size = ctx.packagedb.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