* [Buildroot] [PATCH 0/2] br2-external: export list and versions of used extrenal trees (branch yem/br2-ext-name-ver)
@ 2023-02-11 10:52 Yann E. MORIN
2023-02-11 10:52 ` [Buildroot] [PATCH 1/2] br2-external: make the list of external trees public Yann E. MORIN
2023-02-11 10:52 ` [Buildroot] [PATCH 2/2] br2-external: make version of external trees available Yann E. MORIN
0 siblings, 2 replies; 5+ messages in thread
From: Yann E. MORIN @ 2023-02-11 10:52 UTC (permalink / raw)
To: buildroot; +Cc: Yann E . MORIN
Hello All!
This small two-patch series extends the information exported about the
br2-external trees in use for the current configuration: the list of
br2-external trees names, and the version for each. They are available
in Kconfig, and thus in the .config file, as well as make variables that
are exported in the environment.
Note: we'd have liked to also have the origin of said trees, like the
git origin remote or such, but that is far from trivial to extract.
Indeed, a br2-external on a git tree may have more than one remote
configured, and may get checked-out from a hash that is reachable from
branches in more than one remote.
Regards,
Yann E. MORIN.
----------------------------------------------------------------
Yann E. MORIN (2):
br2-external: make the list of external trees public
br2-external: make version of external trees available
support/scripts/br2-external | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread* [Buildroot] [PATCH 1/2] br2-external: make the list of external trees public 2023-02-11 10:52 [Buildroot] [PATCH 0/2] br2-external: export list and versions of used extrenal trees (branch yem/br2-ext-name-ver) Yann E. MORIN @ 2023-02-11 10:52 ` Yann E. MORIN 2023-05-13 10:06 ` Yann E. MORIN 2023-02-11 10:52 ` [Buildroot] [PATCH 2/2] br2-external: make version of external trees available Yann E. MORIN 1 sibling, 1 reply; 5+ messages in thread From: Yann E. MORIN @ 2023-02-11 10:52 UTC (permalink / raw) To: buildroot; +Cc: Yann E. MORIN Currently, the list of external trees is a private variable, but for debugging or compliance, one may need to get that list. Add a Kconfig option so that the list appears in the .config file, and export the already existing .mk variable in the environment, so that post-build or post-image scripts can use it. Reported-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> --- support/scripts/br2-external | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/support/scripts/br2-external b/support/scripts/br2-external index 2c33e6eacc..5815c6ded0 100755 --- a/support/scripts/br2-external +++ b/support/scripts/br2-external @@ -126,7 +126,7 @@ do_mk() { done printf '\n' - printf 'BR2_EXTERNAL_NAMES = \n' + printf 'export BR2_EXTERNAL_NAMES = \n' printf 'BR2_EXTERNAL_DIRS = \n' printf 'BR2_EXTERNAL_MKS = \n' @@ -181,6 +181,14 @@ do_kconfig() { printf 'menu "External options"\n\n' >>"${outputdir}/.br2-external.in.menus" + { + printf 'config BR2_EXTERNAL_NAMES\n' + printf '\tstring\n' + # Use star-expansion: we really one a single arg. + printf '\tdefault "%s"\n' "${BR2_EXT_NAMES[*]}" + printf '\n' + } >>"${outputdir}/.br2-external.in.paths" + for br2_name in "${BR2_EXT_NAMES[@]}"; do eval br2_desc="\"\${BR2_EXT_DESCS_${br2_name}}\"" eval br2_ext="\"\${BR2_EXT_PATHS_${br2_name}}\"" -- 2.25.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Buildroot] [PATCH 1/2] br2-external: make the list of external trees public 2023-02-11 10:52 ` [Buildroot] [PATCH 1/2] br2-external: make the list of external trees public Yann E. MORIN @ 2023-05-13 10:06 ` Yann E. MORIN 0 siblings, 0 replies; 5+ messages in thread From: Yann E. MORIN @ 2023-05-13 10:06 UTC (permalink / raw) To: buildroot All, On 2023-02-11 11:52 +0100, Yann E. MORIN spake thusly: > Currently, the list of external trees is a private variable, but for > debugging or compliance, one may need to get that list. > > Add a Kconfig option so that the list appears in the .config file, and > export the already existing .mk variable in the environment, so that > post-build or post-image scripts can use it. > > Reported-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> > Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Applied to master, thanks. Regards, Yann E. MORIN. > --- > support/scripts/br2-external | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/support/scripts/br2-external b/support/scripts/br2-external > index 2c33e6eacc..5815c6ded0 100755 > --- a/support/scripts/br2-external > +++ b/support/scripts/br2-external > @@ -126,7 +126,7 @@ do_mk() { > done > printf '\n' > > - printf 'BR2_EXTERNAL_NAMES = \n' > + printf 'export BR2_EXTERNAL_NAMES = \n' > printf 'BR2_EXTERNAL_DIRS = \n' > printf 'BR2_EXTERNAL_MKS = \n' > > @@ -181,6 +181,14 @@ do_kconfig() { > > printf 'menu "External options"\n\n' >>"${outputdir}/.br2-external.in.menus" > > + { > + printf 'config BR2_EXTERNAL_NAMES\n' > + printf '\tstring\n' > + # Use star-expansion: we really one a single arg. > + printf '\tdefault "%s"\n' "${BR2_EXT_NAMES[*]}" > + printf '\n' > + } >>"${outputdir}/.br2-external.in.paths" > + > for br2_name in "${BR2_EXT_NAMES[@]}"; do > eval br2_desc="\"\${BR2_EXT_DESCS_${br2_name}}\"" > eval br2_ext="\"\${BR2_EXT_PATHS_${br2_name}}\"" > -- > 2.25.1 > > _______________________________________________ > buildroot mailing list > buildroot@buildroot.org > https://lists.buildroot.org/mailman/listinfo/buildroot -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 2/2] br2-external: make version of external trees available 2023-02-11 10:52 [Buildroot] [PATCH 0/2] br2-external: export list and versions of used extrenal trees (branch yem/br2-ext-name-ver) Yann E. MORIN 2023-02-11 10:52 ` [Buildroot] [PATCH 1/2] br2-external: make the list of external trees public Yann E. MORIN @ 2023-02-11 10:52 ` Yann E. MORIN 2023-05-13 10:07 ` Yann E. MORIN 1 sibling, 1 reply; 5+ messages in thread From: Yann E. MORIN @ 2023-02-11 10:52 UTC (permalink / raw) To: buildroot; +Cc: Yann E. MORIN For various reasons, like debugging or compliance, it is important to identify what br2-external trees versions were used for a specific build. Add a Kconfig option that contains the version as computed by support/scripts/setlocalversion; this will appear in the .config file (but not in defconfig files, which is what we want). Also generate that variable on the .mk side, so that it gets properly exported in the environment, for post-build of post-iamge scripts to use as they see fit (like, ensuring there is no dirtyness when in a CI for example). Reported-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> --- support/scripts/br2-external | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/support/scripts/br2-external b/support/scripts/br2-external index 5815c6ded0..8aea479d20 100755 --- a/support/scripts/br2-external +++ b/support/scripts/br2-external @@ -66,7 +66,7 @@ do_validate() { do_validate_one() { local br2_ext="${1}" - local br2_name br2_desc n d + local br2_name br2_desc br2_ver n d if [ ! -d "${br2_ext}" ]; then error "'%s': no such file or directory\n" "${br2_ext}" @@ -104,8 +104,10 @@ do_validate_one() { # Register this br2-external tree, use an absolute canonical path br2_ext="$( cd "${br2_ext}"; pwd )" + br2_ver="$( support/scripts/setlocalversion "${br2_ext}" )" BR2_EXT_NAMES+=( "${br2_name}" ) eval BR2_EXT_PATHS_${br2_name}="\"\${br2_ext}\"" + eval BR2_EXT_VERS_${br2_name}="\"\${br2_ver}\"" eval BR2_EXT_DESCS_${br2_name}="\"\${br2_desc:-\${br2_name}}\"" } @@ -113,7 +115,7 @@ do_validate_one() { # for the br2-external tree do_mk() { local outputdir="${1}" - local br2_name br2_desc br2_ext + local br2_name br2_desc br2_ext br2_ver { printf '#\n# Automatically generated file; DO NOT EDIT.\n#\n' @@ -139,12 +141,14 @@ do_mk() { for br2_name in "${BR2_EXT_NAMES[@]}"; do eval br2_desc="\"\${BR2_EXT_DESCS_${br2_name}}\"" eval br2_ext="\"\${BR2_EXT_PATHS_${br2_name}}\"" + eval br2_ver="\"\${BR2_EXT_VERS_${br2_name}}\"" printf '\n' printf 'BR2_EXTERNAL_NAMES += %s\n' "${br2_name}" printf 'BR2_EXTERNAL_DIRS += %s\n' "${br2_ext}" printf 'BR2_EXTERNAL_MKS += %s/external.mk\n' "${br2_ext}" printf 'export BR2_EXTERNAL_%s_PATH = %s\n' "${br2_name}" "${br2_ext}" printf 'export BR2_EXTERNAL_%s_DESC = %s\n' "${br2_name}" "${br2_desc}" + printf 'export BR2_EXTERNAL_%s_VERSION = %s\n' "${br2_name}" "${br2_ver}" done } >"${outputdir}/.br2-external.mk" } @@ -152,7 +156,7 @@ do_mk() { # Generate the kconfig snippets for the br2-external tree. do_kconfig() { local outputdir="${1}" - local br2_name br2_desc br2_ext br2 + local br2_name br2_desc br2_ext br2_ver br2 local -a items items=( @@ -192,11 +196,15 @@ do_kconfig() { for br2_name in "${BR2_EXT_NAMES[@]}"; do eval br2_desc="\"\${BR2_EXT_DESCS_${br2_name}}\"" eval br2_ext="\"\${BR2_EXT_PATHS_${br2_name}}\"" + eval br2_ver="\"\${BR2_EXT_VERS_${br2_name}}\"" { printf 'config BR2_EXTERNAL_%s_PATH\n' "${br2_name}" printf '\tstring\n' printf '\tdefault "%s"\n' "${br2_ext}" + printf 'config BR2_EXTERNAL_%s_VERSION\n' "${br2_name}" + printf '\tstring\n' + printf '\tdefault "%s"\n' "${br2_ver}" printf '\n' } >>"${outputdir}/.br2-external.in.paths" -- 2.25.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Buildroot] [PATCH 2/2] br2-external: make version of external trees available 2023-02-11 10:52 ` [Buildroot] [PATCH 2/2] br2-external: make version of external trees available Yann E. MORIN @ 2023-05-13 10:07 ` Yann E. MORIN 0 siblings, 0 replies; 5+ messages in thread From: Yann E. MORIN @ 2023-05-13 10:07 UTC (permalink / raw) To: buildroot All, On 2023-02-11 11:52 +0100, Yann E. MORIN spake thusly: > For various reasons, like debugging or compliance, it is important to > identify what br2-external trees versions were used for a specific > build. > > Add a Kconfig option that contains the version as computed by > support/scripts/setlocalversion; this will appear in the .config file > (but not in defconfig files, which is what we want). > > Also generate that variable on the .mk side, so that it gets properly > exported in the environment, for post-build of post-iamge scripts to use > as they see fit (like, ensuring there is no dirtyness when in a CI for > example). > > Reported-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> > Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Applied to master, thanks. Regards, Yann E. MORIN. > --- > support/scripts/br2-external | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > > diff --git a/support/scripts/br2-external b/support/scripts/br2-external > index 5815c6ded0..8aea479d20 100755 > --- a/support/scripts/br2-external > +++ b/support/scripts/br2-external > @@ -66,7 +66,7 @@ do_validate() { > > do_validate_one() { > local br2_ext="${1}" > - local br2_name br2_desc n d > + local br2_name br2_desc br2_ver n d > > if [ ! -d "${br2_ext}" ]; then > error "'%s': no such file or directory\n" "${br2_ext}" > @@ -104,8 +104,10 @@ do_validate_one() { > > # Register this br2-external tree, use an absolute canonical path > br2_ext="$( cd "${br2_ext}"; pwd )" > + br2_ver="$( support/scripts/setlocalversion "${br2_ext}" )" > BR2_EXT_NAMES+=( "${br2_name}" ) > eval BR2_EXT_PATHS_${br2_name}="\"\${br2_ext}\"" > + eval BR2_EXT_VERS_${br2_name}="\"\${br2_ver}\"" > eval BR2_EXT_DESCS_${br2_name}="\"\${br2_desc:-\${br2_name}}\"" > } > > @@ -113,7 +115,7 @@ do_validate_one() { > # for the br2-external tree > do_mk() { > local outputdir="${1}" > - local br2_name br2_desc br2_ext > + local br2_name br2_desc br2_ext br2_ver > > { > printf '#\n# Automatically generated file; DO NOT EDIT.\n#\n' > @@ -139,12 +141,14 @@ do_mk() { > for br2_name in "${BR2_EXT_NAMES[@]}"; do > eval br2_desc="\"\${BR2_EXT_DESCS_${br2_name}}\"" > eval br2_ext="\"\${BR2_EXT_PATHS_${br2_name}}\"" > + eval br2_ver="\"\${BR2_EXT_VERS_${br2_name}}\"" > printf '\n' > printf 'BR2_EXTERNAL_NAMES += %s\n' "${br2_name}" > printf 'BR2_EXTERNAL_DIRS += %s\n' "${br2_ext}" > printf 'BR2_EXTERNAL_MKS += %s/external.mk\n' "${br2_ext}" > printf 'export BR2_EXTERNAL_%s_PATH = %s\n' "${br2_name}" "${br2_ext}" > printf 'export BR2_EXTERNAL_%s_DESC = %s\n' "${br2_name}" "${br2_desc}" > + printf 'export BR2_EXTERNAL_%s_VERSION = %s\n' "${br2_name}" "${br2_ver}" > done > } >"${outputdir}/.br2-external.mk" > } > @@ -152,7 +156,7 @@ do_mk() { > # Generate the kconfig snippets for the br2-external tree. > do_kconfig() { > local outputdir="${1}" > - local br2_name br2_desc br2_ext br2 > + local br2_name br2_desc br2_ext br2_ver br2 > local -a items > > items=( > @@ -192,11 +196,15 @@ do_kconfig() { > for br2_name in "${BR2_EXT_NAMES[@]}"; do > eval br2_desc="\"\${BR2_EXT_DESCS_${br2_name}}\"" > eval br2_ext="\"\${BR2_EXT_PATHS_${br2_name}}\"" > + eval br2_ver="\"\${BR2_EXT_VERS_${br2_name}}\"" > > { > printf 'config BR2_EXTERNAL_%s_PATH\n' "${br2_name}" > printf '\tstring\n' > printf '\tdefault "%s"\n' "${br2_ext}" > + printf 'config BR2_EXTERNAL_%s_VERSION\n' "${br2_name}" > + printf '\tstring\n' > + printf '\tdefault "%s"\n' "${br2_ver}" > printf '\n' > } >>"${outputdir}/.br2-external.in.paths" > > -- > 2.25.1 > > _______________________________________________ > buildroot mailing list > buildroot@buildroot.org > https://lists.buildroot.org/mailman/listinfo/buildroot -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-05-13 10:07 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-02-11 10:52 [Buildroot] [PATCH 0/2] br2-external: export list and versions of used extrenal trees (branch yem/br2-ext-name-ver) Yann E. MORIN 2023-02-11 10:52 ` [Buildroot] [PATCH 1/2] br2-external: make the list of external trees public Yann E. MORIN 2023-05-13 10:06 ` Yann E. MORIN 2023-02-11 10:52 ` [Buildroot] [PATCH 2/2] br2-external: make version of external trees available Yann E. MORIN 2023-05-13 10:07 ` Yann E. MORIN
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.