Browse Source

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

tags/3.2.0_beta1
Mike Khiretskiy 7 years ago
parent
commit
3fbc5c7ff2
3 changed files with 21 additions and 4 deletions
  1. +3
    -1
      update/profile.py
  2. +15
    -1
      update/variables/update.py
  3. +3
    -2
      update/wsdl_update.py

+ 3
- 1
update/profile.py View File

@@ -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):
"""


+ 15
- 1
update/variables/update.py View File

@@ -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")

+ 3
- 2
update/wsdl_update.py View File

@@ -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',


Loading…
Cancel
Save