summaryrefslogtreecommitdiffstats
path: root/FUNCTIONS
diff options
context:
space:
mode:
authorTreeve Jelbert2016-02-17 17:43:54 +0100
committerTreeve Jelbert2016-02-17 17:43:54 +0100
commit5326b9edfd4b0165161de78cbc0e937c43783ecd (patch)
treeafcb85b65c8eddcc8c0b91ce897a9b5eb2c943bd /FUNCTIONS
parentd1f89620c1604647b950d735365f90ca3a2ec23f (diff)
FUNCTIONS: add chk_space
Diffstat (limited to 'FUNCTIONS')
-rwxr-xr-xFUNCTIONS12
1 files changed, 12 insertions, 0 deletions
diff --git a/FUNCTIONS b/FUNCTIONS
index aedb6faa48..7115c44d9a 100755
--- a/FUNCTIONS
+++ b/FUNCTIONS
@@ -912,3 +912,15 @@ function check_dependees_versionjump()
. $GRIMOIRE/glselect.function
. $GRIMOIRE/bzr_download.function
. $GRIMOIRE/hg_download.function
+
+
+# some spells need lots of disk space
+# chk_space looks for $1 GB
+chk_space() {
+SPACE=`df --output=avail,target -l -BG|grep " /$" |cut -dG -f1 |sed "s/ //g"`
+if [[ $SPACE -lt "$1" ]];then
+ echo "${PROBLEM_COLOR}insufficient space on root device. $SPELL requires >= $1 GB${DEFAULT_COLOR}"
+ return 1
+fi
+return 0
+}