diff options
Diffstat (limited to 'main/abuild/0001-abuild-avoid-division-by-zero-when-input-is-zero-for.patch')
-rw-r--r-- | main/abuild/0001-abuild-avoid-division-by-zero-when-input-is-zero-for.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/main/abuild/0001-abuild-avoid-division-by-zero-when-input-is-zero-for.patch b/main/abuild/0001-abuild-avoid-division-by-zero-when-input-is-zero-for.patch new file mode 100644 index 0000000000..fcf8c6f263 --- /dev/null +++ b/main/abuild/0001-abuild-avoid-division-by-zero-when-input-is-zero-for.patch @@ -0,0 +1,32 @@ +From b67dec210ad22b1ff9156ead892593c8a2f23925 Mon Sep 17 00:00:00 2001 +From: Christian Kampka <christian@kampka.net> +Date: Sat, 17 Oct 2015 15:49:27 +0200 +Subject: [PATCH] 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. +--- + abuild.in | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/abuild.in b/abuild.in +index 3b6fe04..0dd8f9a 100644 +--- a/abuild.in ++++ b/abuild.in +@@ -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 +- +-- +2.6.1 + |