Browse Source

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

master3.3
Mike Khiretskiy 8 years ago
parent
commit
3fbc5c7ff2
  1. 4
      update/profile.py
  2. 16
      update/variables/update.py
  3. 5
      update/wsdl_update.py

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

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

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

Loading…
Cancel
Save