diff options
author | Christian Kampka <christian@kampka.net> | 2015-10-17 15:49:27 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-10-28 14:26:59 +0000 |
commit | b67dec210ad22b1ff9156ead892593c8a2f23925 (patch) | |
tree | 9ff40647d2c2c160d7e37c2a694ec619f81c49c2 /abuild.in | |
parent | 62853e714521d98dead841ba954f2b9778f2ff37 (diff) | |
download | abuild-b67dec210ad22b1ff9156ead892593c8a2f23925.tar.gz abuild-b67dec210ad22b1ff9156ead892593c8a2f23925.tar.bz2 abuild-b67dec210ad22b1ff9156ead892593c8a2f23925.tar.xz abuild-b67dec210ad22b1ff9156ead892593c8a2f23925.zip |
abuild: avoid division by zero when input is zero for calculating human size for packages
This occurs when building meta packages that do not have any package content.
Diffstat (limited to 'abuild.in')
-rw-r--r-- | abuild.in | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -1253,7 +1253,7 @@ scan_pkgconfig_depends() { # read size in bytes from stdin and show as human readable human_size() { awk '{ split("B KB MB GB TB PB", type) - for(i=5; y < 1; i--) + for(i=5; y < 1 && $1 > 0; i--) y = $1 / (2**(10*i)) printf("%.1f %s\n", y, type[i+2]) }' } @@ -2209,4 +2209,3 @@ for i in $install_after; do done cleanup - |