Изменена нумерация образов на флешке

master3.4
Mike Khiretskiy 9 years ago
parent 5309cf31f3
commit c6bec0519b

@ -699,7 +699,6 @@ class VariableClBuilderImageFilename(Variable):
Название iso образа
"""
opt = ["--iso"]
value = ""
metavalue = "IMAGE"
untrusted = True
@ -713,12 +712,20 @@ class VariableClBuilderImageFilename(Variable):
if not value:
raise VariableError(_("You must specify image filename"))
def _isoname(self):
def _isoname(self, dn):
shortname = self.Get('os_builder_linux_shortname').lower()
buildnumber = self.Get('os_builder_linux_build')
arch = self.Get('os_builder_arch_machine')
return "%s-%s-%s.iso" % (shortname, buildnumber,
arch)
for i in range(0, 999):
if i:
isoname = "%s-%s-%d-%s.iso" % (shortname, buildnumber,
i, arch)
else:
isoname = "%s-%s-%s.iso" % (shortname, buildnumber,
arch)
fullname = path.join(dn, isoname)
if not path.exists(fullname):
return fullname
def get(self):
build_id = self.Get('cl_builder_id')
@ -727,8 +734,7 @@ class VariableClBuilderImageFilename(Variable):
if self.Get('os_root_type_ext') in RootType.RebuildAvailable:
base_dn = self.Get('cl_builder_flash_repository')
if build_id:
imagename = self._isoname()
return path.join(base_dn, imagename)
return self._isoname(base_dn)
return ""

@ -15,6 +15,7 @@
# limitations under the License.
import os
import re
from os import path
import sys
from calculate.lib.utils.portage import isPkgInstalled
@ -132,7 +133,9 @@ class VariableClBuilderImageData(ReadonlyTableVariable):
def generator(self, isopath):
n = 1
for iso_image in [x for x in listDirectory(isopath, fullPath=True)
numbered = re.compile(r"^.*-(\d+)-(?:x86_64|i686)\.iso$")
for iso_image in [x for x in sorted(listDirectory(isopath,
fullPath=True))
if x.endswith('.iso')]:
try:
with IsoDistributive(iso_image) as image:
@ -144,8 +147,13 @@ class VariableClBuilderImageData(ReadonlyTableVariable):
initrd = dv['cl_builder_initrd_install']
initrd_copy = "initrd-%d" % n
label = dv['cl_builder_iso_label']
m = numbered.search(iso_image)
if m:
label = "%s-%s"%(label, m.group(1))
yield ["cl-%d"%n,
dv['cl_builder_iso_label'],
label,
iso_image,
kernel, kernel_copy,
initrd, initrd_copy,

Loading…
Cancel
Save