summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2016-11-15 09:49:49 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2016-11-15 09:49:49 +0000
commit3f3faf10eef23c8c66c62f28b3a2b23633344a01 (patch)
treedd59caf9f8a05324b9d03d2ade4536e042d730b7 /usr.sbin
parentcc470637e4d9e4cdfafb8cd13e4c5bed35a3ccca (diff)
Double the required size to make sure we have enough space for install(1) safe
copy, the rollback tarball and in case we add new files.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/syspatch/syspatch.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/syspatch/syspatch.sh b/usr.sbin/syspatch/syspatch.sh
index e18b87c922b..a0ba97eac44 100644
--- a/usr.sbin/syspatch/syspatch.sh
+++ b/usr.sbin/syspatch/syspatch.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: syspatch.sh,v 1.49 2016/11/14 15:45:40 ajacoutot Exp $
+# $OpenBSD: syspatch.sh,v 1.50 2016/11/15 09:49:48 ajacoutot Exp $
#
# Copyright (c) 2016 Antoine Jacoutot <ajacoutot@openbsd.org>
#
@@ -86,12 +86,12 @@ checkfs()
${_files})
for _d in $(printf '%s\n' ${_dev} | sort -u); do
- # make sure the fs is local and RW
mount | grep -v read-only | grep -q "^/dev/${_d} " ||
sp_err "Remote or read-only filesystem, aborting"
- # make sure we have enough space
_df=$(df -Pk | grep "^/dev/${_d} " | tr -s ' ' | cut -d ' ' -f4)
- _sz=$(($((${_d}))/1024))
+ # double the required size to make sure we have enough space for
+ # install(1) safe copy, the rollback tarball and new files
+ _sz=$(($((${_d}))/1024*2))
[[ ${_df} -gt ${_sz} ]] ||
sp_err "No space left on device ${_d}, aborting"
done