[xen-tools-dev] Migration and Consolidation (-common)
Dmitry Nedospasov
dmitry at nedos.net
Sun Oct 31 11:49:38 CET 2010
Hey Guys,
I think we should hammer out a timeline for doing a major overhaul of
the scripts and more importantly, how we're going to do it (i.e. what
the hooks are gonna be named).
As you all know we've been planning to minimize code duplication mainly
by consolidating the scripts into "dpkg-common", "rpm-common" etc...
The question is then how to handle the parts that are release or distro
specific (i.e. where Lucid differs from Hardy). Here I see 3 options:
1.) Have distro specific scripts in a separate per-distro hooks
directory (like it is now, but with also with -common scripts)
+ We could have these scripts take priority over the "default"
"common" (dpkg-/rpm-) scripts
+ If a distro-specific hook comes along that isn't present in
"common", we can just add it to that distro directory
- Will still lead to some code duplication (consider install-kernel)
- Might lead to more confusion than we have now
A slight variation on this would be to run the distro specific scripts
later and "fix" what the common scripts got wrong, but to me this isn't
very attractive.
2.) Get rid of the distro specific directory folder all together and
pass the dist parameter to the "common" scripts, and have a switch
case install the distro specific parts.
+ Might yield code that is more readable and better documented
- Larger "common" scripts
- Distro-specific hooks are harder to implement
I find that the last "-" in this case is still a big issue, I can easily
imagine us seeking to add a script in the future that was is not present
in the "common" scripts.
3.) Create a call in the scripts to call the distro-specific parts.
+ Would solve code duplication problems
- Manageability, it might be necessary to retroactively move parts out
of common, leading to a similar situation to what we have now
- Readability, or lack there of
Anyway, any of the three are better than what we have right now. I
personally like 1 because it seems to be the most modular option, 2
however would have the least code duplication.
I'm eager to hear what you all think! Remember, I think in some ways it
would make sense to make a mix of all 3, but for the purposes of
discussion I tried to make them as mutually-excluding as possible ;)
All the best,
D.
P.S. On a side note, do we pass dist to the role scripts? This is
someting we should do if we don't do that yet.
--
Dmitry Nedospasov <dmitry at nedos.net> -- Twitter: @nedos
Web: http://nedos.net -- Github: http://github.com/nedos
More information about the xen-tools-dev
mailing list