diff -urN portage-3.0.82-orig/bin/phase-functions.sh portage-3.0.82/bin/phase-functions.sh --- portage-3.0.82-orig/bin/phase-functions.sh 2026-08-22 14:02:19 +0900 +++ portage-3.0.82/bin/phase-functions.sh 2026-08-24 01:21:29 +0900 @@ -683,14 +683,14 @@ printf "%*s" ${width} "${s1}" } - # transform number in KiB into MiB, GiB or TiB based on size + # transform number in KiB into kB, MB, GB or TB based on size human() { local s1=$1 - local units=( KiB MiB GiB TiB ) + local units=( kB MB GB TB ) - s1=$((s1 * 10)) - while [[ ${s1} -gt 10240 && ${#units[@]} -gt 1 ]] ; do - s1=$((s1 / 1024 )) + s1=$((s1 * 10240 / 1000)) + while [[ ${s1} -gt 10000 && ${#units[@]} -gt 1 ]] ; do + s1=$((s1 / 1000 )) units=( ${units[@]:1} ) done @@ -704,9 +704,9 @@ local s2=$2 local out="$(padl "${s1}" "${s2}") KiB" - if [[ ${s1} -gt 1024 ]] ; then + if [[ ${s1} -ge 1000 ]] ; then s1=$(human ${s1}) - if [[ ${s2} -gt 1024 ]] ; then + if [[ ${s2} -ge 1000 ]] ; then s2=$(human ${s2}) s1=$(padl "${s1}" "${s2}") fi diff -urN portage-3.0.82-orig/lib/portage/localization.py portage-3.0.82/lib/portage/localization.py --- portage-3.0.82-orig/lib/portage/localization.py 2026-08-22 14:02:19 +0900 +++ portage-3.0.82/lib/portage/localization.py 2026-08-24 01:22:36 +0900 @@ -32,14 +32,14 @@ def localized_size(num_bytes): """ Return pretty localized size string for num_bytes size - (given in bytes). The output will be in kibibytes. + (given in bytes). The output will be in kilobytes. """ - # always round up, so that small files don't end up as '0 KiB' - num_kib = math.ceil(num_bytes / 1024) + # always round up, so that small files don't end up as '0 kB' + num_kb = math.ceil(num_bytes / 1000) try: - formatted_num = locale.format_string("%d", num_kib, grouping=True) + formatted_num = locale.format_string("%d", num_kb, grouping=True) except UnicodeDecodeError: # failure to decode locale data - formatted_num = str(num_kib) - return f"{formatted_num} KiB" + formatted_num = str(num_kb) + return f"{formatted_num} kB"