Refinements to build.py

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>