summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-07-07 05:18:43 (GMT)
committerAlexey Neyman <stilor@att.net>2017-07-08 17:57:57 (GMT)
commit1b207d0adc5f78f000a7d8ca4431515790639da9 (patch)
tree675da8e9b67376a6d61c4a51a769758356009f7f /bootstrap
parent4bd6d5f5603e9733852f18fb604eea8f04cd94cc (diff)
Allow packages to define "relevant" part of the version
E.g., only include minor/major of the Linux kernel into the kconfig symbol. In the future, to be defined by all packages, but for now matches the current versioning in the packages. Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap24
1 files changed, 20 insertions, 4 deletions
diff --git a/bootstrap b/bootstrap
index 8a5b605..6b76a9b 100755
--- a/bootstrap
+++ b/bootstrap
@@ -219,6 +219,20 @@ run_template()
kconfigize()
{
local v="${1}"
+ local p pb pa vx
+ shift
+
+ # If optional patterns are provided, find the first match
+ # and contract to the matching portion.
+ for p in "$@"; do
+ pb=${p%|*}
+ pa=${p#*|}
+ eval "vx=\${v#${pb}${pa}}"
+ if [ "${v%${pa}${vx}}" != "${v}" ]; then
+ v=${v%${pa}${vx}}
+ break
+ fi
+ done
v=${v//[^0-9A-Za-z_]/_}
echo "${v^^}"
@@ -429,6 +443,7 @@ find_forks()
pkg_nforks[${1}]=$[pkg_nforks[${1}]+1]
pkg_forks[${1}]+=" ${1} "
pkg_milestones[${1}]=`sort_versions ${info[milestones]}`
+ pkg_relevantpattern[${1}]=${info[relevantpattern]}
pkg_masters+=( "${1}" )
fi
# Keep sorting so that preferred fork is first
@@ -511,7 +526,7 @@ enter_version()
eval `read_version_desc ${info[fork]} ${version}`
info[ver]=${version}
- info[kcfg]=`kconfigize ${version}`
+ info[kcfg]=`kconfigize ${version} ${info[relevantpattern]}`
info[ver_postfix]=${ver_postfix[,${info[obsolete]},${info[experimental]},]}
}
@@ -529,7 +544,7 @@ enter_milestone()
gen_packages()
{
- local -A pkg_forks pkg_milestones pkg_nforks
+ local -A pkg_forks pkg_milestones pkg_nforks pkg_relevantpattern
local -a pkg_masters pkg_all pkg_preferred
pkg_all=( `cd packages && \
@@ -558,6 +573,7 @@ gen_packages()
[masterpfx]=`kconfigize ${p}` \
[nforks]=${pkg_nforks[${p}]} \
[all_milestones]=${pkg_milestones[${p}]} \
+ [relevantpattern]=${pkg_relevantpattern[${p}]} \
)
set_iter fork ${pkg_forks[${p}]}
set_iter milestone ${pkg_milestones[${p}]}
@@ -588,8 +604,8 @@ enter_choice()
local choice="${1}"
local l
- # TBD generate sourcing of versions/$component.in automatically - and add a comment that versions must
- # TBD generated first? [what to do with glibc/glibc-ports]
+ # TBD generate sourcing of versions/$component.in automatically - and add a comment
+ # TBD that versions must be generated first? [what to do with glibc/glibc-ports]
info[choice]="${choice}"
info[kcfg_choice]=`kconfigize "${choice}"`