Skip to content

Commit 24d615e

Browse files
committed
[pkg] fix: add support for four-element version (three dots)
Surprise: 11.0.9.1 is a valid JDK version. Until now, all GA versions had only three elements, like 11.0.8.
1 parent 7f85468 commit 24d615e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packaging/package.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,17 @@ if [ "$NUM_OF_FIELDS" -eq 0 ]; then
1717
export DEB_JRI_MAJOR=$DEB_JRI_PREFIX
1818
export DEB_JRI_MINOR=0
1919
export DEB_JRI_PATCH=0
20+
export DEB_JRI_SUBPATCH=""
2021
elif [ "$NUM_OF_FIELDS" -eq 2 ]; then
2122
export DEB_JRI_MAJOR=$(echo "$DEB_JRI_PREFIX" | cut -d . -f 1)
2223
export DEB_JRI_MINOR=$(echo "$DEB_JRI_PREFIX" | cut -d . -f 2)
2324
export DEB_JRI_PATCH=$(echo "$DEB_JRI_PREFIX" | cut -d . -f 3)
25+
export DEB_JRI_SUBPATCH=""
26+
elif [ "$NUM_OF_FIELDS" -eq 3 ]; then
27+
export DEB_JRI_MAJOR=$(echo "$DEB_JRI_PREFIX" | cut -d . -f 1)
28+
export DEB_JRI_MINOR=$(echo "$DEB_JRI_PREFIX" | cut -d . -f 2)
29+
export DEB_JRI_PATCH=$(echo "$DEB_JRI_PREFIX" | cut -d . -f 3)
30+
export DEB_JRI_SUBPATCH=".$(echo "$DEB_JRI_PREFIX" | cut -d . -f 4)"
2431
else
2532
echo "Unsupported version string: $JAVA_VERSION" 1>&2
2633
exit 1
@@ -38,7 +45,7 @@ if [ -z "$DEB_JRI_PATCH" ]; then
3845
fi
3946

4047
PKG="jri-${DEB_JRI_MAJOR}-${DEB_JRI_PLATFORM}"
41-
PKGVER="${DEB_JRI_MAJOR}.${DEB_JRI_MINOR}.${DEB_JRI_PATCH}~${DEB_JRI_BUILD}"
48+
PKGVER="${DEB_JRI_MAJOR}.${DEB_JRI_MINOR}.${DEB_JRI_PATCH}${DEB_JRI_SUBPATCH}~${DEB_JRI_BUILD}"
4249
PKGNAME="${PKG}_${PKGVER}"
4350
DATE=$(LC_ALL=C date -R)
4451
if [ -z "$DISTRO" ]; then

0 commit comments

Comments
 (0)