Fix AUR not displaying install sizes
This commit is contained in:
parent
2b4ce3b342
commit
859b854c67
2 changed files with 16 additions and 4 deletions
|
|
@ -34,6 +34,17 @@ uint32_t req_pad_size(repo_update& ru)
|
||||||
return std::ceil(std::max(std::max(pd, pi), pn)) + (size_index>0?7:2);
|
return std::ceil(std::max(std::max(pd, pi), pn)) + (size_index>0?7:2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void copy_cur_size_to_new(repo_update* ru)
|
||||||
|
{
|
||||||
|
ru->new_install_size = ru->current_install_size;
|
||||||
|
for(auto it: ru->packages)
|
||||||
|
{
|
||||||
|
it.new_install_size = it.current_install_size;
|
||||||
|
if(it.new_install_size > ru->max_install_size)
|
||||||
|
ru->max_install_size = it.new_install_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void repo_print_process(repo_update& ru, ztd::color cl, bool print_only_install=false, bool print_extra_separator=false)
|
void repo_print_process(repo_update& ru, ztd::color cl, bool print_only_install=false, bool print_extra_separator=false)
|
||||||
{
|
{
|
||||||
//only if there are packages
|
//only if there are packages
|
||||||
|
|
@ -98,6 +109,7 @@ int pacman_process(const std::vector<std::string>& args, bool yay)
|
||||||
if(opt_aur && yay)
|
if(opt_aur && yay)
|
||||||
{
|
{
|
||||||
r = import_sizes(&aur, AUR_EXT_SIZE_COMMAND, PACMAN_LOCAL_SIZE_COMMAND);
|
r = import_sizes(&aur, AUR_EXT_SIZE_COMMAND, PACMAN_LOCAL_SIZE_COMMAND);
|
||||||
|
copy_cur_size_to_new(&aur);
|
||||||
}
|
}
|
||||||
if(r!=0)
|
if(r!=0)
|
||||||
return r;
|
return r;
|
||||||
|
|
|
||||||
|
|
@ -112,16 +112,16 @@ void print_update(repo_update& ru, ztd::color color, bool dlsize, bool nisize, b
|
||||||
if(print_only_install)
|
if(print_only_install)
|
||||||
{
|
{
|
||||||
if(opt_linstall && nisize)
|
if(opt_linstall && nisize)
|
||||||
print_size(it.current_install_size, true, "", 0, ztd::color::none, 2, size_index, " : ", (int) std::max(log10(ru.max_download_size) - 3*size_index + 0 , 0.0) + 5);
|
print_size(it.current_install_size, true, "", 0, ztd::color::none, 2, size_index, " : ", (int) std::max(log10(ru.max_install_size) - 3*size_index , 0.0) + 5);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(opt_linstall && nisize)
|
if(opt_linstall && nisize)
|
||||||
print_size(it.has_update?it.new_install_size:it.current_install_size, true, "", 0, ztd::color::none, 2, size_index, " : ", (int) std::max(log10(ru.max_download_size) - 3*size_index + 0 , 0.0) + 5);
|
print_size( it.has_update?it.new_install_size:it.current_install_size , true, "", 0, ztd::color::none, 2, size_index, " : ", (int) std::max(log10(ru.max_install_size) - 3*size_index , 0.0) + 5);
|
||||||
if(it.has_update && dlsize)
|
if(it.has_update && dlsize)
|
||||||
print_size(it.download_size, true, "", 0, ztd::color::none, 2, size_index, " : ", (int) std::max(log10(ru.max_download_size) - 3*size_index + 0 , 0.0) + 5 );
|
print_size(it.download_size, true, "", 0, ztd::color::none, 2, size_index, " : ", (int) std::max(log10(ru.max_download_size) - 3*size_index , 0.0) + 5 );
|
||||||
if(it.has_update && nusize)
|
if(it.has_update && nusize)
|
||||||
print_size(it.net_size, true, "", 0, ztd::color::none, 2, size_index, "", (int) std::max(log10(ru.max_net_size) - 3*size_index + 0 , 0.0) + 5 );
|
print_size(it.net_size, true, "", 0, ztd::color::none, 2, size_index, "", (int) std::max(log10(ru.max_net_size) - 3*size_index , 0.0) + 5 );
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue