* fix: try to report package size only if it's known (careful next time boyz!)
This commit is contained in:
+5
-4
@@ -48,10 +48,11 @@ 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):
|
||||||
if package_size:
|
package_size = ctx.packagedb.get_package(current_pkg).packageSize
|
||||||
package_size, symbol = util.human_readable_size(package_size)
|
if package_size:
|
||||||
ctx.ui.warning(_("Package size: %.2f %s" % (package_size, symbol)))
|
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),
|
# if package is installed (which means we are upgrading it),
|
||||||
# calculate needed info
|
# calculate needed info
|
||||||
|
|||||||
Reference in New Issue
Block a user