]> xenbits.xensource.com Git - people/gdunlap/xsatool.git/commitdiff
recipe: Fix situation where there's no recipe for a prerequisite
authorGeorge Dunlap <george.dunlap@citrix.com>
Mon, 7 Aug 2017 15:57:18 +0000 (16:57 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Mon, 7 Aug 2017 15:57:18 +0000 (16:57 +0100)
It's not uncommon to "open up" several XSAs in a row, and to begin
work on subsequent ones before the backports to previous ones are
done.

If when making the baseline for a given Xen version for an XSA, one of
the prerequisete XSAs doesn't have a recipe for that Xen version, just
skip making the baseline for that version.

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

index af2e31001bfe39147d8e552e46ec03315f9f5cc3..d71ebc8d0702b259b64c1aec41774cbaf645bd2b 100644 (file)
--- a/recipe.go
+++ b/recipe.go
@@ -406,6 +406,12 @@ func (r *Recipe) ApplyBaselines(prefix string) (err error) {
                        // Check to see if there are any patches to apply
                        subr := xsa.GetRecipe(r.XenVersion)
 
+                       if subr == nil {
+                               fmt.Printf("WARNING: No recipe for xsa %d version %v, skipping\n",
+                                       xsanum, r.XenVersion)
+                               continue
+                       }
+
                        subtr, prs := subr.Recipes[tree]
 
                        if !prs || !subtr.HasPatches() {