From d4b21f22c4fac68d8750e5c10d123c23276b2448 Mon Sep 17 00:00:00 2001 From: Mike Khiretskiy Date: Fri, 4 Sep 2015 14:22:03 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=BF=D1=83=D1=82=D0=B8=20=D0=B4=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20packages=20=D0=BF=D1=80=D0=B8=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B2=D0=B5=D1=80=D1=88=D0=B5=D0=BD=D0=B8=D0=B8=20=D1=81?= =?UTF-8?q?=D0=B1=D0=BE=D1=80=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/builder/builder.py | 6 ++++- pym/builder/variables/builder.py | 38 +++++++++++++++----------------- pym/builder/wsdl_builder.py | 3 +++ 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/pym/builder/builder.py b/pym/builder/builder.py index 926d923..23936e2 100644 --- a/pym/builder/builder.py +++ b/pym/builder/builder.py @@ -83,6 +83,11 @@ class Builder(Update): build.close_distributive() if clear: build.distributive.post_clear() + pkgdir = self.clVars.Get('cl_builder_pkgdir') + if '/remote/' in pkgdir: + if path.exists(pkgdir): + removeDir(pkgdir) + Distributive.clear_empty_directories(pkgdir) return True def restore_build(self, build): @@ -520,7 +525,6 @@ class Builder(Update): makeDirectory(target_dn) chmod(target_dn, distrdir_perm) chown(target_dn, root_user, portage_group) - # TODO: /var/calculate/remote возможно тоже должен монтировать для образов pkgdir_files = [] distdir_files = [] diff --git a/pym/builder/variables/builder.py b/pym/builder/variables/builder.py index 06d3669..c1988b2 100644 --- a/pym/builder/variables/builder.py +++ b/pym/builder/variables/builder.py @@ -80,7 +80,7 @@ class VariableClBuilderAvailableDev(Variable): def get(self): if self.Get('os_root_type') == "livecd": - return ["/run/initramfs/workspace/var/calculate/assemble"] + return ["/run/initramfs/workspace/var/calculate/builder"] return [] @@ -155,7 +155,7 @@ class VariableClBuilderSourceFilename(Variable): raise VariableError(_("Wrong image file")) if local_arch == "i686" and arch != local_arch: raise VariableError( - _("Unable to assemble the system {what} from {local}").format( + _("Unable to build the system {what} from {local}").format( what=arch, local=local_arch)) def humanReadable(self): @@ -502,7 +502,7 @@ class VariableClBuilderNewId(BaseBuildId): if value and not re.match("^[A-Za-z][A-Za-z0-9/:_-]+$", value): raise VariableError(_("Wrong symbols in build ID")) if value in self.Get('cl_builder_storage'): - raise VariableError(_("Assemble %s already exists")%value) + raise VariableError(_("Build %s already exists")%value) class VariableClBuilderPreparedId(BaseBuildId): @@ -541,14 +541,14 @@ class VariableClBuilderPreparedId(BaseBuildId): def check(self, value): if not value: - raise VariableError(_("Please select the assemble id")) + raise VariableError(_("Please select the build ID")) l = self.available() if not l: - raise VariableError(_("Assemble %s is not found") % value) + raise VariableError(_("Build %s is not found") % value) if (self.Get('cl_builder_build').status == Build.Status.Broken and self.Get('cl_action') != Actions.Break): raise VariableError( - _("Assemble %s is broken, try to restore build") % value) + _("Build %s is broken, try to restore build") % value) class VariableClBuilderBrokenId(BaseBuildId): @@ -584,10 +584,10 @@ class VariableClBuilderBrokenId(BaseBuildId): def check(self, value): if not value: - raise VariableError(_("Please select the assemble id")) + raise VariableError(_("Please select the build ID")) l = self.available() if not l: - raise VariableError(_("Assemble %s is not found") % value) + raise VariableError(_("Build %s is not found") % value) class VariableClBuilderIdPath(ReadonlyVariable): """ @@ -634,7 +634,7 @@ class VariableClBuilderBasePath(Variable): Базовый путь до сборок (директория, куда будут помещены готовые iso образы, бинарные пакеты и т.д.) """ - value = "/var/calculate/remote/assemble" + value = "/var/calculate/remote/builder" class VariableClBuilderParentPath(ReadonlyVariable): @@ -692,6 +692,9 @@ class VariableClBuilderImageFilename(Variable): metavalue = "IMAGE" untrusted = True + live_base_dn = '/run/initramfs/live/iso' + hdd_base_dn = '/var/calculate/linux' + def init(self): self.label = _("Image path") self.help = _("set image path") @@ -708,19 +711,14 @@ class VariableClBuilderImageFilename(Variable): arch) def get(self): + build_id = self.Get('cl_builder_id') if self.Get('os_root_type') != 'livecd': - base_dn = self.Get('cl_builder_base_path') - build_id = self.Get('cl_builder_id') - build_id_path = self.Get('cl_builder_id_path') - if build_id: - imagename = self._isoname() - return path.join(base_dn, build_id_path, "linux", imagename) + base_dn = self.hdd_base_dn else: - build_id = self.Get('cl_builder_id') - base_dn = '/run/initramfs/live/iso' - if build_id: - imagename = self._isoname() - return path.join(base_dn, imagename) + base_dn = self.live_base_dn + if build_id: + imagename = self._isoname() + return path.join(base_dn, imagename) return "" diff --git a/pym/builder/wsdl_builder.py b/pym/builder/wsdl_builder.py index 45a342b..4f8bf7f 100644 --- a/pym/builder/wsdl_builder.py +++ b/pym/builder/wsdl_builder.py @@ -184,6 +184,9 @@ class Wsdl(WsdlBase): 'cl_templates_locate', 'cl_verbose_set', 'cl_dispatch_conf'), + hide=('cl_templates_locate', + 'cl_verbose_set', + 'cl_dispatch_conf'), next_label=_("Next"))], 'brief': {'next': __("Perform"), 'name': __("Update the Build")}