On Mon, Dec 07, 2009 at 10:57:56PM +0100, Dominique Dumont wrote: > A model for Config::Model is to a configuration file what a schema is to an > XML file: a description of the structure and constraint of the semantic data > of the file.
Fair enough. So, in your terminology, a model is the schema. How do you call instances? I'll use "instances" in the rest of this mail :-) Now that that is clear, which kind of migrations of configuration file can you provide on top of Config::Model. Given that models contain default values, I believe it would be pretty easy to provide change of default values, it would be enough to change them in m_{i+1}, right? Still, my recurring question has left unanswered, I swear this is the last time I pose it. Does Config::Model permit to *programmatically* apply more complex modification at upgrade time? Let's say I want to, at the same time during an upgrade: - change a default value from "yes" to "no" - add 1 to a given set of integer values wrt what the user configured by hand (e.g. because there was an off-by-one sort of semantics in past upstream configuration, which has been changed now) The second case is a bit more tricky, because you can easily fix default values, but you really want to fix also user-customized values. To achieve that, Config::Model would need to provide me (as the package maintainer) the ability to write a small perl snippet where I've access to the currently installed configuration file (which conforms to the old version of the model, let's say m_i), where I can migrate it to the new version of the model (let's say m_{i+1}), and also manipulate it as a tree to change the values I want. This of course is just an example, my general question was whether I can only migrate from m_i to m_{i+1} or also pipe in between some custom programmed logics. TIA. Cheers. -- Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7 z...@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/ Dietro un grande uomo c'è ..| . |. Et ne m'en veux pas si je te tutoie sempre uno zaino ...........| ..: |.... Je dis tu à tous ceux que j'aime
signature.asc
Description: Digital signature