summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw@src.gnome.org>2016-04-09 12:27:27 +0800
committerTing-Wei Lan <lantw@src.gnome.org>2016-04-09 12:27:27 +0800
commit1abe50dabbfb5128d14142105f448e72c180a8c4 (patch)
treedf9f9c9145ec2339393294b79862e68fc621336e
parent339e978c755c3defb21cd8e5ed1297e23b807e34 (diff)
downloadfreebsd-gnome-livecd-1abe50dabbfb5128d14142105f448e72c180a8c4.tar.gz
freebsd-gnome-livecd-1abe50dabbfb5128d14142105f448e72c180a8c4.tar.zst
freebsd-gnome-livecd-1abe50dabbfb5128d14142105f448e72c180a8c4.zip
Fix messages in variable checks
assert_empty is renamed to assert_not_empty to make it less confusing.
-rw-r--r--build.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/build.sh b/build.sh
index eec075a..e7d36c3 100644
--- a/build.sh
+++ b/build.sh
@@ -120,22 +120,29 @@ assert_dir_or_file () {
exit 1
fi
}
-assert_empty () {
+assert_has_pkg () {
if [ -z "$2" ]; then
echo "Variable '$1' is empty."
echo "If no package have to be installed, set it to 'pkg'."
exit 1
fi
}
+assert_not_empty () {
+ if [ -z "$2" ]; then
+ echo "Variable '$1' is empty."
+ exit 1
+ fi
+}
assert_dir_or_file src "${src}"
assert_dir_or_file root "${root}"
assert_dir_or_file cdroot "${cdroot}"
assert_dir_or_file image "${image}"
assert_dir_or_file repo "${repo}"
-assert_empty pkgs "${pkgs}"
-assert_empty vol "${vol}"
+assert_has_pkg pkgs "${pkgs}"
+assert_not_empty vol "${vol}"
unset assert_dir_or_file
-unset assert_empty
+unset assert_has_pkg
+unset assert_not_empty
# Check whether the volume name is too long
if [ "${#vol}" -gt "31" ]; then