summaryrefslogtreecommitdiff
path: root/scripts/functions
diff options
context:
space:
mode:
authorSergey Korolev <s.korolev@ndmsystems.com>2017-11-13 22:09:41 (GMT)
committerAlexey Neyman <stilor@att.net>2017-11-20 05:50:28 (GMT)
commit146c6814c9627a012c1a321073ac6ef2d7935d29 (patch)
tree171c417f193ddca91d6ceb57898af4289dc1a917 /scripts/functions
parent8c581c25042301ee0ec4169e6fc3213d7f8cb35b (diff)
scripts/functions: add CT_GetPkgBuildVersion
This allows to get a configured custom version of a package. Signed-off-by: Sergey Korolev <s.korolev@ndmsystems.com>
Diffstat (limited to 'scripts/functions')
-rw-r--r--scripts/functions22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/functions b/scripts/functions
index 402de86..4dd5b7e 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -2213,3 +2213,25 @@ CT_GetPkgVersion()
CT_PackageRun "${1}" __do_GetPkgVersion
eval "${2}=\"${rv}\""
}
+
+# Closure of a build version selector.
+CT_DoGetPkgBuildVersion()
+{
+ if [ "${src_release}" = "y" ]; then
+ build_version="${version}"
+ elif [ -z "${devel_revision}" ]; then
+ build_version="${devel_branch}"
+ else
+ build_version="${devel_revision}"
+ fi
+}
+
+# Get a package version selected to build. May return an empty string.
+# Usage: CT_GetPkgBuildVersion PKG VAR
+CT_GetPkgBuildVersion()
+{
+ local build_version
+
+ CT_PackageRun "${1}" CT_DoGetPkgBuildVersion
+ eval "${2}=\"${build_version}\""
+}