summaryrefslogtreecommitdiffstats
path: root/scripts/library
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2018-11-04 01:00:07 +0100
committerAllan McRae <allan@archlinux.org>2018-11-27 13:48:43 +0100
commit926eb345c26690ca93b6483ac949612c9b53e9db (patch)
tree9980f4f4b0fe3898e22095e4dd706a6724a7da38 /scripts/library
parentc41222837d76d550921a70dd95c509537031102c (diff)
downloadpacman-926eb345c26690ca93b6483ac949612c9b53e9db.tar.gz
pacman-926eb345c26690ca93b6483ac949612c9b53e9db.tar.xz
buildsys: remove size_to_human
This was only ever used by paccache, and paccache has since been moved to pacman-contrib.
Diffstat (limited to 'scripts/library')
-rw-r--r--scripts/library/README4
-rw-r--r--scripts/library/size_to_human.sh22
2 files changed, 0 insertions, 26 deletions
diff --git a/scripts/library/README b/scripts/library/README
index 2b3a97bc..b99b0bc8 100644
--- a/scripts/library/README
+++ b/scripts/library/README
@@ -8,7 +8,3 @@ successful, the converted byte value is written to stdout and the function
returns 0. If an error occurs, nothing in written and the function returns 1.
Results may be inaccurate when using a broken implementation of awk, such
as mawk or busybox awk.
-
-size_to_human.sh:
-The reverse of human_to_size, this function takes an integer byte size and
-prints its in human readable format, with SI prefixes (e.g. MiB, TiB).
diff --git a/scripts/library/size_to_human.sh b/scripts/library/size_to_human.sh
deleted file mode 100644
index 1d13eeb4..00000000
--- a/scripts/library/size_to_human.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-size_to_human() {
- awk -v size="$1" '
- BEGIN {
- suffix[1] = "B"
- suffix[2] = "KiB"
- suffix[3] = "MiB"
- suffix[4] = "GiB"
- suffix[5] = "TiB"
- suffix[6] = "PiB"
- suffix[7] = "EiB"
- count = 1
-
- while (size > 1024) {
- size /= 1024
- count++
- }
-
- sizestr = sprintf("%.2f", size)
- sub(/\.?0+$/, "", sizestr)
- printf("%s %s", sizestr, suffix[count])
- }'
-}