Добавлен параметр синхронизации оверлеев

master3.3
Mike Khiretskiy 10 years ago
parent 7d15c68adb
commit 3fbc5c7ff2

@ -230,7 +230,9 @@ class ProfileRepository(object):
Синхронизировать репозиторий Синхронизировать репозиторий
""" """
git = Git() 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): def get_profiles(self):
""" """

@ -715,8 +715,10 @@ class VariableClProfileData(ReadonlyTableVariable):
try: try:
rep_set = self.Get('cl_update_profile_storage') rep_set = self.Get('cl_update_profile_storage')
branch = self.Get('cl_update_profile_branch') branch = self.Get('cl_update_profile_branch')
profiles = rep_set.get_profiles(url, branch)
rep = rep_set.get_repository(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: except GitError:
return [[]] return [[]]
arch = self.Get('os_arch_machine_gentoo') arch = self.Get('os_arch_machine_gentoo')
@ -859,3 +861,15 @@ class DataVarsUpdateProfile(SimpleDataVars):
def __repr__(self): def __repr__(self):
return "Profile variables" return "Profile variables"
class VariableClUpdateProfileSyncSet(Variable):
"""
Не выполнять установку/обновление пакетов при обновлении
"""
type = "bool"
value = "off"
opt = ["-s", "--sync"]
def init(self):
self.label = _("Synchronize repositories")
self.help = _("synchronize repositories")

@ -107,10 +107,11 @@ class Wsdl(WsdlBase):
'groups': [ 'groups': [
lambda group: group(_("Repository"), lambda group: group(_("Repository"),
brief=('cl_update_profile_repo_name', brief=('cl_update_profile_repo_name',
'cl_update_profile_branch'), ),
hide=("cl_update_profile_rep",), hide=("cl_update_profile_rep",),
normal=('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"), lambda group: group(_("Profile"),
normal=('cl_update_profile_system',), normal=('cl_update_profile_system',),
brief=('cl_update_profile_system', brief=('cl_update_profile_system',

Loading…
Cancel
Save