Implement Recipe.HasPatches(), which returns true if any of the trees
has patches.
Call it in test.go:test() before applying and/or building.
Signed-off-by: George Dunlap <george.dunlap@citrix.com>
return
}
+// Return 'true' if any tree recipe has patches
+// FIXME: Should this be *all* specified tree recipes instead?
+func (r *Recipe) HasPatches() (has bool) {
+ r.ForEachTree(func (t Tree) error {
+ tr := r.Recipes[t]
+ if tr.HasPatches() {
+ has = true
+ return fmt.Errorf("Stop processing")
+ }
+ return nil
+ })
+ return
+}
+
func (r *Recipe) MakePatches(prefix string, sync bool) (count int, err error) {
branch, baseline := r.branchName(prefix)
return 1
}
+ if !r.HasPatches() {
+ fmt.Printf("No patches for version %s, skipping\n", v)
+ continue
+ }
+
if apply {
err := r.Apply(prefix)
if err != nil {