]> xenbits.xensource.com Git - people/gdunlap/xsatool.git/commit
meta: Avoid redundant XenVersion information in recipe files
authorGeorge Dunlap <george.dunlap@citrix.com>
Fri, 8 Dec 2017 17:40:32 +0000 (17:40 +0000)
committerGeorge Dunlap <george.dunlap@citrix.com>
Fri, 8 Dec 2017 17:40:32 +0000 (17:40 +0000)
commitc0c046077d7775738106db8c11867c520db1279b
treeabe9c2af68351ffc60df668d9af6be514d1f5692
parentcdd0b5ca28051b3d642afc6dc71c6fef3a47c97d
meta: Avoid redundant XenVersion information in recipe files

In the per-XSA meta file, we used to map recipes from XenVersion to
recipe; and then the recipe itself also contained the XenVersion.
This was loaded off the disk verbatim and not checked.

This presents an opportunity to make a mistake when editing the file
by hand (or with generic JSON-parsing libraries): if they don't match,
you might ask for a recipe for 4.10 but end up with a tree based on
master.

There's no need to save the version number in each recipe in the file.
Exclude the XenVersion struct element from being marshalled, and set
it on load with the version in the map (as we set the xsa
information).

Old metadata formats will still load correctly; `xsatool NNN
canonical` will effectively remove the information.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
meta.go
recipe.go