Detect the presence of mkisofs upon build, to use it to generate systemvm

This commit is contained in:
Manuel Amador (Rudd-O) 2010-08-31 15:17:17 -07:00
parent 2f30900c61
commit 5ecbe461ce
2 changed files with 38 additions and 40 deletions

View File

@ -384,52 +384,49 @@ if buildpremium:
# ================== systemvm ISO creation ====================
if bld.env.DISTRO not in ["Windows","Mac"]: # mkisofs only on windows
def iso_up(task):
tgt = task.outputs[0].bldpath(task.env)
if _exists(tgt): _unlink(tgt)
inps = []
for inp in task.inputs:
if inp.id&3==Node.BUILD:
src = inp.bldpath(task.env)
srcname = src
srcname = "/".join(srcname.split("/")[1:]) # chop off default/
else:
src = inp.srcpath(task.env)
srcname = src
srcname = "/".join(srcname.split("/")[1:]) # chop off ../
# post-process the paths
inps.append(src)
return Utils.exec_command(
[
task.generator.env.MKISOFS,
"-quiet",
"-r",
"-o",tgt,
] + inps)
def iso_up(task):
tgt = task.outputs[0].bldpath(task.env)
if _exists(tgt): _unlink(tgt)
inps = []
for inp in task.inputs:
if inp.id&3==Node.BUILD:
src = inp.bldpath(task.env)
srcname = src
srcname = "/".join(srcname.split("/")[1:]) # chop off default/
else:
src = inp.srcpath(task.env)
srcname = src
srcname = "/".join(srcname.split("/")[1:]) # chop off ../
# post-process the paths
inps.append(src)
return Utils.exec_command(
[
#"echo",
"mkisofs",
"-quiet",
"-r",
"-o",tgt,
] + inps)
tgen = bld(
rule = iso_up,
source = "patch.tgz target/oss/systemvm.zip",
target = 'target/oss/systemvm.iso',
name = 'systemvm_iso',
after = 'systemvm_zip patch_tgz',
)
bld.process_after(tgen)
bld.install_as("${AGENTLIBDIR}/vms/systemvm.iso", "target/oss/systemvm.iso")
if buildpremium:
tgen = bld(
rule = iso_up,
source = "patch.tgz target/oss/systemvm.zip",
target = 'target/oss/systemvm.iso',
name = 'systemvm_iso',
after = 'systemvm_zip patch_tgz',
source = "patch.tgz target/premium/systemvm.zip",
target = 'target/premium/systemvm.iso',
name = 'systemvm-premium_iso',
after = 'systemvm-premium_zip patch_tgz',
)
bld.process_after(tgen)
bld.install_as("${AGENTLIBDIR}/vms/systemvm.iso", "target/oss/systemvm.iso")
if buildpremium:
tgen = bld(
rule = iso_up,
source = "patch.tgz target/premium/systemvm.zip",
target = 'target/premium/systemvm.iso',
name = 'systemvm-premium_iso',
after = 'systemvm-premium_zip patch_tgz',
)
bld.process_after(tgen)
bld.install_as("${AGENTLIBDIR}/vms/systemvm-premium.iso", "target/premium/systemvm.iso")
bld.install_as("${AGENTLIBDIR}/vms/systemvm-premium.iso", "target/premium/systemvm.iso")
# ================== End systemvm ISO creation ====================

View File

@ -93,6 +93,7 @@ conf.check_tool('java')
conf.check_tool("gnu_dirs")
conf.check_tool("python")
conf.check_python_version((2,4,0))
conf.find_program("mkisofs",mandatory=True,var='MKISOFS')
conf.check_message_1('Detecting distribution')
if platform.system() == 'Windows': conf.env.DISTRO = "Windows"