summaryrefslogtreecommitdiff
path: root/maintainer
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-05-30 05:32:38 (GMT)
committerAlexey Neyman <stilor@att.net>2017-07-08 17:57:56 (GMT)
commit567277099a487508fd228a4c56f3583db3fa96c9 (patch)
tree19b7f40c0f6e4e6284e799dbac1098bd8805dc2d /maintainer
parent57426168ad2c7e8367786ed466c86f6aeb49b3c3 (diff)
Fix the references to old config variables
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'maintainer')
-rwxr-xr-xmaintainer/gen-kconfig.sh1
-rwxr-xr-xmaintainer/gen-versions.sh80
-rw-r--r--maintainer/kconfig-versions.template91
3 files changed, 120 insertions, 52 deletions
diff --git a/maintainer/gen-kconfig.sh b/maintainer/gen-kconfig.sh
index 4066fbb..096599c 100755
--- a/maintainer/gen-kconfig.sh
+++ b/maintainer/gen-kconfig.sh
@@ -81,6 +81,7 @@ gen_choice() {
printf '\n'
printf 'config %s\n' "${cfg_prefix}"
+ printf ' string\n'
for entry in `get_components ${base_dir}`; do
file="${base_dir}/${entry}.in"
_entry=$(printf '%s\n' "${entry}" |"${sed}" -r -s -e 's/[-.+]/_/g;')
diff --git a/maintainer/gen-versions.sh b/maintainer/gen-versions.sh
index 99e9791..cd99432 100755
--- a/maintainer/gen-versions.sh
+++ b/maintainer/gen-versions.sh
@@ -1,7 +1,21 @@
#!/bin/bash
########################################
-# Common meta-language implementation
+# Common meta-language implementation. Syntax:
+#
+# The template file is processed line by line, with @@VAR@@ placeholders
+# being replaced with a value of the VAR variable.
+# Special lines start with '#!' and a keyword:
+#
+# #!//
+# Comment, the rest of the line is ignored
+# #!if COND
+# Conditional: the lines until the matching #!end-if are processed
+# only if the conditional COND evaluates to true.
+# #!foreach NAME
+# Iterate over NAME entities (the iterator must be set up first
+# using the set_iter function), processing the lines until the matching
+# #!end-foreach line.
declare -A info
@@ -12,7 +26,7 @@ debug()
fi
}
-info()
+msg()
{
if [ -z "${QUIET}" ]; then
echo "INFO :: $@" >&2
@@ -125,7 +139,7 @@ run_lines()
while [ "${l}" -le "${end}" ]; do
lnext=$[l+1]
s="${tlines[${l}]}"
- # Expand @@foo@@ to ${info[foo]}. First escape quotes/backslashes.
+ # Expand @@foo@@ to ${info[foo]}. First escape variables/backslashes for evals below.
s="${s//\\/\\\\}"
s="${s//\$/\\\$}"
while [ -n "${s}" ]; do
@@ -352,13 +366,28 @@ sort_versions()
read_file()
{
- local l
+ local l p
while read l; do
+ l="${p}${l}"
+ p=
case "${l}" in
- "#"*) continue;;
- *=*) echo "info[${l%%=*}]=${l#*=}";;
- *) error "syntax error in '${1}': '${l}'"
+ "")
+ continue
+ ;;
+ *\\)
+ p="${l%\\}"
+ continue
+ ;;
+ "#"*)
+ continue
+ ;;
+ *=*)
+ echo "info[${l%%=*}]=${l#*=}"
+ ;;
+ *)
+ error "syntax error in '${1}': '${l}'"
+ ;;
esac
done < "${1}"
}
@@ -410,6 +439,7 @@ enter_fork()
info[repository_cset]=HEAD
info[fork]=${fork}
info[name]=${fork}
+ info[mirrors]=
eval `read_package_desc ${fork}`
@@ -426,6 +456,7 @@ enter_fork()
info[repository_url]=${info[repository]##* }
info[repository_dflt_branch]=${dflt_branch[${info[vcs]}]}
fi
+ info[versionlocked]=`kconfigize "${info[versionlocked]}"`
versions=`cd packages/${fork} && \
for f in */version.desc; do [ -r "${f}" ] && echo "${f%/version.desc}"; done`
@@ -449,13 +480,6 @@ enter_fork()
fi
}
-set_latest_milestone()
-{
- if [ `cmp_versions ${info[ms]} ${info[ver]}` -le 0 -a -z "${milestone}" ]; then
- milestone=${info[ms_kcfg]}
- fi
-}
-
enter_version()
{
local -A ver_postfix=( \
@@ -463,35 +487,23 @@ enter_version()
[,,yes,]=" (EXPERIMENTAL)" \
[,yes,yes,]=" (OBSOLETE,EXPERIMENTAL)" )
local version="${1}"
- local tmp milestone
eval `read_version_desc ${info[fork]} ${version}`
info[ver]=${version}
info[kcfg]=`kconfigize ${version}`
info[ver_postfix]=${ver_postfix[,${info[obsolete]},${info[experimental]},]}
-
- # TBD do we need "prev" version?
- tmp=" ${info[all_versions]} "
- tmp=${tmp##* ${version} }
- info[prev]=`kconfigize ${tmp%% *}`
-
- # Find the latest milestone preceding this version
- milestone=
- do_foreach milestone set_latest_milestone
- info[milestone]=${milestone}
}
enter_milestone()
{
local ms="${1}"
- local tmp
+ local cmp
info[ms]=${ms}
info[ms_kcfg]=`kconfigize ${ms}`
-
- tmp=" ${info[all_milestones]} "
- tmp=${tmp##* ${ms} }
- info[ms_prev]=`kconfigize ${tmp%% *}`
+ if [ -n "${info[ver]}" ]; then
+ info[version_cmp_milestone]=`cmp_versions ${info[ver]} ${info[ms]}`
+ fi
}
rm -rf "${config_dir}"
@@ -502,7 +514,7 @@ pkg_all=( `cd packages && \
while read f; do [ -r "${f}" ] && echo "${f%/package.desc}"; done | \
xargs echo` )
-info "Generating package version descriptions"
+msg "Generating package version descriptions"
debug "Packages: ${pkg_all[@]}"
# We need to group forks of the same package into the same
@@ -511,12 +523,12 @@ debug "Packages: ${pkg_all[@]}"
for p in "${pkg_all[@]}"; do
find_forks "${p}"
done
-info "Master packages: ${pkg_masters[@]}"
+msg "Master packages: ${pkg_masters[@]}"
# Now for each master, create its kconfig file with version
# definitions.
for p in "${pkg_masters[@]}"; do
- info "Generating '${config_dir}/${p}.in'"
+ msg "Generating '${config_dir}/${p}.in'"
exec >"${config_dir}/${p}.in"
# Base definitions for the whole config file
info=( \
@@ -532,4 +544,4 @@ for p in "${pkg_masters[@]}"; do
# TBD get rid of the "origin" completely and use just the fork name?
run_template "${template}"
done
-info "Done!"
+msg "Done!"
diff --git a/maintainer/kconfig-versions.template b/maintainer/kconfig-versions.template
index c6d001e..9343f18 100644
--- a/maintainer/kconfig-versions.template
+++ b/maintainer/kconfig-versions.template
@@ -58,19 +58,6 @@ config @@pfx@@_SRC_DEVEL
Check out from vendor repository at:
@@repository_url@@
-#!end-if
-config @@pfx@@_SRC_CUSTOM
- bool "Custom location"
- depends on EXPERIMENTAL
- help
- Custom directory or tarball.
-
-endchoice
-#!if [ -n "@@all_versions@@" ]
-endif
-#!end-if
-
-#!if [ -n "@@repository@@" ]
if @@pfx@@_SRC_DEVEL
config @@pfx@@_DEVEL_VCS
@@ -95,7 +82,13 @@ config @@pfx@@_DEVEL_REVISION
Commit ID or revision ID to check out.
endif
+
#!end-if
+config @@pfx@@_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
if @@pfx@@_SRC_CUSTOM
@@ -106,9 +99,40 @@ config @@pfx@@_CUSTOM_LOCATION
endif
+endchoice
#!if [ -n "@@all_versions@@" ]
+endif
+
+config @@pfx@@_MIRRORS_ARRAY
+ string
+ default "@@mirrors@@"
+#!end-if
+
+#!// Below, we explicitly select all milestones to which a given version
+#!// compares greater-or-equal. We don't select just the latest applicable
+#!// (and letting milestones chain-select each other, with FOO_6_or_later
+#!// selecting FOO_5_or_later and so on) so that we can handle the cases
+#!// where we need to identify a range of releases on a branch, for example,
+#!// "all FOO releases after 4.9.1 but before 4.9.3".
+#!//
+#!if [ -n "@@all_versions@@" -a -z "@@versionlocked@@" ]
choice
bool "Version of @@name@@"
+ help
+ For a released version, select the version of @@name@@ to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building @@name@@.
+
+config @@pfx@@_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on @@pfx@@_SRC_DEVEL || @@pfx@@_SRC_CUSTOM
+#!foreach milestone
+ select @@masterpfx@@_@@ms_kcfg@@_or_later
+ depends on !@@masterpfx@@_REQUIRE_@@ms_kcfg@@_or_older
+#!end-foreach
#!foreach version
config @@pfx@@_V_@@kcfg@@
@@ -119,14 +143,39 @@ config @@pfx@@_V_@@kcfg@@
#!if [ "@@experimental@@" = "yes" ]
depends on EXPERIMENTAL
#!end-if
-#!if [ -n "@@milestone@@" ]
- select @@masterpfx@@_@@milestone@@_or_later
+#!foreach milestone
+#!if [ "@@version_cmp_milestone@@" -ge 0 ]
+ select @@masterpfx@@_@@ms_kcfg@@_or_later
#!end-if
+#!if [ "@@version_cmp_milestone@@" -gt 0 ]
+ depends on !@@masterpfx@@_REQUIRE_@@ms_kcfg@@_or_older
+#!end-if
+#!if [ "@@version_cmp_milestone@@" -lt 0 ]
+ depends on !@@masterpfx@@_REQUIRE_@@ms_kcfg@@_or_later
+#!end-if
+#!end-foreach
#!end-foreach
+config @@pfx@@_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on @@pfx@@_SRC_DEVEL || @@pfx@@_SRC_CUSTOM
+#!foreach milestone
+ depends on !@@masterpfx@@_REQUIRE_@@ms_kcfg@@_or_later
+#!end-foreach
+
endchoice
#!end-if
+#!if [ -n "@@versionlocked@@" ]
+#!foreach version
+config @@pfx@@_V_@@kcfg@@
+ def_bool y
+ depends on @@versionlocked@@_V_@@kcfg@@
+
+#!end-foreach
+#!end-if
+
#!if [ "@@nforks@@" -ge 2 ]
endif
#!end-if
@@ -141,10 +190,16 @@ config @@pfx@@_VERSION
#!end-foreach
#!foreach milestone
+#!// Milestones selected by a chosen version of this package
config @@masterpfx@@_@@ms_kcfg@@_or_later
bool
-#!if [ -n "@@ms_prev@@" ]
- select @@masterpfx@@_@@ms_prev@@_or_later
-#!end-if
+
+#!// Milestone requirements selected by other packages that restrict
+#!// the choices in this package
+config @@masterpfx@@_REQUIRE_@@ms_kcfg@@_or_later
+ bool
+
+config @@masterpfx@@_REQUIRE_@@ms_kcfg@@_or_older
+ bool
#!end-foreach