summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2010-01-06 01:48:13 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2010-01-06 14:50:48 +0100
commit84254a822f9be4b100b095e91de3fd96c614afbb (patch)
tree5b108ff714926e953895a82315f97043ce61d48b /bin
parentce8a9a5ccdd1cf8d98a370f4916397c183456cc9 (diff)
downloadptxdist-84254a822f9be4b100b095e91de3fd96c614afbb.tar.gz
ptxdist-84254a822f9be4b100b095e91de3fd96c614afbb.tar.xz
[ptxdist] adopt config file version check to timed releases
Since ptxdist is doing timed releases now, year and month of config file an ptxdist must match, further the "bugfix" level of ptxdist must be greater or equal to the "bugfix" level of the config file. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ptxdist72
1 files changed, 36 insertions, 36 deletions
diff --git a/bin/ptxdist b/bin/ptxdist
index 990087921..a20561e9e 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -180,57 +180,57 @@ check_path() {
#
-# check a ptxdist version against a configfile version.
+# check ptxdist version against configfile version
#
-# as long as we're not 2.0 (i.e. stable) the versions _must_ match
+# $1: config file version
#
-# - The ptxdist major version has to be equal to the configfile major version
-# - The ptxdist minor version has to be equal to the configfile minor version
-# - The ptxdist micro version has to greater than or equal to the configfile
-# micro version
-# - If the configfile has no micro version stop here and assume
-# everything is ok (this means '1.0' 'can build with 1.0.x').
+# return:
+# 0: ptxdist and config file are compatible
+# 1: ptxdist and config file are incompatible
#
check_version() {
- if [ -n "${PTX_FORCE}" ]; then
- return 0
- fi
-
#
- # the toolchain project is a bit more relaxed, new ptxdists
- # can build it, too
+ # if config file and ptxdist match return success
+ # (or if beeing forced)
#
- if ! ptxd_get_ptxconf PTXCONF_BUILD_TOOLCHAIN >/dev/null; then
- ####################################################################
- # as long as we're not 2.0 (i.e. stable) the versions _must_ match #
- # (for normal BSPs) #
- ####################################################################
-
- if [ "${1}" = "${PTXDIST_VERSION_FULL}" ]; then
- return
- else
- return 1
- fi
+ if [ "${1}" = "${PTXDIST_VERSION_CFG_FULL}" -o \
+ -n "${PTX_FORCE}" ]; then
+ return 0
fi
+ local config_full="${1/-/.}"
local ifs_old="${IFS}"
IFS=.
- set -- ${1}
+ set -- ${config_full}
IFS="${ifs_old}"
- local config_major="${1}"
- local config_minor="${2}"
- local config_micro="${3}"
+ local config_year="${1}"
+ local config_month="${2}"
+ local config_bugfix="${3}"
+ local config_scm="${4:+-$4}"
- if [ "${PTXDIST_VERSION_MAJOR}" != "${config_major}" ]; then
- return 1
- elif [ "${PTXDIST_VERSION_MINOR}" != "${config_minor}" ]; then
+ if ptxd_get_ptxconf PTXCONF_BUILD_TOOLCHAIN >/dev/null; then
+ #
+ # let ptxdist build 1.99.x toolchain projects, too
+ #
+ if [ "${config_year}.${config_month}" = "1.99" -a \
+ "${config_bugfix}" != "svn" ]; then
+ return 0
+ fi
+ fi
+
+ #
+ # we're doing timed releases now, so year and month _must_
+ # match scm (source code management) must match, too
+ #
+ # the "bugfix" level of ptxdist must be greater or equal to
+ # the "bugfix" level of the config file
+ #
+ if [ "${PTXDIST_VERSION_YEAR}.${PTXDIST_VERSION_MONTH}${PTXDIST_VERSION_CFG_SCM}" != \
+ "${config_year}.${config_month}${config_scm}" ]; then
return 1
- elif [ -z "${config_micro}" -o \
- "${PTXDIST_VERSION_MICRO}" = "${config_micro}" ]; then
+ elif [ ${PTXDIST_VERSION_BUGFIX} -ge ${config_bugfix} ] >/dev/null 2>&1; then
return 0
- elif [ ${PTXDIST_VERSION_MICRO} -ge ${config_micro} ] >/dev/null 2>&1; then
- return 0 # fails if one is "svn"
fi
return 1