Shireesh Anjal has uploaded a new change for review. Change subject: engine: upgrade.sh for upgrading multiple DBs ......................................................................
engine: upgrade.sh for upgrading multiple DBs Currently, the upgrade.sh script creates a md5sum file, which is used for comparing with md5sum of latest files to identify whether an upgrade is required. However this file name is not db-specific, and hence upgrading one DB makes it think that all other DBs are also upgraded. Modified the script to create the md5sum file with a DB-specific name so that all DBs can be upgraded by passing the -d option to the script. Change-Id: I63f3c34a822508d266a4b3e1582d7e9539d08c39 Signed-off-by: Shireesh Anjal <san...@redhat.com> --- M backend/manager/dbscripts/dbfunctions.sh 1 file changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/46/8146/1 diff --git a/backend/manager/dbscripts/dbfunctions.sh b/backend/manager/dbscripts/dbfunctions.sh index 09a3368..572199a 100755 --- a/backend/manager/dbscripts/dbfunctions.sh +++ b/backend/manager/dbscripts/dbfunctions.sh @@ -194,17 +194,19 @@ is_view_or_sp_changed() { files=$(get_files "upgrade" 3) - md5sum $files create_*views.sql *_sp.sql > .scripts.md5.tmp - diff -s -q .scripts.md5 .scripts.md5.tmp >& /dev/null + md5sum_file=.${DATABASE}.scripts.md5 + md5sum_tmp_file=${md5sum_file}.tmp + md5sum $files create_*views.sql *_sp.sql > ${md5sum_tmp_file} + diff -s -q ${md5sum_file} ${md5sum_tmp_file} >& /dev/null result=$? # 0 - identical , 1 - differ , 2 - error if [ $result -eq 0 ] ; then - rm -f .scripts.md5.tmp + rm -f ${md5sum_tmp_file} else # there is a diff or md5 file does not exist - mv -f .scripts.md5.tmp .scripts.md5 + mv -f ${md5sum_tmp_file} ${md5sum_file} fi return $result } -- To view, visit http://gerrit.ovirt.org/8146 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I63f3c34a822508d266a4b3e1582d7e9539d08c39 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Shireesh Anjal <san...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches