@@ -58,7 +58,6 @@ while [ $# -gt 0 ] ; do
5858 git branch ci
5959 branch=" ci"
6060 fi
61- version=" ${VERSION_SERIES} +ci"
6261 ;;
6362 --help)
6463 echo " Usages:"
@@ -96,11 +95,18 @@ while [ $# -gt 0 ] ; do
9695 shift
9796done
9897
99- if [ -z " $version " -o -z " $ branch" ] ; then
100- echo " Branch and version have to be specified!"
98+ if [ -z " $branch " ]; then
99+ echo " Branch must be specified!"
101100 exit 1
102101fi
103102
103+ if [ -z " $version " -a $do_ci -eq 0 ]; then
104+ echo " Version must be specified!"
105+ exit 1
106+ fi
107+
108+ kit_prefix=" phpMyAdmin-$version "
109+
104110# Checks whether remote branch has local tracking branch
105111ensure_local_branch () {
106112 if ! git branch | grep -q ' ^..' " $1 " ' $' ; then
@@ -339,25 +345,33 @@ VERSION_FILE=libraries/classes/Version.php
339345
340346# Keep in sync with update-po script
341347fetchReleaseFromFile () {
342- php -r " define('VERSION_SUFFIX', ''); require_once('libraries/classes/Version.php'); echo \PhpMyAdmin\Version::VERSION;"
348+ SUFFIX=" ${1:- } "
349+ php -r " define('VERSION_SUFFIX', '$SUFFIX '); require_once('$VERSION_FILE '); echo \PhpMyAdmin\Version::VERSION;"
343350}
344351
345352fetchVersionSeriesFromFile () {
346- php -r " define('VERSION_SUFFIX', ''); require_once('libraries/classes/Version.php '); echo \PhpMyAdmin\Version::SERIES;"
353+ php -r " define('VERSION_SUFFIX', ''); require_once('$VERSION_FILE '); echo \PhpMyAdmin\Version::SERIES;"
347354}
348355
356+ VERSION_FROM_FILE=" $( fetchReleaseFromFile) "
349357VERSION_SERIES_FROM_FILE=" $( fetchVersionSeriesFromFile) "
350358
359+ if [ $do_ci -eq 1 ]; then
360+ VERSION_FROM_FILE=" $( fetchReleaseFromFile ' +ci' ) "
361+ version=" ${VERSION_FROM_FILE} "
362+ fi
363+
351364if [ " ${VERSION_SERIES_FROM_FILE} " != " ${VERSION_SERIES} " ]; then
352365 echo " This script can not handle ${VERSION_SERIES_FROM_FILE} version series."
353366 echo " Only ${VERSION_SERIES} version series are allowed, please use your target branch directly or another branch."
354367 echo " By changing branches you will have a release script that was designed for your version series."
355368 exit 1;
356369fi
357370
358- echo " The actual configured release is: $( fetchReleaseFromFile) "
371+ echo " The actual configured release is: $VERSION_FROM_FILE "
372+ echo " The actual configured release series is: $VERSION_SERIES_FROM_FILE "
359373
360- if [ $do_ci -eq 0 -a - $do_daily -eq 0 ] ; then
374+ if [ $do_ci -eq 0 -a $do_daily -eq 0 ] ; then
361375 cat << END
362376
363377Please ensure you have incremented rc count or version in the repository :
@@ -378,16 +392,16 @@ END
378392 if [ " $do_release " != ' y' ]; then
379393 exit 100
380394 fi
395+ echo " The actual configured release is now: $( fetchReleaseFromFile) "
381396fi
382397
383- echo " The actual configured release is now: $( fetchReleaseFromFile) "
384-
385398# Create working copy
386399mkdir -p release
387400git worktree prune
388- workdir=release/phpMyAdmin-$version
401+ workdir_name=phpMyAdmin-$version
402+ workdir=release/$workdir_name
389403if [ -d $workdir ] ; then
390- echo " Working directory '$workdir ' already exists, please move it out of way"
404+ echo " Working directory '$workdir ' already exists, please move it out of the way"
391405 exit 1
392406fi
393407
@@ -407,6 +421,11 @@ if [ $do_daily -eq 1 ] ; then
407421 echo ' * setting the version suffix for the snapshot'
408422 sed -i " s/'versionSuffix' => '.*'/'versionSuffix' => '+$today_date .$git_head_short '/" libraries/vendor_config.php
409423 php -l libraries/vendor_config.php
424+
425+ # Fetch it back and refresh $version
426+ VERSION_FROM_FILE=" $( fetchReleaseFromFile " +$today_date .$git_head_short " ) "
427+ version=" ${VERSION_FROM_FILE} "
428+ echo " The actual configured release is: $VERSION_FROM_FILE "
410429fi
411430
412431# Check release version
@@ -430,9 +449,10 @@ if [ $do_ci -eq 0 -a -$do_daily -eq 0 ] ; then
430449fi
431450
432451# Cleanup release dir
433- LC_ALL=C date -u > RELEASE-DATE-${ version}
452+ LC_ALL=C date -u > RELEASE-DATE-$version
434453
435454# Building documentation
455+ echo " * Running sphinx-build (version: $( sphinx-build --version) )"
436456echo " * Generating documentation"
437457LC_ALL=C make -C doc html
438458find doc -name ' *.pyc' -print0 | xargs -0 -r rm -f
@@ -579,11 +599,11 @@ cd ..
579599for kit in $KITS ; do
580600 echo " * Building kit: $kit "
581601 # Copy all files
582- name=phpMyAdmin- $version -$kit
583- cp -r phpMyAdmin- $version $name
602+ name=$kit_prefix -$kit
603+ cp -r $workdir_name $name
584604
585605 # Cleanup translations
586- cd phpMyAdmin- $version - $kit
606+ cd $name
587607 ./scripts/lang-cleanup.sh $kit
588608
589609 # Remove tests, source code,...
@@ -655,12 +675,12 @@ for kit in $KITS ; do
655675done
656676
657677# Cleanup
658- rm -r phpMyAdmin- ${version}
678+ rm -r $workdir_name
659679git worktree prune
660680
661681# Signing of files with default GPG key
662682echo " * Signing files"
663- for file in phpMyAdmin- $version -* .gz phpMyAdmin- $version -* .zip phpMyAdmin- $version -* .xz ; do
683+ for file in $kit_prefix -* .gz $kit_prefix -* .zip $kit_prefix -* .xz ; do
664684 if [ $do_sign -eq 1 ] ; then
665685 gpg --detach-sign --armor $file
666686 fi
@@ -669,7 +689,7 @@ for file in phpMyAdmin-$version-*.gz phpMyAdmin-$version-*.zip phpMyAdmin-$versi
669689done
670690
671691if [ $do_daily -eq 1 ] ; then
672- cat > phpMyAdmin- ${version} .json << EOT
692+ cat > $kit_prefix .json << EOT
673693{
674694 "date": "` date --iso-8601=seconds` ",
675695 "commit": "$git_head "
0 commit comments