summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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