run: concatenate 'install_config' args

This patch enables one to supply a list of arguments to
'install_config'. The arguments appear concatenated in the resulting
config file. This is useful for embedding dynamically generated content
into an otherwise static configuration. For example, in the following
config, the 'pkg' attribute of the '<query>' config node is defined by
the return value of the 'query_pkg' function:

  install_config {
  <config>
    ...
    <start name="depot_query">
      ...
      <config>
        <query pkg="genodelabs/pkg/} [query_pkg] {"/>
      </config>
    </start>
  </config>}
This commit is contained in:
Norman Feske 2017-07-05 16:36:27 +02:00 committed by Christian Helmuth
parent 5f4ca67cf9
commit 3e8c4ebde2
1 changed files with 2 additions and 2 deletions

View File

@ -108,9 +108,9 @@ proc check_xml_syntax {xml_file} {
##
# Install content of specfied variable as init config file
#
proc install_config {config} {
proc install_config { args } {
set fh [open "[run_dir]/genode/config" "WRONLY CREAT TRUNC"]
puts $fh $config
puts $fh [join $args {}]
close $fh
check_xml_syntax [run_dir]/genode/config