echo "Usage:"
echo " $0 <start_point> <version> --build"
echo " $0 <start_point> <version> --publish"
+ echo " $0 <start_point> <version> --update"
echo " $0 <start_point> <version> --clean"
- echo " $0 <start_point> <version> --build --publish --clean [[ORDER SIGNIFICANT]]"
+ echo " $0 <start_point> <version> --build --publish --update --clean [[ORDER SIGNIFICANT]]"
echo "Arguments:"
echo " <start_point> is a branch name (e.g. \"master\")"
echo " <version> is Civi release (e.g. \"4.3.beta2\"); it will become a tag name"
fi
done
- $cmd_gitify all "$git_base_url" "$workdir/$version/export" --l10n
+ $cmd_gitify all "$git_base_url" "$workdir/$version/export" --l10n --branch "$start_point" --skip-gencode
}
#################################################
DM_VERSION=$version
DM_REVISION=$rev
DM_ZIP=$cmd_zip
+ DM_REF_CORE=${start_point}
+ DM_REF_DRUPAL=7.x-${start_point}
+ DM_REF_DRUPAL6=6.x-${start_point}
+ DM_REF_JOOMLA=${start_point}
+ DM_REF_WORDPRESS=${start_point}
+ DM_REF_PACKAGES=${start_point}
" > $workdir/$version/export/distmaker/distmaker.conf
# create a minimal civicrm.settings.php file
echo $version > $latest/latest.txt
}
+#################################################
+## Update Version Info
+function do_update() {
+ echo "VERSION UPDATE: Enter the version that comes after $version (or enter nothing to abort)"
+ read new_ver
+ if [ -n "$new_ver" ]; then
+ cd $workdir/$version/export
+ # create sql upgrade file
+ tpl="CRM/Upgrade/Incremental/sql/$new_ver.mysql.tpl"
+ if [ ! -f $tpl ]; then
+ echo "{* file to handle db changes in $new_ver during upgrade *}" > $tpl
+ fi
+ # escape regex special chars
+ arg=`echo "$version" | sed 's:[]\[\^\$\.\*\/]:\\\\&:g'`
+ for file in xml/version.xml sql/civicrm_generated.mysql; do
+ set -ex
+ git checkout $file
+ sed "s/$arg/$new_ver/" < $file > $file.tmp
+ mv $file.tmp $file
+ set +x
+ done
+ # print the diff directly to the screen
+ git diff | cat
+ echo "Push these changes? y/n"
+ read input
+ if [ "$input" = "y" ]; then
+ set -ex
+ git add xml/version.xml sql/civicrm_generated.mysql $tpl
+ git commit -m "Update version to $new_ver"
+ git push origin "$start_point"
+ set +x
+ else
+ do_update
+ fi
+ else
+ echo "No version entered. Aborting version update."
+ fi
+}
+
#################################################
## Cleanup
function do_cleanup() {
do_publish
set +x
;;
+ --update)
+ set +x
+ do_update
+ ;;
--clean)
set -ex
do_cleanup