import os, Utils, glob, re bld.substitute("*/**",name="patchsubst") for virttech in Utils.to_list(bld.path.ant_glob("*",dir=True)): if virttech in ["shared","wscript_build"]: continue patchfiles = bld.path.ant_glob('shared/** %s/**'%virttech,src=False,bld=True,dir=False,flat=True) tgen = bld( features = 'tar',#Utils.tar_up, source = patchfiles, target = '%s-patch.tgz'%virttech, name = '%s-patch_tgz'%virttech, root = os.path.join("patches",virttech), rename = lambda x: re.sub(".subst$","",x), ) if virttech != "xenserver": # xenserver uses the patch.tgz file later to make an ISO, so we do not need to install it bld.install_as("${AGENTLIBDIR}/scripts/vm/hypervisor/%s/patch.tgz"%virttech, "%s-patch.tgz"%virttech)