diff options
author | Ulrich Müller <ulm@gentoo.org> | 2007-03-27 12:37:47 +0000 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2007-03-27 12:37:47 +0000 |
commit | 202509f38e753661418f6a299f1d324d58a92b42 (patch) | |
tree | 147ec96d29c464a21100dc21f0105d9b2dc930f1 | |
parent | Call env.eselect to update the environment from env.d files. (diff) | |
download | emacs-tools-202509f38e753661418f6a299f1d324d58a92b42.tar.gz emacs-tools-202509f38e753661418f6a299f1d324d58a92b42.tar.bz2 emacs-tools-202509f38e753661418f6a299f1d324d58a92b42.zip |
Brought do_set and do_update more in line.
svn path=/emacs-extra/eselect-emacs/; revision=179
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | emacs.eselect | 32 |
2 files changed, 12 insertions, 21 deletions
@@ -49,3 +49,4 @@ Version 0.5 (24 Mar 2007) Removed -n option in emacsclient.desktop. 27 Mar 2007 Call env.eselect to update the environment from env.d files. + Brought do_set and do_update more in line. diff --git a/emacs.eselect b/emacs.eselect index 6ff6fd9..fee497c 100644 --- a/emacs.eselect +++ b/emacs.eselect @@ -176,25 +176,16 @@ describe_set_parameters() { } do_set() { - if [[ -z "${1}" ]]; then - die -q "You didn't tell me what to set the symlink to" - - elif [[ -n "${2}" ]]; then - die -q "Too many parameters" - - elif [[ -L "${ROOT}/usr/bin/emacs" ]]; then - if ! remove_symlinks; then - die -q "Couldn't remove existing symlink" - elif ! set_symlinks "${1}"; then - die -q "Couldn't set a new symlink" - fi + [[ -z "${1}" ]] && die -q "You didn't tell me what to set the symlink to" + [[ -n "${2}" ]] && die -q "Too many parameters" + if [[ -L "${ROOT}/usr/bin/emacs" ]]; then + remove_symlinks || die -q "Couldn't remove existing symlink" elif [[ -e "${ROOT}/usr/bin/emacs" ]]; then die -q "Sorry, ${ROOT}/usr/bin/emacs confuses me" - - else - set_symlinks "${1}" || die -q "Couldn't set a new symlink" fi + + set_symlinks "${1}" || die -q "Couldn't set a new symlink" } ### update action ### @@ -212,12 +203,11 @@ do_update() { die -q "Usage error" if [[ -L "${ROOT}/usr/bin/emacs" ]]; then - [[ ${1} == "--if-unset" && - -e "$(canonicalise ${ROOT}/usr/bin/emacs)" ]] && return - remove_symlinks || die -q "Couldn't remove existing link" - fi - if [[ -e "${ROOT}/usr/bin/emacs" ]]; then - die -q "Couldn't set a new symlink" + [[ ${1} == "--if-unset" \ + && -e "$(canonicalise ${ROOT}/usr/bin/emacs)" ]] && return + remove_symlinks || die -q "Couldn't remove existing symlink" + elif [[ -e "${ROOT}/usr/bin/emacs" ]]; then + die -q "Sorry, ${ROOT}/usr/bin/emacs confuses me" fi local targets=( $(find_targets) ) |