1
0
mirror of https://github.com/limosek/zaf.git synced 2024-11-24 19:39:08 +01:00

On package reinstall, all options are saved

This commit is contained in:
Lukas Macura 2016-12-12 09:56:12 +01:00
parent e8be02436c
commit e826283c85
2 changed files with 4 additions and 1 deletions

View File

@ -152,7 +152,7 @@ zaf_install_plugin() {
zaf_touch "${plugindir}/postinst.need" zaf_touch "${plugindir}/postinst.need"
fi fi
zaf_ctrl_install "$url" "${control}" "${plugindir}" zaf_ctrl_install "$url" "${control}" "${plugindir}"
rm "${plugindir}/params" rm -f "${plugindir}/params"
zaf_touch "${plugindir}/params" zaf_touch "${plugindir}/params"
(zaf_ctrl_get_global_option "${control}" "Parameters"; echo) | \ (zaf_ctrl_get_global_option "${control}" "Parameters"; echo) | \
while read param default; do while read param default; do

3
zaf
View File

@ -239,6 +239,9 @@ reinstall)
[ -z "$1" ] && echo "$0 reinstall plugin [plugin]..." [ -z "$1" ] && echo "$0 reinstall plugin [plugin]..."
for p in $@; do for p in $@; do
if zaf_is_plugin "$p"; then 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)" zaf_remove_plugin "$(basename $p)"
reinstalled=1 reinstalled=1
fi fi