Skip to content

Commit a2e2ef9

Browse files
committed
Merge branch 'QA_5_2'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2 parents 7752a1d + 45c4152 commit a2e2ef9

File tree

3 files changed

+52
-23
lines changed

3 files changed

+52
-23
lines changed

scripts/create-release.sh

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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
9796
done
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
102101
fi
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
105111
ensure_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
341347
fetchReleaseFromFile() {
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

345352
fetchVersionSeriesFromFile() {
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)"
349357
VERSION_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+
351364
if [ "${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;
356369
fi
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
363377
Please 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)"
381396
fi
382397

383-
echo "The actual configured release is now: $(fetchReleaseFromFile)"
384-
385398
# Create working copy
386399
mkdir -p release
387400
git worktree prune
388-
workdir=release/phpMyAdmin-$version
401+
workdir_name=phpMyAdmin-$version
402+
workdir=release/$workdir_name
389403
if [ -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
392406
fi
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"
410429
fi
411430

412431
# Check release version
@@ -430,9 +449,10 @@ if [ $do_ci -eq 0 -a -$do_daily -eq 0 ] ; then
430449
fi
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))"
436456
echo "* Generating documentation"
437457
LC_ALL=C make -C doc html
438458
find doc -name '*.pyc' -print0 | xargs -0 -r rm -f
@@ -579,11 +599,11 @@ cd ..
579599
for 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
655675
done
656676

657677
# Cleanup
658-
rm -r phpMyAdmin-${version}
678+
rm -r $workdir_name
659679
git worktree prune
660680

661681
# Signing of files with default GPG key
662682
echo "* 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
669689
done
670690

671691
if [ $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"

templates/server/privileges/change_password.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
<td>
2727
<div class="row">
2828
<span class="d-flex align-items-center col-4">{% trans 'Enter:' %}</span>
29-
<input type="password" name="pma_pw" id="text_pma_change_pw" size="10" class="textfield col-6" spellcheck="false">
29+
<input type="password" name="pma_pw" id="text_pma_change_pw" size="10" class="textfield col-6" spellcheck="false" autocomplete="new-password">
3030
</div>
3131
<div class="row mt-2">
3232
<span class="d-flex align-items-center col-4">{% trans 'Re-type:' %}</span>
33-
<input type="password" name="pma_pw2" id="text_pma_change_pw2" size="10" class="textfield col-6" spellcheck="false">
33+
<input type="password" name="pma_pw2" id="text_pma_change_pw2" size="10" class="textfield col-6" spellcheck="false" autocomplete="new-password">
3434
</div>
3535
</td>
3636
<td class="col-2">

test/classes/ConfigTest.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,10 +1044,14 @@ public function testSetCookie(): void
10441044
*/
10451045
public function testGetTempDir(): void
10461046
{
1047-
$this->object->set('TempDir', sys_get_temp_dir() . DIRECTORY_SEPARATOR);
1047+
$dir = realpath(sys_get_temp_dir());
1048+
$this->assertDirectoryExists($dir);
1049+
$this->assertDirectoryIsWritable($dir);
1050+
1051+
$this->object->set('TempDir', $dir . DIRECTORY_SEPARATOR);
10481052
// Check no double slash is here
10491053
$this->assertEquals(
1050-
sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'upload',
1054+
$dir . DIRECTORY_SEPARATOR . 'upload',
10511055
$this->object->getTempDir('upload')
10521056
);
10531057
}
@@ -1056,10 +1060,15 @@ public function testGetTempDir(): void
10561060
* Test for getUploadTempDir
10571061
*
10581062
* @group file-system
1063+
* @depends testGetTempDir
10591064
*/
10601065
public function testGetUploadTempDir(): void
10611066
{
1062-
$this->object->set('TempDir', realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR);
1067+
$dir = realpath(sys_get_temp_dir());
1068+
$this->assertDirectoryExists($dir);
1069+
$this->assertDirectoryIsWritable($dir);
1070+
1071+
$this->object->set('TempDir', $dir . DIRECTORY_SEPARATOR);
10631072

10641073
$this->assertEquals(
10651074
$this->object->getTempDir('upload'),

0 commit comments

Comments
 (0)