summaryrefslogtreecommitdiff
path: root/scripts/functions
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-11-29 08:14:04 (GMT)
committerAlexey Neyman <stilor@att.net>2017-11-30 07:44:49 (GMT)
commit9fdb93cce0a05e2562522153fe5deba8a9e9ae54 (patch)
tree54a6aab24418d733f750853f44a5bf74dd5056a1 /scripts/functions
parentd759137c46fb7a04c4db44123ba3050afd734eef (diff)
Make comp.libs use generated templates, too
This allows us to include the component-to-package relation in the generated kconfig files and make use of that information in the show-config.sh script. Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/functions')
-rw-r--r--scripts/functions42
1 files changed, 33 insertions, 9 deletions
diff --git a/scripts/functions b/scripts/functions
index 5910619..d46ac36 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -2225,14 +2225,23 @@ CT_GetPkgVersion()
# (e.g. LIBC).
CT_GetPkgBuildVersion()
{
- local pkg="${1}"
- local tmp
- local build_version
-
- # If it is a choice selector, switch to whatever specific package it selects
- eval "tmp=\${CT_${pkg}_KSYM}"
- if [ -n "${tmp}" ]; then
- pkg="${tmp}"
+ local category="${1}"
+ local component="${2}"
+ local var="${3}"
+ local choicename tmp pkg build_version
+
+ # If it is for a choice, not a menu, get the choice name
+ eval "choicename=\${CT_${category}}"
+
+ # Find the associated package
+ eval "pkg=\${CT_${category}_${component}_PKG_KSYM}"
+ if [ -z "${pkg}" ]; then
+ # This component does not have an associated package,
+ # return the component name.
+ if [ -n "${choicename}" ]; then
+ eval "${var}=\"${choicename}\""
+ fi
+ return
fi
__do_GetPkgBuildVersion() {
@@ -2245,8 +2254,23 @@ CT_GetPkgBuildVersion()
elif [ "${src_custom}" = "y" ]; then
tmp+="-custom"
fi
+ if [ -n "${choicename}" -a "${pkg}" != "${component}" ]; then
+ tmp+=" (${choicename})"
+ fi
}
CT_PackageRun "${pkg}" __do_GetPkgBuildVersion
- eval "${2}=\"${tmp}\""
+ eval "${var}=\"${tmp}\""
+}
+
+# Get a package version as selected by a generated choice in kconfig.
+CT_GetChoicePkgBuildVersion()
+{
+ local choice="${1}"
+ local var="${2}"
+ local component
+
+ # Find the selected component
+ eval "component=\${CT_${choice}_CHOICE_KSYM}"
+ CT_GetPkgBuildVersion "${choice}" "${component}" "${var}"
}