* fix: try to report package size only if it's known (careful next time boyz!)

This commit is contained in:
Eray Özkural
2006-03-23 01:28:56 +00:00
parent 6e1b75ab1e
commit e46d391783
+2 -1
View File
@@ -48,7 +48,8 @@ class Package:
# get current package name without version info (like tasma) # get current package name without version info (like tasma)
current_pkg = util.pure_package_name(url.filename()) current_pkg = util.pure_package_name(url.filename())
package_size = get_package(current_pkg).packageSize if ctx.packagedb.has_package(current_pkg):
package_size = ctx.packagedb.get_package(current_pkg).packageSize
if package_size: if package_size:
package_size, symbol = util.human_readable_size(package_size) package_size, symbol = util.human_readable_size(package_size)
ctx.ui.warning(_("Package size: %.2f %s" % (package_size, symbol))) ctx.ui.warning(_("Package size: %.2f %s" % (package_size, symbol)))