[Zope-CMF] GenericSetup: Apply profile dependencies only once

Maurits van Rees m.van.rees at zestsoftware.nl
Tue Sep 8 00:43:02 CEST 2015


Hi,

Can someone have a look at this pull request I made?
https://github.com/zopefoundation/Products.GenericSetup/pull/16

It does two changes.  I think they are both sane, but the first one 
could be tricky, so feedback would be good.  This is the change:

Dependency profiles from metadata.xml that are already applied, are not 
applied again. Instead, its upgrade steps, if any, are applied. In code 
you can choose the old behavior of always applying the dependencies, by 
calling runAllImportStepsFromProfile with always_apply_profiles=True. Or 
you can choose to be happy with any applied version and ignore any 
upgrade steps, by using upgrade_dependencies=False. Note that these 
arguments cannot both be True.

Less tricky is the second change:

Be more forgiving when dealing with profile ids with or without profile- 
at the start. All functions that accept a profile id argument and only 
work when the id does not have this string at the start, will now strip 
it off if it is there. For example, getLastVersionForProfile will give 
the same answer whether you ask it for the version of profile id foo or 
profile-foo.

For more background info see the pull request.  I added tests and all 
tests pass.

Thanks,


-- 
Maurits van Rees: http://maurits.vanrees.org/
Zest Software: http://zestsoftware.nl



More information about the Zope-CMF mailing list