summaryrefslogtreecommitdiffstats
path: root/scripts/ptxdist_version.sh
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 /scripts/ptxdist_version.sh
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 'scripts/ptxdist_version.sh')
-rw-r--r--scripts/ptxdist_version.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/ptxdist_version.sh b/scripts/ptxdist_version.sh
new file mode 100644
index 000000000..543f61820
--- /dev/null
+++ b/scripts/ptxdist_version.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+#
+# version definition for ptxdist
+#
+_ptxd_get_version()
+{
+ PTXDIST_VERSION_FULL="$("${PTXDIST_TOPDIR:=.}/scripts/kernel/setlocalversion" "${PTXDIST_TOPDIR}/.tarball-version")"
+
+ local orig_IFS="${IFS}"
+ local IFS="."
+ set -- ${PTXDIST_VERSION_FULL}
+ IFS="${orig_IFS}"
+
+ PTXDIST_VERSION_YEAR="${1}"
+ PTXDIST_VERSION_MONTH="${2}"
+ PTXDIST_VERSION_BUGFIX="${3%%-*}"
+ PTXDIST_VERSION_SCM="${3#*-}"
+
+ if [ -n "${PTXDIST_VERSION_SCM}" ]; then
+ PTXDIST_VERSION_PTXRC="git"
+ else
+ PTXDIST_VERSION_PTXRC="${PTXDIST_VERSION_YEAR}.${PTXDIST_VERSION_MONTH}"
+ fi
+
+}
+
+_ptxd_get_version