diff options
author | eroen <eroen@occam.eroen.eu> | 2014-09-09 16:01:11 +0200 |
---|---|---|
committer | eroen <eroen@occam.eroen.eu> | 2014-09-09 16:01:11 +0200 |
commit | 485d9d2054b603b5dec51e742fa51fee737faed2 (patch) | |
tree | 9144296eabfccc58b2610c6abfe6f0b2bb466aec | |
parent | Fix sorting function (diff) | |
download | eselect-wine-485d9d2054b603b5dec51e742fa51fee737faed2.tar.gz eselect-wine-485d9d2054b603b5dec51e742fa51fee737faed2.tar.bz2 eselect-wine-485d9d2054b603b5dec51e742fa51fee737faed2.zip |
Implement update action
-rw-r--r-- | wine.eselect | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/wine.eselect b/wine.eselect index 3a66b4d..e7a0f93 100644 --- a/wine.eselect +++ b/wine.eselect @@ -119,7 +119,7 @@ do_show() { write_list_start "Active wine version:" if [[ -L ${EROOT}${BINDIR}/wine ]]; then local wine=$(canonicalise "${EROOT}${BINDIR}/wine") - winedir=${EROOT}${PREFIXDIR}/${wine##*/} + local winedir=${EROOT}${PREFIXDIR}/${wine##*/} write_kv_list_entry "${winedir%/}" "" [[ -f ${winedir}/bin/wine ]] \ || write_warning_msg "Symlink target doesn't appear to be valid!" @@ -186,3 +186,32 @@ do_set() { remove_symlinks || die -q "Couldn't remove existing symlinks" set_symlinks "$1" || die -q "Couldn't set a new symlinks" } + +### update action ### + +describe_update() { + echo "Set highest version installed active" +} + +describe_update_parameters() { + echo "[--if-unset]" +} + +describe_update_options() { + echo "--if-unset : Do nothing if active version appears valid" +} + +do_update() { + if [[ ${1} = "--if-unset" ]]; then + if [[ -L ${EROOT}${BINDIR}/wine ]]; then + local wine=$(canonicalise "${EROOT}${BINDIR}/wine") + local winedir=${EROOT}${PREFIXDIR}/${wine##*/} + if [[ -x ${winedir}/bin/wine ]]; then + return 0 + fi + fi + echo "No valid active wine version found, updating" + fi + + do_set 0 || die -q "Couldn't set a new symlinks" +} |