This page will be updated once the simple upgrade case is nailed down
FIXME: define what is complex upgrade vs simple upgrade
FIXME: explain default value problem
Only customized values are dumped with -dump option:
$ config-edit-approx -dump max_wait=12 distributions:debian=http://ftp.fr.debian.org/debian -
In old-prerm script, customized values can be saved as:
config-edit -model Approx -dump /var/lib/config-model/upgrade/etc/approx/approx.cds
or (
still being discussed on debian-perl list)
config-edit -model Approx -save_for_upgrade
Actual config-edit command may change
and reloaded in postinst script with
config-edit -model Approx -load /etc/approx/approx.cds -ui none
or (
still being discussed on debian-perl list)
config-edit -model Approx -upgrade
FIXME: how to use a helper script (dh_ like) that will help in setting up the instructions mentioned above in the package scripts.
Complex upgrade case may require to save config data before package upgrade in debian/approx.prerm script:
cds_file=/etc/approx/approx.cds
cfg_file=/etc/approx/approx.conf
case "$1" in
remove)
if [ -e $cds_file ] ; then
rm -rf $cds_file ;
fi
;;
*)
if [ -e $cfg_file ] ; then
config-edit -model Approx -dump /etc/approx/approx.cds || true
fi
;;
esac
In this case, saved data needs to be loaded in debian/approx.postinst :
if [ -e /etc/approx/approx.cds ] ; then
config-edit -model Approx -load /etc/approx/approx.cds -ui none \
&& rm -f /etc/approx/approx.cds
fi
package upgrade
during upgrade of old approx package (without config-model patch) with new approx package (with patch), approx.conf is not touched by Config::Model.
- when upgrading from a patched approx to a patched approx:
- all customized values of approx.conf are dumped in approx.cds by old-prerm
new-postinst loads approx.cds using new configuration model and writes back approx.conf
package downgrade
Mostly the same scenario as upgrade apply except:
- when downgrading from a patched approx to a plain approx:
- all customized values of approx.conf are dumped in approx.cds by old-prerm
- new-postinst leaves approx.cds alone
package purge
Any leftover approx.cds is removed by prerm script
More complex upgrade cases
So far, we've reviewed the simple upgrade cases where no configuration changes were brought by package changes.
But, Config::Model can also handle more complex cases where:
- new parameter are introduced or old parameters are removed by the application
- new parameter with mandatory values are added by the application (require user interaction)
- Debian packager changes a default value
- parameter names are changed
- parameter allowed value are changed
Reader, feel free to add your upgrade case
These cases are not required for Approx model, but they will be for other packages.
