Add ability to auto-merge old configs with new configs during 'ant update'
--------------------------------------------------------------------------

                 Key: DS-1067
                 URL: https://jira.duraspace.org/browse/DS-1067
             Project: DSpace
          Issue Type: New Feature
            Reporter: Tim Donohue
             Fix For: post-1.8.0
         Attachments: ant-update-config-merge.patch

This was an idea that came out of discussion of DS-1060 (now closed)

Essentially, the idea is to provide an optional way to try to "auto-merge" your 
old configurations into the newly updated config files whenever you run 'ant 
update' command.

I created an early version of this idea (see attached 
'ant-update-config-merge.patch'), but it's not perfect.  Ant is a bit limited 
in what it can do in terms of configuration files.  (NOTE: Currently this patch 
changes the behavior of '-Dconfig=[path-to-config]' option such that it 
attempts to *merge* configuration file(s) at the specified 
${dspace.dir}/config/* directories with the default new configuration file(s).  
In the future, we may want to change this patch so that this merging behavior 
is *optional*, e.g. perhaps you would need to specify a "-DmergeConfigs=true" 
flag or similar)

This patch adds the following features:

* If you run 'ant -Dconfig=[path-to-config] update' option, a new Ant 'target' 
called 'retain_main_config_settings' will attempt to retain/migrate most of 
your old Configuration settings (in all your *.properties & *.cfg files, 
including dspace.cfg) (WARNING: There are some exceptions -- see below for more)

There are some exceptions to what configs can be migrated/retained easily 
(based on limitations of Ant). Currently, I have NOT been able to figure out 
how to retain the following settings:
* Settings which are commented out by default in new version of config file
* Settings which do not (or no longer) exist in the new version of config file
* Settings which are multi-line (full value takes up multiple lines, e.g. most 
plugin/crosswalk settings)
* Settings which are not in valid Properties-file format (no XML-based settings 
can be retained at this time)

So, the end result, is that many (but not all) configuration settings can be 
auto-merged during the 'ant update' process.  So, whether you've made 
customizations to your dspace.cfg, log4j.properties, anything in 
/config/modules/*, etc. those customized settings will be auto-merged into the 
new version of the configuration file (and your old copy of the configuration 
file will be moved to a *.old file).  Again, this merging is not 100% perfect 
(which is why the old configuration is always first copied to a *.old file), 
but it is able to retain many of your configurations for you in an automated 
fashion.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.duraspace.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to