From e826283c8579c17df06c97021c78d87b1d12c4e5 Mon Sep 17 00:00:00 2001 From: Lukas Macura Date: Mon, 12 Dec 2016 09:56:12 +0100 Subject: [PATCH] On package reinstall, all options are saved --- lib/plugin.lib.sh | 2 +- zaf | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/plugin.lib.sh b/lib/plugin.lib.sh index 8546bf4..3558e97 100644 --- a/lib/plugin.lib.sh +++ b/lib/plugin.lib.sh @@ -152,7 +152,7 @@ zaf_install_plugin() { zaf_touch "${plugindir}/postinst.need" fi zaf_ctrl_install "$url" "${control}" "${plugindir}" - rm "${plugindir}/params" + rm -f "${plugindir}/params" zaf_touch "${plugindir}/params" (zaf_ctrl_get_global_option "${control}" "Parameters"; echo) | \ while read param default; do diff --git a/zaf b/zaf index 0ec84a5..026696c 100755 --- a/zaf +++ b/zaf @@ -239,6 +239,9 @@ reinstall) [ -z "$1" ] && echo "$0 reinstall plugin [plugin]..." for p in $@; do if zaf_is_plugin "$p"; then + (zaf_ctrl_get_global_option "${ZAF_PLUGINS_DIR}/${p}" "Parameters"; echo) | while read param; do + eval export ZAF_${p}_${param}=$(zaf_get_plugin_parameter "${ZAF_PLUGINS_DIR}/${p}" $param) + done zaf_remove_plugin "$(basename $p)" reinstalled=1 fi