summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-03-13 17:38:55 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-03-13 17:38:55 (EDT)
commit9d5cd1ae61eea5b4034287300c382ed591cf374a (patch)
tree0e4849e460801ae7507fb9f06f3b5c620574c839
parentc18112a890bd884424622354677fbfb82bbe8b65 (diff)
ob-installplatconf: Add return statements after ob_error() calls
-rw-r--r--src/ob-installplatconf.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/ob-installplatconf.sh b/src/ob-installplatconf.sh
index 2caa5cf..c4a4765 100644
--- a/src/ob-installplatconf.sh
+++ b/src/ob-installplatconf.sh
@@ -32,13 +32,17 @@ copy_config()
while read -r src dest; do
if [ -z "${src}" ] || [ -z "${dest}" ]; then
ob_error "$(ob_get_msg 'bad_config_syntax')" "${list}"
+ return 1
fi
# Make sure the destination directory exists.
if [ "x${dest%/*}" != "x${dest}" ]; then
- mkdir -p "${dest_base}/${dest%/*}" || ob_error \
- "$(ob_get_msg 'cant_make_config_dest_dir')" \
- "${dest%/*}"
+ if ! mkdir -p "${dest_base}/${dest%/*}"; then
+ ob_error "$(ob_get_msg \
+ 'cant_make_config_dest_dir')" \
+ "${dest%/*}"
+ return 1
+ fi
fi
# Find the config package files.
@@ -56,12 +60,15 @@ copy_config()
# This shouldn't happen unless the package maintainer neglected to
# add the config package to the package's Build-Depends field.
ob_error "$(ob_get_msg 'no_config_dir')"
+ return 1
fi
# Copy the config file(s).
ob_info "$(ob_get_msg 'copying_config_file')" "${src}" "${dest}"
- cp -p "${src_base}/${src}" "${dest_base}/${dest}" || \
+ if ! cp -p "${src_base}/${src}" "${dest_base}/${dest}"; then
ob_error "$(ob_get_msg 'cant_copy_config_file')"
+ return 1
+ fi
done <"../${list}"
return 0