Исправлено DIGESTS название. flash://iso -> flash://linux

Mike Khiretskiy 9 years ago
parent be2a5e5055
commit 5eb3d0538a

@ -936,7 +936,7 @@ class Builder(Update):
return "%s.list" % iso_file
def _digest_file(self, iso_file):
return "%s.DIGEST" % iso_file
return "%s.DIGESTS" % iso_file
def create_package_list(self, chroot, iso_file):
"""
@ -1161,3 +1161,30 @@ class Builder(Update):
raise BuilderError(_("Failed to extract kernel from %s")
% isofn)
return True
def iso_migrate(self, flash_path):
"""
Миграция образов из flash:/iso в flash:/linux
:param flash_path:
:return:
"""
try:
old_path = path.join(flash_path, "iso")
new_path = path.join(flash_path, "linux")
if path.exists(old_path):
if listDirectory(old_path):
if path.exists(new_path):
for fn in listDirectory(old_path):
old_fn = path.join(old_path,fn)
new_fn = path.join(new_path,fn)
if path.exists(new_fn):
os.unlink(new_fn)
os.rename(old_fn, new_fn)
else:
os.rename(old_path, new_path)
else:
os.rmdir(old_path)
except OSError as e:
self.printWARNING(_("Failed to migrate flash linux directory"))
self.printWARNING(str(e))
return True

@ -48,6 +48,9 @@ class ClBuilderMenuAction(Action):
{'name': 'mount_flash',
'method': 'Builder.remount_rw(cl_builder_flash_path)',
},
{'name': 'iso_linux_migrate',
'method': 'Builder.iso_migrate(cl_builder_flash_path)'
},
{'name': 'protect_off',
'method': 'Builder.setVariable("cl_protect_use_set","off",True)'
},

@ -1311,10 +1311,10 @@ class VariableClBuilderFlashRepository(ReadonlyVariable):
"""
Хранилище по умолчанию для iso образов на flash
"""
suffix = "iso"
suffix = "linux"
def get(self):
return path.join(self.Get('cl_builder_flash_path'), "iso")
return path.join(self.Get('cl_builder_flash_path'), self.suffix)
class VariableClBuilderFlashDevPath(Variable):

Loading…
Cancel
Save