summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2010-04-01 21:01:48 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2010-04-02 23:12:28 +0200
commitc88c8f5d169e2493ad1fed72204c65043b5e67c2 (patch)
treeca9c08bb9e572415e3cb9c51105084eda76a4e52 /bin
parent67777899db111e0b721b96cff1b53c3d4158e0ee (diff)
downloadptxdist-c88c8f5d169e2493ad1fed72204c65043b5e67c2.tar.gz
ptxdist-c88c8f5d169e2493ad1fed72204c65043b5e67c2.tar.xz
[ptxdist] rework version generation
This patch aims to fix some problems of the version handling of ptxdist which were introducted with switching to timed releases: a) The version is specified in "configure.ac", the "local version" ("00003-gbf29f16") is generated by "setlocalversion". "setlocalversion" generates it's ouput relative to the latest tag. This leads to strange version strings, after creating a tag, and forgetting to run "./autogen.sh && ./configure && make". b) The ptxdist created with a "make dist", even if a not tagged version, always thinks it's a release. c) BSPs working with "master" need a migrate after each release. Because the compatibility checker uses year and month. The problems are^Wshould be fixed with these changes: a) "setlocalversion" now generates the whole full version, e.g.: "2010.04.0-00003-gbf29f16". "configure.ac" uses "m4_esyscmd" to figure out the current version while running "configure". (Yes, "configure"). b) A file ".tarball-version" is added to the tarball to track the version while creating the tarball (same goes for the installation). "setlocalversion" will use the version information from ".tarball-version" c) If both ptxdist and config file are not using a release, i.e. their versions an "appendix", we say it's compatibe, too. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ptxdist28
1 files changed, 17 insertions, 11 deletions
diff --git a/bin/ptxdist b/bin/ptxdist
index fec208f91..5e78e3603 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -193,21 +193,20 @@ check_version() {
# if config file and ptxdist match return success
# (or if beeing forced)
#
- if [ "${1}" = "${PTXDIST_VERSION_CFG_FULL}" -o \
+ if [ "${1}" = "${PTXDIST_VERSION_FULL}" -o \
-n "${PTX_FORCE}" ]; then
return 0
fi
- local config_full="${1/-/.}"
local ifs_old="${IFS}"
- IFS=.
- set -- ${config_full}
+ local IFS=".-"
+ set -- ${1}
IFS="${ifs_old}"
local config_year="${1}"
local config_month="${2}"
local config_bugfix="${3}"
- local config_scm="${4:+-$4}"
+ local config_scm="${4}"
if ptxd_get_ptxconf PTXCONF_BUILD_TOOLCHAIN >/dev/null; then
#
@@ -220,14 +219,24 @@ check_version() {
fi
#
+ # If both ptxdist and config file are not using a release
+ # (i.e. scm is set), we say it's compatible, too.
+ #
+ # If not the developer has to fix it :P
+ #
+ if [ "${PTXDIST_VERSION_SCM:+-git}" = "${config_scm:+-git}" ]; then
+ return 0
+ fi
+
+ #
# we're doing timed releases now, so year and month _must_
- # match scm (source code management) must match, too
+ # match.
#
# 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
+ if [ "${PTXDIST_VERSION_YEAR}.${PTXDIST_VERSION_MONTH}${PTXDIST_VERSION_SCM:+-git}" != \
+ "${config_year}.${config_month}" ]; then
return 1
elif [ ${PTXDIST_VERSION_BUGFIX} -ge ${config_bugfix} ] >/dev/null 2>&1; then
return 0
@@ -2121,7 +2130,6 @@ setup_libs_early() {
for file in \
scripts/ptxdist_vars.sh \
- scripts/ptxdist_version.sh \
scripts/libptxdist.sh \
; do
abs_file="${PTXDIST_TOPDIR}/${file}"
@@ -2426,8 +2434,6 @@ setup_export() {
\
PTXDIST_VERSION_SCM \
PTXDIST_VERSION_FULL \
- PTXDIST_VERSION_CFG_SCM \
- PTXDIST_VERSION_CFG_FULL \
\
PTXDIST_WORKSPACE \
\