Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
MariaDB 10.3
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MariaDB and MySQL Packaging Team
MariaDB 10.3
Commits
6440c0d6
Commit
6440c0d6
authored
5 years ago
by
Otto Kekäläinen
Browse files
Options
Downloads
Patches
Plain Diff
Implement proper version detection in maintainer scripts (Closes: #920415)
Fixes regression introduced by changes in commit
6b1f48b3
.
parent
6452ba6a
No related branches found
Branches containing commit
Tags
v4.0.0
Tags containing commit
No related merge requests found
Pipeline
#37243
failed with stages
in 2 hours
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
debian/mariadb-server-10.3.postinst
+4
-6
4 additions, 6 deletions
debian/mariadb-server-10.3.postinst
debian/mariadb-server-10.3.postrm
+5
-7
5 additions, 7 deletions
debian/mariadb-server-10.3.postrm
debian/mariadb-server-10.3.preinst
+4
-6
4 additions, 6 deletions
debian/mariadb-server-10.3.preinst
with
13 additions
and
19 deletions
debian/mariadb-server-10.3.postinst
+
4
−
6
View file @
6440c0d6
...
...
@@ -3,10 +3,8 @@ set -e
.
/usr/share/debconf/confmodule
# Automatically set version to ease maintenance of this file.
# Assume the filename is /path/to/mariadb-server-##.#.postinst
# Pick version string based on location. Python equivalent would be x[-13:-9].
VERSION
=
${
0
:
-13
:4
}
# Automatically set version to ease maintenance of this file
MAJOR_VER
=
"
${
DPKG_MAINTSCRIPT_PACKAGE
#mariadb-server-
}
"
if
[
-n
"
$DEBIAN_SCRIPT_DEBUG
"
]
;
then
set
-v
-x
;
DEBIAN_SCRIPT_TRACE
=
1
;
fi
${
DEBIAN_SCRIPT_TRACE
:+
echo
"#42#DEBUG# RUNNING
$0
$*
"
1>&2
}
...
...
@@ -14,7 +12,7 @@ ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
export
PATH
=
$PATH
:/sbin:/usr/sbin:/bin:/usr/bin
# This command can be used as pipe to syslog. With "-s" it also logs to stderr.
ERR_LOGGER
=
"logger -p daemon.err -t mariadb-server-
$
VERSION
.postinst -i"
ERR_LOGGER
=
"logger -p daemon.err -t mariadb-server-
$
MAJOR_VER
.postinst -i"
# Specify syslog tag name so it is clear the entry came from this postinst script.
# This will make an error in a logged command immediately apparent by aborting
# the install, rather than failing silently and leaving a broken install.
...
...
@@ -98,7 +96,7 @@ EOF
# Clean up old flags before setting new one
rm
-f
$mysql_datadir
/debian-
*
.flag
# Flag data dir to avoid downgrades
touch
$mysql_datadir
/debian-
$
VERSION
.flag
touch
$mysql_datadir
/debian-
$
MAJOR_VER
.flag
# initiate databases. Output is not allowed by debconf :-(
# This will fail if we are upgrading an existing database; in this case
...
...
This diff is collapsed.
Click to expand it.
debian/mariadb-server-10.3.postrm
+
5
−
7
View file @
6440c0d6
...
...
@@ -3,10 +3,8 @@ set -e
.
/usr/share/debconf/confmodule
# Automatically set version to ease maintenance of this file.
# Assume the filename is /path/to/mariadb-server-##.#.postrm
# Pick version string based on location. Python equivalent would be x[-11:-7].
VERSION
=
${
0
:
-11
:4
}
# Automatically set version to ease maintenance of this file
MAJOR_VER
=
"
${
DPKG_MAINTSCRIPT_PACKAGE
#mariadb-server-
}
"
if
[
-n
"
$DEBIAN_SCRIPT_DEBUG
"
]
;
then
set
-v
-x
;
DEBIAN_SCRIPT_TRACE
=
1
;
fi
${
DEBIAN_SCRIPT_TRACE
:+
echo
"#42#DEBUG# RUNNING
$0
$*
"
1>&2
}
...
...
@@ -16,14 +14,14 @@ ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
# - Remove the mysql user only after all his owned files are purged.
# - Cleanup the initscripts only if this was the last provider of them
#
if
[
"
$1
"
=
"purge"
]
&&
[
-f
"/var/lib/mysql/debian-
$
VERSION
.flag"
]
;
then
if
[
"
$1
"
=
"purge"
]
&&
[
-f
"/var/lib/mysql/debian-
$
MAJOR_VER
.flag"
]
;
then
# we remove the mysql user only after all his owned files are purged
rm
-f
/var/log/mysql.
{
log,err
}{
,.0,.[1234567].gz
}
rm
-rf
/var/log/mysql
db_input high mariadb-server-
$
VERSION
/postrm_remove_databases
||
true
db_input high mariadb-server-
$
MAJOR_VER
/postrm_remove_databases
||
true
db_go
||
true
db_get mariadb-server-
$
VERSION
/postrm_remove_databases
||
true
db_get mariadb-server-
$
MAJOR_VER
/postrm_remove_databases
||
true
if
[
"
$RET
"
=
"true"
]
;
then
# never remove the debian.cnf when the databases are still existing
# else we ran into big trouble on the next install!
...
...
This diff is collapsed.
Click to expand it.
debian/mariadb-server-10.3.preinst
+
4
−
6
View file @
6440c0d6
...
...
@@ -9,10 +9,8 @@
.
/usr/share/debconf/confmodule
# Automatically set version to ease maintenance of this file.
# Assume the filename is /path/to/mariadb-server-##.#.preinst
# Pick version string based on location. Python equivalent would be x[-12:-8].
VERSION
=
${
0
:
-12
:4
}
# Automatically set version to ease maintenance of this file
MAJOR_VER
=
"
${
DPKG_MAINTSCRIPT_PACKAGE
#mariadb-server-
}
"
# Just kill the invalid insserv.conf.d directory without fallback
if
[
-d
"/etc/insserv.conf.d/mariadb/"
]
;
then
...
...
@@ -28,7 +26,7 @@ mysql_upgradedir=/var/lib/mysql-upgrade
################################ main() ##########################
this_version
=
$
VERSION
this_version
=
$
MAJOR_VER
max_upgradeable_version
=
5.7
# Check if a flag file is found that indicates a previous MariaDB or MySQL
...
...
@@ -92,7 +90,7 @@ fi
# Instead simply move the old datadir and create a new for this_version.
if
[
!
-z
"
$downgrade_detected
"
]
then
db_input critical mariadb-server-
$
VERSION
/old_data_directory_saved
||
true
db_input critical mariadb-server-
$
MAJOR_VER
/old_data_directory_saved
||
true
db_go
echo
"The file
$mysql_datadir
/debian-
$found_version
.flag indicates a"
1>&2
echo
"version that cannot automatically be upgraded. Therefore the"
1>&2
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment