[wpkg-users] Merge XML files, remove comments and validate?

Mi mi.lists.wpkg at alma.ch
Wed Feb 8 11:36:43 CET 2012



> and use a script to merge all xml-files, remove all comments and validate the new packages.xml and profiles.xml before copying them to %wpkgroot%
>
> Does anyone else use this setup and have a script that will work from Windows? I made a test batch script just to merge the xml-files, which works fine, but I really would like to remove all the comments and validate the xml files also.
> As a secondary option I could use a script to run on our *nix server running the samba server where WPKG is located.

It would probably be much easier to do on your *nix server, which has a proper shell and all the command-line utilities you may need, rather than with Windows batch files.

I don't have a script which merges xml files, but I do check my .xml files for syntax errors after any changes with this very simple command in a "wpkg-check" script:

     for f in config wpkg/settings hosts packages profiles; do
         xmllint --noout /docs2/install/$f.xml && echo OK $f || echo ERROR $f
     done

( I got "xmllint" with the Debian package "libxml2-utils" (http://packages.debian.org/squeeze/libxml2-utils) )





More information about the wpkg-users mailing list