pacman/scripts/library
Eli Schwartz b5d62d2c91 Port scripts to use libmakepkg's messaging code.
Remove all remnants of library/{output_format,term_colors}.sh

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2018-10-21 20:22:19 +10:00
..
human_to_size.sh scripts/library: add human_to_size 2012-06-25 23:39:12 -05:00
README Port scripts to use libmakepkg's messaging code. 2018-10-21 20:22:19 +10:00
size_to_human.sh paccache: adopt size_to_human 2012-06-25 23:39:46 -05:00

This directory contains code snippets that can be reused by multiple
scripts.  A brief description of each file follows.

human_to_size.sh:
A function to convert human readable sizes (such as "5.3 GiB") to raw byte
equivalents. base10 and base2 suffixes are supported, case sensitively. If
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).