|
|
|
@ -202,7 +202,7 @@ class VariableClBuilderSourceFilename(Variable):
|
|
|
|
|
"""
|
|
|
|
|
type = "file"
|
|
|
|
|
element = 'file'
|
|
|
|
|
opt = ["--source"]
|
|
|
|
|
opt = ["--iso"]
|
|
|
|
|
metavalue = "SOURCE"
|
|
|
|
|
untrusted = True
|
|
|
|
|
check_after = ["cl_builder_layered_set"]
|
|
|
|
@ -909,17 +909,32 @@ class VariableClBuilderImageFilename(Variable):
|
|
|
|
|
elif path.exists(value) and not path.isdir(value):
|
|
|
|
|
raise VariableError(_("The image should be a directory"))
|
|
|
|
|
|
|
|
|
|
def check_exists_iso(self, shortname, buildnumber, arch, suffix, addon_dn, dn, i):
|
|
|
|
|
for j in range(i, 999):
|
|
|
|
|
isoname = "%s-%s-%d-%s%s" % (shortname, buildnumber,
|
|
|
|
|
j, arch, suffix)
|
|
|
|
|
for i_dn in (x for x in (addon_dn, dn) if x):
|
|
|
|
|
fullname = path.join(i_dn, isoname)
|
|
|
|
|
if path.exists(fullname):
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def _isoname(self, dn, rewrite=False, addon_dn=None, suffix=".iso"):
|
|
|
|
|
shortname = self.Get('os_builder_linux_shortname').lower()
|
|
|
|
|
buildnumber = self.Get('os_builder_linux_build')
|
|
|
|
|
arch = self.Get('os_builder_arch_machine')
|
|
|
|
|
for i in range(0, 999):
|
|
|
|
|
if i:
|
|
|
|
|
isoname = "%s-%s-%d-%s%s" % (shortname, buildnumber,
|
|
|
|
|
if self.check_exists_iso(shortname, buildnumber, arch, suffix, addon_dn, dn, i):
|
|
|
|
|
continue
|
|
|
|
|
else:
|
|
|
|
|
isoname = "%s-%s-%d-%s%s" % (shortname, buildnumber,
|
|
|
|
|
i, arch, suffix)
|
|
|
|
|
else:
|
|
|
|
|
isoname = "%s-%s-%s%s" % (shortname, buildnumber,
|
|
|
|
|
arch, suffix)
|
|
|
|
|
if self.check_exists_iso(shortname, buildnumber, arch, suffix, addon_dn, dn, 1):
|
|
|
|
|
continue
|
|
|
|
|
else:
|
|
|
|
|
isoname = "%s-%s-%s%s" % (shortname, buildnumber,
|
|
|
|
|
arch, suffix)
|
|
|
|
|
fullname = ""
|
|
|
|
|
for i_dn in (x for x in (addon_dn, dn) if x):
|
|
|
|
|
fullname = path.join(i_dn, isoname)
|
|
|
|
|