aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNP-Hardass <np.hardass@gmail.com>2017-04-05 22:24:08 -0400
committerNP-Hardass <np.hardass@gmail.com>2017-04-05 22:24:08 -0400
commitfadd0a721b485f9740d3af217d890f01f40c421b (patch)
tree06c3337c449484b3af1365029630db2cf3dd162a /wine.eselect
parentwine.eselect: Fix typo in comment (diff)
downloadeselect-wine-fadd0a721b485f9740d3af217d890f01f40c421b.tar.gz
eselect-wine-fadd0a721b485f9740d3af217d890f01f40c421b.tar.bz2
eselect-wine-fadd0a721b485f9740d3af217d890f01f40c421b.zip
wine.eselect: are_symlinks_valid: convert die to err msg and return 1v0.99_rc10
Allows proper logic for handling update --if-unset
Diffstat (limited to 'wine.eselect')
-rw-r--r--wine.eselect19
1 files 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