5
0
Fork 0

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

master3.3
Mike Khiretskiy vor 10 Jahren
Ursprung 7d15c68adb
Commit 3fbc5c7ff2

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

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

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

Laden…
Abbrechen
Speichern