diff --git a/scripts/create-release.sh b/scripts/create-release.sh index 0435545eff..73910ac1a4 100755 --- a/scripts/create-release.sh +++ b/scripts/create-release.sh @@ -58,7 +58,6 @@ while [ $# -gt 0 ] ; do git branch ci branch="ci" fi - version="${VERSION_SERIES}+ci" ;; --help) echo "Usages:" @@ -96,11 +95,18 @@ while [ $# -gt 0 ] ; do shift done -if [ -z "$version" -o -z "$branch" ] ; then - echo "Branch and version have to be specified!" +if [ -z "$branch" ]; then + echo "Branch must be specified!" exit 1 fi +if [ -z "$version" -a $do_ci -eq 0 ]; then + echo "Version must be specified!" + exit 1 +fi + +kit_prefix="phpMyAdmin-$version" + # Checks whether remote branch has local tracking branch ensure_local_branch() { if ! git branch | grep -q '^..'"$1"'$' ; then @@ -339,15 +345,22 @@ VERSION_FILE=libraries/classes/Version.php # Keep in sync with update-po script fetchReleaseFromFile() { - php -r "define('VERSION_SUFFIX', ''); require_once('libraries/classes/Version.php'); echo \PhpMyAdmin\Version::VERSION;" + SUFFIX="${1:-}" + php -r "define('VERSION_SUFFIX', '$SUFFIX'); require_once('$VERSION_FILE'); echo \PhpMyAdmin\Version::VERSION;" } fetchVersionSeriesFromFile() { - php -r "define('VERSION_SUFFIX', ''); require_once('libraries/classes/Version.php'); echo \PhpMyAdmin\Version::SERIES;" + php -r "define('VERSION_SUFFIX', ''); require_once('$VERSION_FILE'); echo \PhpMyAdmin\Version::SERIES;" } +VERSION_FROM_FILE="$(fetchReleaseFromFile)" VERSION_SERIES_FROM_FILE="$(fetchVersionSeriesFromFile)" +if [ $do_ci -eq 1 ]; then + VERSION_FROM_FILE="$(fetchReleaseFromFile '+ci')" + version="${VERSION_FROM_FILE}" +fi + if [ "${VERSION_SERIES_FROM_FILE}" != "${VERSION_SERIES}" ]; then echo "This script can not handle ${VERSION_SERIES_FROM_FILE} version series." echo "Only ${VERSION_SERIES} version series are allowed, please use your target branch directly or another branch." @@ -355,9 +368,10 @@ if [ "${VERSION_SERIES_FROM_FILE}" != "${VERSION_SERIES}" ]; then exit 1; fi -echo "The actual configured release is: $(fetchReleaseFromFile)" +echo "The actual configured release is: $VERSION_FROM_FILE" +echo "The actual configured release series is: $VERSION_SERIES_FROM_FILE" -if [ $do_ci -eq 0 -a -$do_daily -eq 0 ] ; then +if [ $do_ci -eq 0 -a $do_daily -eq 0 ] ; then cat < '.*'/'versionSuffix' => '+$today_date.$git_head_short'/" libraries/vendor_config.php php -l libraries/vendor_config.php + + # Fetch it back and refresh $version + VERSION_FROM_FILE="$(fetchReleaseFromFile "+$today_date.$git_head_short")" + version="${VERSION_FROM_FILE}" + echo "The actual configured release is: $VERSION_FROM_FILE" fi # Check release version @@ -430,9 +449,10 @@ if [ $do_ci -eq 0 -a -$do_daily -eq 0 ] ; then fi # Cleanup release dir -LC_ALL=C date -u > RELEASE-DATE-${version} +LC_ALL=C date -u > RELEASE-DATE-$version # Building documentation +echo "* Running sphinx-build (version: $(sphinx-build --version))" echo "* Generating documentation" LC_ALL=C make -C doc html find doc -name '*.pyc' -print0 | xargs -0 -r rm -f @@ -579,11 +599,11 @@ cd .. for kit in $KITS ; do echo "* Building kit: $kit" # Copy all files - name=phpMyAdmin-$version-$kit - cp -r phpMyAdmin-$version $name + name=$kit_prefix-$kit + cp -r $workdir_name $name # Cleanup translations - cd phpMyAdmin-$version-$kit + cd $name ./scripts/lang-cleanup.sh $kit # Remove tests, source code,... @@ -655,12 +675,12 @@ for kit in $KITS ; do done # Cleanup -rm -r phpMyAdmin-${version} +rm -r $workdir_name git worktree prune # Signing of files with default GPG key echo "* Signing files" -for file in phpMyAdmin-$version-*.gz phpMyAdmin-$version-*.zip phpMyAdmin-$version-*.xz ; do +for file in $kit_prefix-*.gz $kit_prefix-*.zip $kit_prefix-*.xz ; do if [ $do_sign -eq 1 ] ; then gpg --detach-sign --armor $file fi @@ -669,7 +689,7 @@ for file in phpMyAdmin-$version-*.gz phpMyAdmin-$version-*.zip phpMyAdmin-$versi done if [ $do_daily -eq 1 ] ; then - cat > phpMyAdmin-${version}.json << EOT + cat > $kit_prefix.json << EOT { "date": "`date --iso-8601=seconds`", "commit": "$git_head" diff --git a/templates/server/privileges/change_password.twig b/templates/server/privileges/change_password.twig index 8952d7a91e..31aeecb139 100644 --- a/templates/server/privileges/change_password.twig +++ b/templates/server/privileges/change_password.twig @@ -26,11 +26,11 @@
{% trans 'Enter:' %} - +
{% trans 'Re-type:' %} - +
diff --git a/test/classes/ConfigTest.php b/test/classes/ConfigTest.php index f290395b3a..703edaaf18 100644 --- a/test/classes/ConfigTest.php +++ b/test/classes/ConfigTest.php @@ -1044,10 +1044,14 @@ class ConfigTest extends AbstractTestCase */ public function testGetTempDir(): void { - $this->object->set('TempDir', sys_get_temp_dir() . DIRECTORY_SEPARATOR); + $dir = realpath(sys_get_temp_dir()); + $this->assertDirectoryExists($dir); + $this->assertDirectoryIsWritable($dir); + + $this->object->set('TempDir', $dir . DIRECTORY_SEPARATOR); // Check no double slash is here $this->assertEquals( - sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'upload', + $dir . DIRECTORY_SEPARATOR . 'upload', $this->object->getTempDir('upload') ); } @@ -1056,10 +1060,15 @@ class ConfigTest extends AbstractTestCase * Test for getUploadTempDir * * @group file-system + * @depends testGetTempDir */ public function testGetUploadTempDir(): void { - $this->object->set('TempDir', realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR); + $dir = realpath(sys_get_temp_dir()); + $this->assertDirectoryExists($dir); + $this->assertDirectoryIsWritable($dir); + + $this->object->set('TempDir', $dir . DIRECTORY_SEPARATOR); $this->assertEquals( $this->object->getTempDir('upload'),