From 7ec8d800532b725c80e272914afc3978abb835eb Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Wed, 12 Feb 2014 16:06:53 +0400 Subject: [PATCH] Add stats on disk space savings. --- cmd_db_cleanup.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd_db_cleanup.go b/cmd_db_cleanup.go index 172c37a4..4caf6182 100644 --- a/cmd_db_cleanup.go +++ b/cmd_db_cleanup.go @@ -111,9 +111,7 @@ func aptlyDbCleanup(cmd *commander.Command, args []string) error { if len(filesToDelete) > 0 { context.downloader.GetProgress().InitBar(int64(len(filesToDelete)), false) - totalSize := int64(0) - for _, file := range filesToDelete { size, err := context.packageRepository.PoolRemove(file) if err != nil { @@ -123,9 +121,9 @@ func aptlyDbCleanup(cmd *commander.Command, args []string) error { context.downloader.GetProgress().AddBar(1) totalSize += size } - context.downloader.GetProgress().ShutdownBar() - } + context.downloader.GetProgress().Printf("Disk space freed: %.2f GiB...\n", float64(totalSize)/1024.0/1024.0/1024.0) + } return err }