Permalink
Browse files

Give the package name more space in progress cb

The package name was always truncated, while the progress bar took most
of the screens space. The formula used by pacman was copied which gives
the "info" part of the progress update 60% of screen space.
  • Loading branch information...
1 parent 2265f73 commit 445e3ae6e64403ecc5c8eaa8be67ae276219b5f7 @sebnow sebnow committed Jun 25, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 clydelib/callback.lua
View
@@ -204,7 +204,7 @@ function cb_dl_total(total)
end
function cb_dl_progress(filename, file_xfered, file_total)
- local infolen = 50
+ local infolen = getcols() * 6 / 10
local filenamelen = infolen - 27
local fname, len, wclen, padwid, wcfname
@@ -215,6 +215,10 @@ function cb_dl_progress(filename, file_xfered, file_total)
local eta_h, eta_m, eta_s = 0, 0, 0
local rate_size, xfered_size = "K", "K"
+ if (infolen < 50) then
+ infolen = 50
+ end
+
if (config.noprogressbar or file_total == -1) then
if (file_xfered == 0) then
printf(g("downloading %s...\n"), filename)

0 comments on commit 445e3ae

Please sign in to comment.