Joe Hansche commented on Bug JENKINS-14537

I've written a sed script that worked to resolve the issue on my existing changelog.xml files. It will need to be tweaked for any file that is not in the same format as mine.

$ cat fix-changelog.sh
#!/bin/sh

sed -n -r -i '1h;1!H;$ {;g;s#<sub-log scm="hudson.plugins.templateproject.ProxySCM">\n<!\[CDATA\[<multi-scm-log>\n<sub-log scm="hudson.plugins.git.GitSCM">\n<!\[CDATA\[((.*\n)*?)\]\]>\n</sub-log>\n<sub-log scm="hudson.plugins.git.GitSCM">\n<!\[CDATA\[((.*\n)*?)\]\]>\n</sub-log>\n</multi-scm-log>\n\]\]>\n</sub-log>#<sub-log scm="hudson.plugins.templateproject.ProxySCM">\n<!\[CDATA\[<multi-scm-log>\n<sub-log scm="hudson.plugins.git.GitSCM">\n<!\[CDATA\[\2\&93;\&93;\&gt;\n</sub-log>\n<sub-log scm="hudson.plugins.git.GitSCM">\n<!\[CDATA\[\4\&93;\&93;\&gt;\n</sub-log>\n</multi-scm-log>\n\]\]>\n</sub-log>#g;p;}' "$1"

Then just pass the filename you want to change into the script, or do all at once:

$ ./fix-changelog.sh path/to/changelog.xml

: or to find and fix all:

$ find . -name 'changelog.xml' -print0 | xargs -0 -n1 ./fix-changelog.sh
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to