From 9d5cd1ae61eea5b4034287300c382ed591cf374a Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 13 Mar 2019 17:38:55 -0400 Subject: ob-installplatconf: Add return statements after ob_error() calls --- (limited to 'src/ob-installplatconf.sh') 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 -- cgit v0.9.1