Skip to content

Commit 1231863

Browse files
committed
Rename CHANGED_PWD to CHANGED_PASSWORD.
It's better to know the meaning.
1 parent 3dfdeed commit 1231863

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

.travis_setup.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,24 @@
22

33
set -eux
44

5-
CHANGED_PWD=false
6-
# Change the password recreating the root user on mariadb < 10.2
5+
# Change the password to be empty.
6+
CHANGED_PASSWORD=false
7+
# Change the password to be empty, recreating the root user on mariadb < 10.2
78
# where ALTER USER is not available.
89
# https://stackoverflow.com/questions/56052177/
9-
CHANGED_PWD_BY_RECREATE=false
10+
CHANGED_PASSWORD_BY_RECREATE=false
1011

1112
# Install the default used DB if DB is not set.
1213
if [[ -n ${GITHUB_ACTIONS-} && -z ${DB-} ]]; then
1314
if command -v lsb_release > /dev/null; then
1415
case "$(lsb_release -cs)" in
1516
xenial | bionic)
1617
sudo apt-get install -qq mysql-server-5.7 mysql-client-core-5.7 mysql-client-5.7
17-
CHANGED_PWD=true
18+
CHANGED_PASSWORD=true
1819
;;
1920
focal)
2021
sudo apt-get install -qq mysql-server-8.0 mysql-client-core-8.0 mysql-client-8.0
21-
CHANGED_PWD=true
22+
CHANGED_PASSWORD=true
2223
;;
2324
*)
2425
;;
@@ -34,20 +35,20 @@ fi
3435
# Install MySQL 5.7 if DB=mysql57
3536
if [[ -n ${DB-} && x$DB =~ ^xmysql57 ]]; then
3637
sudo bash .travis_mysql57.sh
37-
CHANGED_PWD=true
38+
CHANGED_PASSWORD=true
3839
fi
3940

4041
# Install MySQL 8.0 if DB=mysql80
4142
if [[ -n ${DB-} && x$DB =~ ^xmysql80 ]]; then
4243
sudo bash .travis_mysql80.sh
43-
CHANGED_PWD=true
44+
CHANGED_PASSWORD=true
4445
fi
4546

4647
# Install MariaDB client headers after Travis CI fix for MariaDB 10.2 broke earlier 10.x
4748
if [[ -n ${DB-} && x$DB =~ ^xmariadb10.0 ]]; then
4849
if [[ -n ${GITHUB_ACTIONS-} ]]; then
4950
sudo apt-get install -y -o Dpkg::Options::='--force-confnew' mariadb-server mariadb-server-10.0 libmariadb2
50-
CHANGED_PWD_BY_RECREATE=true
51+
CHANGED_PASSWORD_BY_RECREATE=true
5152
else
5253
sudo apt-get install -y -o Dpkg::Options::='--force-confnew' libmariadbclient-dev
5354
fi
@@ -57,7 +58,7 @@ fi
5758
if [[ -n ${DB-} && x$DB =~ ^xmariadb10.1 ]]; then
5859
if [[ -n ${GITHUB_ACTIONS-} ]]; then
5960
sudo apt-get install -y -o Dpkg::Options::='--force-confnew' mariadb-server mariadb-server-10.1 libmariadb-dev
60-
CHANGED_PWD_BY_RECREATE=true
61+
CHANGED_PASSWORD_BY_RECREATE=true
6162
else
6263
sudo apt-get install -y -o Dpkg::Options::='--force-confnew' libmariadbclient-dev
6364
fi
@@ -72,7 +73,7 @@ fi
7273
# Install MariaDB 10.3 if DB=mariadb10.3
7374
if [[ -n ${GITHUB_ACTIONS-} && -n ${DB-} && x$DB =~ ^xmariadb10.3 ]]; then
7475
sudo apt-get install -y -o Dpkg::Options::='--force-confnew' mariadb-server mariadb-server-10.3 libmariadb-dev
75-
CHANGED_PWD=true
76+
CHANGED_PASSWORD=true
7677
fi
7778

7879
# Install MySQL if OS=darwin
@@ -111,11 +112,11 @@ else
111112
DB_SYS_USER=root
112113
fi
113114

114-
if [ "${CHANGED_PWD}" = true ]; then
115+
if [ "${CHANGED_PASSWORD}" = true ]; then
115116
# https://www.percona.com/blog/2016/03/16/change-user-password-in-mysql-5-7-with-plugin-auth_socket/
116117
sudo mysql ${MYSQL_OPTS} -u "${DB_SYS_USER}" \
117118
-e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ''"
118-
elif [ "${CHANGED_PWD_BY_RECREATE}" = true ]; then
119+
elif [ "${CHANGED_PASSWORD_BY_RECREATE}" = true ]; then
119120
sudo mysql ${MYSQL_OPTS} -u "${DB_SYS_USER}" <<SQL
120121
DROP USER 'root'@'localhost';
121122
CREATE USER 'root'@'localhost' IDENTIFIED BY '';

0 commit comments

Comments
 (0)