From fadd0a721b485f9740d3af217d890f01f40c421b Mon Sep 17 00:00:00 2001 From: NP-Hardass Date: Wed, 5 Apr 2017 22:24:08 -0400 Subject: wine.eselect: are_symlinks_valid: convert die to err msg and return 1 Allows proper logic for handling update --if-unset --- wine.eselect | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/wine.eselect b/wine.eselect index 1e4b135..8d2f8fc 100644 --- a/wine.eselect +++ b/wine.eselect @@ -83,7 +83,8 @@ are_symlinks_valid() { local possible_vars=( bin man ) local symlink_vars=$(load_config "${CONFIG_DIR}/links/${v}" symlink_dirs) if [[ -z "${symlink_vars}" ]]; then - die -q "Missing any configured symlink_dirs" + write_error_msg "Missing any configured symlink_dirs" + return 1 fi local var @@ -96,7 +97,8 @@ are_symlinks_valid() { fi done if [[ ! -z ${symlink_vars} ]]; then - die -q "Config contains unknown symlink_dirs ${symlink_vars}" + write_error_msg "Config contains unknown symlink_dirs ${symlink_vars}" + return 1 fi symlink_vars=$(load_config "${CONFIG_DIR}/links/${v}" symlink_dirs) @@ -109,18 +111,20 @@ are_symlinks_valid() { fi for symlink in ${symlinks[@]}; do if [[ ! -L ${symlink} ]]; then - die -q "${symlink} is not a symlink" + write_error_msg "${symlink} is not a symlink" + return 1 else local file=$(canonicalise ${symlink}) if [[ ! -e "${file}" ]]; then - die -q "${symlink} points to nonexistant ${file}" + write_error_msg "${symlink} points to nonexistant ${file}" + return 1 # Handle bin separately because symlinks don't go to wine_${var} elif [[ "${var}" == "bin" ]]; then local path="${symlink%${v_arg#-}}${tgt#wine}" if [[ "${file}" != "${path}" ]]; then write_error_msg "${symlink} points to ${file}" - write_error_msg "${path}" - die -q "which doesn't appear to be the proper link" + write_error_msg "which doesn't appear to be the proper link" + return 1 fi else local path=wine_${var} @@ -128,7 +132,8 @@ are_symlinks_valid() { path=$(canonicalise "${path}") if [[ "${file}" != "${path%/}"/* ]]; then write_error_msg "${symlink} points to ${file}" - die -q "which doesn't appear to be part of wine" + write_error_msg "which doesn't appear to be part of wine" + return 1 fi fi fi -- cgit v1.2.3-65-gdbad