Skip to content

Commit c168e16

Browse files
illuusiogrooverdan
authored andcommitted
MDEV-28628: Change current Debian package revision scheme
Current Debian package revision scheme when using debian/autobake-deb.sh script is: '1:VERSION+maria~LSBNAME' For example if VERSION can be like 10.6.8 and LSBNAME is buster then version and revision is: '1:10.6.8+maria~buster' Which can lead to problem as distro code names can be lexical unordered. For example Debian LSBNAME's can be: Codename Buster is Debian version 10 Codename Bookworm is Debian version 11 This happens because in ASCII table Buster first two digits are 'Bu' and they are in hex 0x42 and 0x75 and Bookworm first digits 'Bo' are they are in hex 0x42 and 0x6F When apt is upgrading it means that: 1:10.6.8+maria~buster is bigger than 1:10.6.8+maria~bookworm and that leads to problems in dist-upgrade process To solve problem revision format is changed to: '1:VERSION+maria~(deb|ubu)LSBVERSION' Example for Debian 11 is now: 1:10.6.8+maria~deb11 and for Ubuntu 22.04 is now: 1:10.6.8+maria~ubu2204 There are new Variables * VERSION which contains whole version string * LSBVERSION which contains LSB version of distro * LSBID which contains LSB ID (Debian or Ubuntu) added to debian/autobake-deb.sh. Also CODENAME is change to LSBNAME as it's more declaritive
1 parent e077ce2 commit c168e16

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

debian/autobake-deb.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,15 @@ export DEB_BUILD_OPTIONS="nocheck"
1717
# Debian policy and targeting Debian Sid. Then case-by-case run in autobake-deb.sh
1818
# tests for backwards compatibility and strip away parts on older builders.
1919

20-
CODENAME="$(lsb_release -sc)"
21-
case "${CODENAME}" in
20+
LSBID="$(lsb_release -si | tr '[:upper:]' '[:lower:]')"
21+
LSBVERSION="$(lsb_release -sr | sed -e "s#\.##g")"
22+
LSBNAME="$(lsb_release -sc)"
23+
24+
if [ -z "${LSBID}" ]
25+
then
26+
LSBID="unknown"
27+
fi
28+
case "${LSBNAME}" in
2229
stretch)
2330
# MDEV-28022 libzstd-dev-1.1.3 minimum version
2431
sed -i -e '/libzstd-dev/d' debian/control
@@ -55,10 +62,11 @@ UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${
5562
PATCHLEVEL="+maria"
5663
LOGSTRING="MariaDB build"
5764
EPOCH="1:"
65+
VERSION="${EPOCH}${UPSTREAM}${PATCHLEVEL}~${LSBID:0:3}${LSBVERSION}"
5866

59-
dch -b -D ${CODENAME} -v "${EPOCH}${UPSTREAM}${PATCHLEVEL}~${CODENAME}" "Automatic build with ${LOGSTRING}."
67+
dch -b -D ${LSBNAME} -v "${VERSION}" "Automatic build with ${LOGSTRING}."
6068

61-
echo "Creating package version ${EPOCH}${UPSTREAM}${PATCHLEVEL}~${CODENAME} ... "
69+
echo "Creating package version ${VERSION} ... "
6270

6371
# Build the package
6472
# Pass -I so that .git and other unnecessary temporary and source control files

0 commit comments

Comments
 (0)