MT#55283 improve version handling

Change-Id: I8ff496f8460c5c5e0bee6b6bb6f3d2245291c597
pull/2090/head
Richard Fuchs 1 month ago
parent 14769ec05d
commit 7e6c2c30a4

@ -4,8 +4,12 @@ if [ -z "${M}" ]; then
M=$(pwd)
fi
if [ -z "${RTPENGINE_VERSION}" ] && [ -f .release-version ]; then
RTPENGINE_VERSION=$(<.release-version)
if [ -z "${RTPENGINE_VERSION}" ]; then
if [ -f .release-version ]; then
RTPENGINE_VERSION=$(<.release-version)
elif [ -f ../.release-version ]; then
RTPENGINE_VERSION=$(<../.release-version)
fi
fi
if [ -z "${RTPENGINE_VERSION}" ]; then
@ -20,18 +24,23 @@ if [ -z "${RTPENGINE_VERSION}" ]; then
fi
if [ "${have_dpkg_parsechangelog}" = yes ]; then
deb_version="$(dpkg-parsechangelog -l"${deb_changelog}" | awk '/^Version: / {print $2}')"
RTPENGINE_VERSION="${deb_version}"
fi
git_br_commit="git-$(cd "${M}" && git rev-parse --abbrev-ref --symbolic-full-name HEAD 2> /dev/null)-$(cd "${M}" && git rev-parse --short HEAD 2> /dev/null)"
if [ "${have_dpkg_parsechangelog}" = yes ]; then
RTPENGINE_VERSION+=" ${deb_version}"
fi
if [ "${git_br_commit}" != "git--" ]; then
RTPENGINE_VERSION+=" ${git_br_commit}"
if [ -n "${RTPENGINE_VERSION}" ]; then
RTPENGINE_VERSION+=" "
fi
RTPENGINE_VERSION+="${git_br_commit}"
fi
fi
if [ -z "${RTPENGINE_VERSION}" ]; then
RTPENGINE_VERSION="undefined"
fi
if [ -z "${RTPENGINE_VERSION}" ]; then
RTPENGINE_VERSION="undefined"
fi
if [ -n "${RTPENGINE_VERSION}" ]; then
echo "RTPENGINE_VERSION := ${RTPENGINE_VERSION}"
fi

@ -19,33 +19,37 @@ if [ -z "${top_srcdir}" ]; then
top_srcdir=.
fi
have_dpkg_parsechangelog=no
if command -v dpkg-parsechangelog >/dev/null; then
have_dpkg_parsechangelog=yes
fi
if [ -z "${RTPENGINE_VERSION}" ] && [ -f .release-version ]; then
RTPENGINE_VERSION=$(<.release-version)
if [ -z "${RTPENGINE_VERSION}" ] && [ -f "${top_srcdir}"/.release-version ]; then
RTPENGINE_VERSION=$(<"${top_srcdir}"/.release-version)
fi
if [ -z "${RTPENGINE_VERSION}" ]; then
have_dpkg_parsechangelog=no
if command -v dpkg-parsechangelog >/dev/null; then
have_dpkg_parsechangelog=yes
fi
if [ "${have_dpkg_parsechangelog}" = yes ]; then
deb_version="$(dpkg-parsechangelog -l"${top_srcdir}"/debian/changelog | awk '/^Version: / { print $2 }')"
RTPENGINE_VERSION="${deb_version}"
fi
git_br_commit="git-$(git rev-parse --abbrev-ref --symbolic-full-name HEAD 2> /dev/null)-$(git rev-parse --short HEAD 2> /dev/null)"
if [ "${have_dpkg_parsechangelog}" = yes ]; then
RTPENGINE_VERSION+=" ${deb_version}"
fi
if [ "${git_br_commit}" != "git--" ]; then
RTPENGINE_VERSION+=" ${git_br_commit}"
if [ -n "${RTPENGINE_VERSION}" ]; then
RTPENGINE_VERSION+=" "
fi
RTPENGINE_VERSION+="${git_br_commit}"
fi
fi
if [ -z "${RTPENGINE_VERSION}" ]; then
RTPENGINE_VERSION=" undefined"
fi
if [ -z "${RTPENGINE_VERSION}" ]; then
RTPENGINE_VERSION=" undefined"
fi
if [ -n "${RTPENGINE_VERSION}" ]; then
echo "RTPENGINE_VERSION := ${RTPENGINE_VERSION}"
fi
echo "RTPENGINE_VERSION := ${RTPENGINE_VERSION}"
CFLAGS_DEFAULT=
CPPFLAGS_DEFAULT=

Loading…
Cancel
Save