From 3fbc5c7ff2cdca2b19f453179b310331cd03a06b Mon Sep 17 00:00:00 2001 From: Mike Khiretskiy Date: Tue, 29 Jul 2014 14:06:59 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=20?= =?UTF-8?q?=D1=81=D0=B8=D0=BD=D1=85=D1=80=D0=BE=D0=BD=D0=B8=D0=B7=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D0=B8=20=D0=BE=D0=B2=D0=B5=D1=80=D0=BB=D0=B5=D0=B5?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update/profile.py | 4 +++- update/variables/update.py | 16 +++++++++++++++- update/wsdl_update.py | 5 +++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/update/profile.py b/update/profile.py index 524be5d..fb5188f 100644 --- a/update/profile.py +++ b/update/profile.py @@ -230,7 +230,9 @@ class ProfileRepository(object): Синхронизировать репозиторий """ git = Git() - git.pullRepository(self.directory) + if not git.pullRepository(self.directory, quiet_error=True): + git.resetRepository(self.directory, to_origin=True) + git.pullRepository(self.directory, quiet_error=True) def get_profiles(self): """ diff --git a/update/variables/update.py b/update/variables/update.py index 7e08da9..29a6c1a 100644 --- a/update/variables/update.py +++ b/update/variables/update.py @@ -715,8 +715,10 @@ class VariableClProfileData(ReadonlyTableVariable): try: rep_set = self.Get('cl_update_profile_storage') branch = self.Get('cl_update_profile_branch') - profiles = rep_set.get_profiles(url, branch) rep = rep_set.get_repository(url, branch) + if rep and self.Get('cl_update_profile_sync_set') == 'on': + rep.sync() + profiles = rep_set.get_profiles(url, branch) except GitError: return [[]] arch = self.Get('os_arch_machine_gentoo') @@ -859,3 +861,15 @@ class DataVarsUpdateProfile(SimpleDataVars): def __repr__(self): return "Profile variables" + +class VariableClUpdateProfileSyncSet(Variable): + """ + Не выполнять установку/обновление пакетов при обновлении + """ + type = "bool" + value = "off" + opt = ["-s", "--sync"] + + def init(self): + self.label = _("Synchronize repositories") + self.help = _("synchronize repositories") diff --git a/update/wsdl_update.py b/update/wsdl_update.py index 5bb0c88..101ce55 100644 --- a/update/wsdl_update.py +++ b/update/wsdl_update.py @@ -107,10 +107,11 @@ class Wsdl(WsdlBase): 'groups': [ lambda group: group(_("Repository"), brief=('cl_update_profile_repo_name', - 'cl_update_profile_branch'), + ), hide=("cl_update_profile_rep",), normal=('cl_update_profile_rep',), - expert=('cl_update_profile_branch',)), + expert=('cl_update_profile_branch', + 'cl_update_profile_sync_set')), lambda group: group(_("Profile"), normal=('cl_update_profile_system',), brief=('cl_update_profile_system',