diff options
author | Ting-Wei Lan <lantw@src.gnome.org> | 2016-04-09 12:27:27 +0800 |
---|---|---|
committer | Ting-Wei Lan <lantw@src.gnome.org> | 2016-04-09 12:27:27 +0800 |
commit | 1abe50dabbfb5128d14142105f448e72c180a8c4 (patch) | |
tree | df9f9c9145ec2339393294b79862e68fc621336e | |
parent | 339e978c755c3defb21cd8e5ed1297e23b807e34 (diff) | |
download | freebsd-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.sh | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -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 |