diff --git a/scripts/build/termux_create_pacman_subpackages.sh b/scripts/build/termux_create_pacman_subpackages.sh index 9268f33e2..271b13c02 100644 --- a/scripts/build/termux_create_pacman_subpackages.sh +++ b/scripts/build/termux_create_pacman_subpackages.sh @@ -68,9 +68,12 @@ termux_create_pacman_subpackages() { fi # Version view revisions. - local TERMUX_PKG_VERSION=$(echo $TERMUX_PKG_VERSION | sed "s|-|.|g") - local TERMUX_PKG_VERSION=${TERMUX_PKG_VERSION/[a-z]/.${TERMUX_PKG_VERSION//[0-9.]/}} - local TERMUX_PKG_FULLVERSION="${TERMUX_PKG_VERSION}" + local TERMUX_PKG_VERSION_EDITED=${TERMUX_PKG_VERSION//-/.} + local INCORRECT_SYMBOLS=$(echo $TERMUX_PKG_VERSION_EDITED | grep -o '[0-9][a-z]') + if [ -n "$INCORRECT_SYMBOLS" ]; then + local TERMUX_PKG_VERSION_EDITED=${TERMUX_PKG_VERSION_EDITED//${INCORRECT_SYMBOLS:0:1}${INCORRECT_SYMBOLS:1:1}/${INCORRECT_SYMBOLS:0:1}.${INCORRECT_SYMBOLS:1:1}} + fi + local TERMUX_PKG_FULLVERSION="${TERMUX_PKG_VERSION_EDITED}" if [ -n "$TERMUX_PKG_REVISION" ]; then TERMUX_PKG_FULLVERSION+="-${TERMUX_PKG_REVISION}" else diff --git a/scripts/build/termux_step_create_pacman_package.sh b/scripts/build/termux_step_create_pacman_package.sh index 93f7d114e..7b14b4dc3 100644 --- a/scripts/build/termux_step_create_pacman_package.sh +++ b/scripts/build/termux_step_create_pacman_package.sh @@ -36,9 +36,12 @@ termux_step_create_pacman_package() { esac # Version view revisions. - local TERMUX_PKG_VERSION=$(echo $TERMUX_PKG_VERSION | sed "s|-|.|g") - local TERMUX_PKG_VERSION=${TERMUX_PKG_VERSION/[a-z]/.${TERMUX_PKG_VERSION//[0-9.]/}} - local TERMUX_PKG_FULLVERSION="${TERMUX_PKG_VERSION}" + local TERMUX_PKG_VERSION_EDITED=${TERMUX_PKG_VERSION//-/.} + local INCORRECT_SYMBOLS=$(echo $TERMUX_PKG_VERSION_EDITED | grep -o '[0-9][a-z]') + if [ -n "$INCORRECT_SYMBOLS" ]; then + local TERMUX_PKG_VERSION_EDITED=${TERMUX_PKG_VERSION_EDITED//${INCORRECT_SYMBOLS:0:1}${INCORRECT_SYMBOLS:1:1}/${INCORRECT_SYMBOLS:0:1}.${INCORRECT_SYMBOLS:1:1}} + fi + local TERMUX_PKG_FULLVERSION="${TERMUX_PKG_VERSION_EDITED}" if [ -n "$TERMUX_PKG_REVISION" ]; then TERMUX_PKG_FULLVERSION+="-${TERMUX_PKG_REVISION}" else