Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/freebsd/poudriere.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/share
diff options
context:
space:
mode:
authorBryan Drewery <bryan@shatow.net>2014-04-05 20:44:33 +0400
committerBryan Drewery <bryan@shatow.net>2014-04-05 20:44:33 +0400
commitebda4cb2808fb8b88fa2bfe5f8a8d80f4bbca297 (patch)
tree4497ceb783464fea604f3f0cc6e43b3e9afa0411 /src/share
parent7124fbd9307042c8e91f0887bc6c1d427cda130b (diff)
distclean: Prevent removing all files by accident
MFH
Diffstat (limited to 'src/share')
-rwxr-xr-xsrc/share/poudriere/distclean.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/share/poudriere/distclean.sh b/src/share/poudriere/distclean.sh
index df17a0ae..dea0c8e2 100755
--- a/src/share/poudriere/distclean.sh
+++ b/src/share/poudriere/distclean.sh
@@ -127,6 +127,9 @@ if [ ${file_cnt} -eq 0 ]; then
exit 0
fi
+[ -s "${DISTFILES_LIST}.expected" ] || \
+ err 1 "Something went wrong. All distfiles would have been removed."
+
hsize=$(cat ${DISTFILES_LIST}.unexpected | xargs stat -f %z | \
awk '{total += $1} END {print total}' | \
awk -f ${AWKPREFIX}/humanize.awk