[elbe-devel] XML Includes --- thoughts

Manuel Traut manuel.traut at linutronix.de
Tue Jul 4 19:14:17 CEST 2017


Hi,

> some time ago I read in the docs, that elbe now supports XML includes.
> 
> Reading, looking at the examples, and trying it out, I'm not sure, whether I
> like it.
> 
> What bothers me, is that it does not really support the "do not repeat
> yourself"
> credo. For example:
> 
> The tag <pkg-list> can be separated out, so one file includes one version:
> > x86_32-pc-hdimg-with-include-production.xml:            <xi:include
> > href="includes/prod/pkglist.xml"/>
> > x86_32-pc-hdimg-with-include-development.xml:           <xi:include
> > href="includes/devel/pkglist.xml"/>
> 
> In this particular example the two included files are almost identical. Which
> is not surprising given that xml-include didn't like my attempts to include
> unbalanced snippets :-)

But we thought, it's something we can get 'for-free' from xml, so why not
support it..

> What I would like to have is
> 
> mybuild.xml
> > <ns0:RootFileSystem xmlns:ns0="https://www.linutronix.de/projects/Elbe"
> > ...
> > 
> >     <pkg-list>
> >         <!-- all variants -->
> >         <pkg>linux-image-local1-4.9.18-rt14</pkg>
> >         <pkg>ntp</pkg>
> >         <pkg>openssh-server</pkg>
> >     <pkg-list>
> and for variants either *conditionally* include snippets
> >     <pkg-list variant="devel">
> >          <pkg>strace</pkg>
> >     <pkg-list>

We could add this attribute to other tags as well, e.g. for a partition and
an bylabel entry, ..

And for building we can use, sth. like

elbe initvm submit --variant=devel,debug your.xml

to specify which tags should be used and only the 'used' tags are stored in
the source.xml.

I think this could become sth. powerful..

> or *conditionally* include separate files
> >     <include variant="devel">./include/pkg-devel.xml</include>
> >     <include variant="customer1">./include/pkg-customer1.xml</include>
> >     <include variant="customer2">./include/pkg-customer2.xml</include>
> or similar. This way there needs to be only one build.xml and not
> build-variant1.xml build-variant2.xml ...
> 
> I admit that this is heavily influenced from working with kiwi[1] for several
> years in my last job. Your milage may vary. Me being illiterate in xml, and
> mostly illiterate in python, I cannot even estimate how complex a change this
> would be. But I suspect it to be rather large/fundamental.

Please add the ideas to our github isue page [0]

Thanks,

  Manuel


[0] https://github.com/linutronix/elbe/issues




More information about the elbe-devel mailing list