Рефакторинг

develop 3.4.1.2
Mike Khiretskiy 9 years ago
parent 66cd9596d7
commit b3ca8fed9c

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2012-2013 Calculate Ltd. http://www.calculate-linux.org
# Copyright 2012-2015 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -14,13 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
__app__ = 'calculate-update'
__version__ = '3.1.8'
__version__ = '3.4.1'
import os
import sys
from calculate.lib.datavars import DataVars
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_update3', sys.modules[__name__])
class DataVarsUpdate(DataVars):
@ -31,4 +31,3 @@ class DataVarsUpdate(DataVars):
self.importVariables()
self.importVariables('calculate.update.variables')
self.defaultModule = "update"

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2014 Calculate Ltd. http://www.calculate-linux.org
# Copyright 2015 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -13,6 +13,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import hashlib
import os
@ -22,13 +23,15 @@ import re
import sys
from calculate.lib.utils.colortext.palette import TextState
from calculate.lib.utils.tools import ignore
from calculate.lib.utils.portage import EmergePackage, PackageList, EmergeUpdateInfo, \
EmergeRemoveInfo, Git, GitError
from calculate.lib.utils.portage import (EmergePackage, PackageList,
EmergeUpdateInfo,
EmergeRemoveInfo, Git, GitError)
Colors = TextState.Colors
import pexpect
from calculate.lib.utils.files import getProgPath, readLinesFile, listDirectory, \
writeFile, readFile
from calculate.lib.utils.files import (getProgPath, readLinesFile,
listDirectory,
writeFile, readFile)
from calculate.lib.utils.colortext.output import XmlOutput
from calculate.lib.utils.colortext.converter import (ConsoleCodes256Converter,
XmlConverter)
@ -98,20 +101,6 @@ class CommandExecutor(object):
if self.child:
self.child.send(s)
class ChrootCommandExecutor(CommandExecutor):
"""
Команда запускаемая в chroot
"""
def __init__(self, chroot_path, cmd, params, env=None, cwd=None,
logfile=None):
self.chroot_path = chroot_path
super(ChrootCommandExecutor, self).__init__(cmd, params, env=env,
cwd=cwd, logfile=logfile)
def get_command(self):
chrootCmd = '/usr/bin/chroot'
return [chrootCmd, self.chroot_path, self.cmd] + self.params
class EmergeCommand(CommandExecutor):
"""
@ -119,54 +108,29 @@ class EmergeCommand(CommandExecutor):
"""
# параметры по умолчанию
default_params = ["-av", "--color=y", "--nospinner"]
cmd = getProgPath("/usr/bin/emerge")
emerge_cmd = getProgPath("/usr/bin/emerge")
def __init__(self, packages, extra_params=None, env=None, cwd=None,
logfile=None, emerge_default_opts=None, use=""):
extra_params = extra_params or []
self.child = None
self.packages = packages
self.params = self.default_params + extra_params
if env is None:
if emerge_default_opts is None:
default_env = {'CLEAN_DELAY': '0'}
env = {'CLEAN_DELAY': '0'}
else:
default_env = {
env = {
'CLEAN_DELAY': '0',
'EMERGE_DEFAULT_OPTS': re.sub(r'(?:^|\s)(--columns)(?=\s|$)','',
'EMERGE_DEFAULT_OPTS': re.sub(
r'(?:^|\s)(--columns)(?=\s|$)', '',
emerge_default_opts)
}
if use:
default_env["USE"] = use
default_env.update(os.environ)
self.env = env or default_env
self.env.update(linux_term_env)
self.cwd = cwd
if logfile:
self.logfile = logfile
env["USE"] = use
env.update(os.environ)
def get_command(self):
return [self.cmd] + self.params + self.packages
class ChrootEmergeCommand(EmergeCommand):
def __init__(self, chroot_path, *args, **kw):
self.chroot_path = chroot_path
params = self.default_params + extra_params + packages
super(EmergeCommand, self).__init__(self.emerge_cmd, params=params,
env=env, cwd=cwd, logfile=logfile)
super(ChrootEmergeCommand, self).__init__(*args, **kw)
def get_command(self):
chrootCmd = '/usr/bin/chroot'
bashCmd = '/bin/bash'
bash_command = (
"env-update &>/dev/null;"
"source /etc/profile &>/dev/null;"
"{emerge_command} {params} {packages}".format(
emerge_command=self.cmd,
params=" ".join(self.params),
packages=" ".join(self.packages)
))
return [chrootCmd, self.chroot_path, bashCmd, "-c",
bash_command]
def Chroot(chroot_path, obj):
"""
@ -203,19 +167,36 @@ def Linux32(obj):
return obj
class EmergeInformationBlock(object):
class InfoBlockInterface(object):
"""
Интерфейс для информационного блока
"""
action = None
token = None
result = None
text_converter = ConsoleCodes256Converter(XmlOutput())
def get_block(self, child):
pass
def add_element(self, element):
"""
:type element: InfoBlockInterface
"""
pass
class EmergeInformationBlock(InfoBlockInterface):
_color_block = "(?:\033\[[^m]+?m)?"
_new_line = "(?:\r*\n)"
token = None
end_token = ["\n"]
re_block = None
action = None
re_match_type = type(re.match("", ""))
re_type = type(re.compile(""))
def __init__(self, parent):
"""
:type parent: EmergeParser
:type parent: InfoBlockInterface
"""
self.result = None
self.text_converter = parent.text_converter
@ -224,6 +205,9 @@ class EmergeInformationBlock(object):
self.children = []
def add_element(self, element):
"""
:type element: InfoBlockInterface
"""
self.children.append(element)
def __str__(self):
@ -308,7 +292,7 @@ class UninstallPackagesBlock(EmergeInformationBlock):
_new_line = EmergeInformationBlock._new_line
_color_block = EmergeInformationBlock._color_block
token = ["Calculating removal order",
"These are the packages that would be unmerged",]
"These are the packages that would be unmerged"]
end_token = re.compile("All selected packages:.*\n")
re_block = re.compile(
r"(?:{token}).*?{nl}(.*){nl}All selected packages: (.*?){nl}".
@ -326,6 +310,7 @@ class UninstallPackagesBlock(EmergeInformationBlock):
list_block = XmlConverter().transform(self.result).split()
self.list = PackageList(map(EmergePackage, list_block))
class GroupEmergeInformationBlock(EmergeInformationBlock):
"""
Группа блоков
@ -456,7 +441,6 @@ class QuestionGroup(GroupEmergeInformationBlock):
child.expect_exact(self.end_token)
match = child.match
data = token + child.before + match
#self.get_data(before + data)
child.before = before
for block in self.children:
child.match = re.search(block.token, data)
@ -668,13 +652,12 @@ class RevdepPercentBlock(NotifierInformationBlock):
except pexpect.EOF:
self.result = ""
class EmergeParser(object):
class EmergeParser(InfoBlockInterface):
"""
Парсер вывода emerge
"""
def __init__(self, command, run=False):
self.text_converter = ConsoleCodes256Converter(XmlOutput())
self.command = command
self.elements = {}
@ -710,6 +693,9 @@ class EmergeParser(object):
self.fetching.action = lambda child: None
def add_element(self, element):
"""
:type element: InfoBlockInterface
"""
if element.token:
if type(element.token) == list:
for token in element.token:
@ -765,6 +751,7 @@ class Md5Checkvalue(MtimeCheckvalue):
def value_func(self, fn):
return hashlib.md5(readFile(fn)).hexdigest()
class GitCheckvalue(object):
def __init__(self, rpath):
self.rpath = rpath
@ -846,7 +833,7 @@ class EmergeCache(object):
self.files_control_values = {}
cache_file_lines = readLinesFile(self.cache_file)
for line in cache_file_lines:
if not "=" in line:
if "=" not in line:
break
k, v = line.split('=')
self.files_control_values[k] = v.strip()
@ -855,6 +842,7 @@ class EmergeCache(object):
def get_control_values(self):
def generate():
for obj in self.check_list:
for checkvalue in obj.checkvalues():
yield checkvalue
for check_value in obj.checkvalues():
yield check_value
return dict(generate())

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2014 Calculate Ltd. http://www.calculate-linux.org
# Copyright 2014-2015 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -13,12 +13,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
from os import path
import shutil
import os
from calculate.lib.utils.files import listDirectory, readFile, readLinesFile, \
makeDirectory, removeDir
from calculate.lib.utils.files import (listDirectory, readFile, readLinesFile,
makeDirectory, removeDir)
from calculate.lib.utils.git import Git
from update import UpdateError
@ -27,8 +27,17 @@ setLocalTranslate('cl_update3', sys.modules[__name__])
DEFAULT_BRANCH = Git.Reference.Master
class RepositoryStorageInterface(object):
def __iter__(self):
raise StopIteration
def get_profiles(self, url, branch=DEFAULT_BRANCH):
return []
def get_repository(self, url, branch=DEFAULT_BRANCH):
return None
class RepositoryStorage(object):
class RepositoryStorage(RepositoryStorageInterface):
directory = '/tmp'
def __init__(self, directory):
@ -44,6 +53,10 @@ class RepositoryStorage(object):
def get_profiles(self, url, branch=DEFAULT_BRANCH):
return []
def get_repository(self, url, branch=DEFAULT_BRANCH):
return None
class ProfileStorage(RepositoryStorage):
def get_profiles(self, url, branch=DEFAULT_BRANCH):
rep = self.get_repository(url, branch)
@ -54,6 +67,7 @@ class ProfileStorage(RepositoryStorage):
def get_repository(self, url, branch=DEFAULT_BRANCH):
return None
class LocalStorage(ProfileStorage):
"""
Локальное хранилище репозиториев, при запросе по урлу смотрит, доступные
@ -64,7 +78,6 @@ class LocalStorage(ProfileStorage):
if rep.is_like(url, branch):
return rep
class CacheStorage(ProfileStorage):
"""
Хранилище репозиториев, при запросе по урлу смотрит, доступные
@ -78,7 +91,7 @@ class CacheStorage(ProfileStorage):
else:
return ProfileRepository.clone(url, self, branch)
class RepositoryStorageSet(RepositoryStorage):
class RepositoryStorageSet(RepositoryStorageInterface):
"""
Набор хранилищ репозиториев
"""

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2014 Calculate Ltd. http://www.calculate-linux.org
# Copyright 2014-2015 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -13,7 +13,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from functools import wraps, partial
from functools import wraps
import random
import sys
@ -52,7 +52,7 @@ from calculate.lib.utils.files import (getProgPath, STDOUT, removeDir,
import emerge_parser
import logging
from emerge_parser import (EmergeParser, EmergeCommand, EmergeError,
EmergeCache, ChrootEmergeCommand)
EmergeCache, Chroot)
from calculate.lib.cl_lang import (setLocalTranslate, getLazyLocalTranslate,
RegexpLocalization, _)
@ -141,8 +141,7 @@ class Update(MethodsInterface):
self.update_map = {}
self.refresh_binhost = False
@staticmethod
def get_prog_path(program_name):
def get_prog_path(self, program_name):
return getProgPath(program_name)
def _syncRepository(self, name, url, rpath, revision,
@ -850,11 +849,6 @@ class Update(MethodsInterface):
"""
Выполнить сборку пакета
"""
if self.clVars.Get('cl_chroot_path') != '/':
command_class = partial(ChrootEmergeCommand,
self.clVars.Get('cl_chroot_path'))
else:
command_class = EmergeCommand
deo = self.clVars.Get('cl_emerge_default_opts')
if not packages:
packages = [param]
@ -864,9 +858,14 @@ class Update(MethodsInterface):
if not packages:
return True
extra_params = [param]
with EmergeParser(command_class(list(packages), emerge_default_opts=deo,
command = EmergeCommand(list(packages), emerge_default_opts=deo,
extra_params=extra_params,
use=use)) as emerge:
use=use)
if self.clVars.Get('cl_chroot_path') != '/':
command = Chroot(self.clVars.Get('cl_chroot_path'), command)
with EmergeParser(command) as emerge:
try:
emerge.question.action = lambda x: False
emerge.run()

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2012-2013 Calculate Ltd. http://www.calculate-linux.org
# Copyright 2012-2015 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -22,7 +22,6 @@ from calculate.core.server.gen_pid import search_worked_process
from calculate.lib.cl_template import SystemIni
from calculate.lib.utils.content import getCfgFiles
from calculate.lib.utils.files import getRunCommands, readFile, writeFile
import time
class UpdateInfo(object):

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2010-2013 Calculate Ltd. http://www.calculate-linux.org
# Copyright 2010-2015 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -15,12 +15,13 @@
# limitations under the License.
import sys
from calculate.core.server.func import Action, Tasks
from calculate.core.server.func import Action
from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate
from calculate.lib.utils.files import FilesError
from calculate.update.update import UpdateError
from calculate.lib.utils.portage import GitError
_ = lambda x: x
setLocalTranslate('cl_update3', sys.modules[__name__])
__ = getLazyLocalTranslate(_)
@ -36,7 +37,6 @@ class ClSetupUpdateAction(Action):
failedMessage = __("Failed to configure the updates autocheck procedure!")
interruptMessage = __("Configuration manually interrupted")
# список задач для действия
tasks = [
{'name': 'set_variables',

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2010-2013 Calculate Ltd. http://www.calculate-linux.org
# Copyright 2010-2015 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -18,37 +18,27 @@ import sys
from calculate.core.server.func import Action, Tasks
from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate
from calculate.lib.cl_template import TemplatesError
from calculate.lib.utils.colortext import get_color_print, Colors
from calculate.lib.utils.files import FilesError
from calculate.update.update import UpdateError
from calculate.update.emerge_parser import EmergeError
from calculate.lib.utils.portage import GitError, Eix, EmergeLog, \
EmergeLogNamedTask, PackageList
from ..update_tasks import EmergeMark
from calculate.lib.utils.portage import (GitError, EmergeLog,
EmergeLogNamedTask, PackageList)
from calculate.update.update_tasks import EmergeMark
_ = lambda x: x
setLocalTranslate('cl_update3', sys.modules[__name__])
__ = getLazyLocalTranslate(_)
class ClUpdateAction(Action):
"""
Действие обновление конфигурационных файлов
"""
# ошибки, которые отображаются без подробностей
native_error = (FilesError, UpdateError,
TemplatesError,
GitError, EmergeError)
successMessage = None
failedMessage = None
interruptMessage = __("Update manually interrupted")
class UpdateConditions(object):
@staticmethod
def was_installed(pkg, task_name):
def func():
task = EmergeLog(EmergeLogNamedTask(task_name))
return bool(PackageList(task.list)[pkg])
return func
@staticmethod
def need_depclean(pkg, task_name):
def func(Get):
task = EmergeLog(EmergeLogNamedTask(task_name))
@ -56,14 +46,19 @@ class ClUpdateAction(Action):
or Get('cl_update_outdated_kernel_set') == 'on')
return func
def need_upgrade(pkg):
# TODO: возможно функция не работает
def func():
return bool(Eix(pkg, Eix.Option.Upgrade).get_packages())
return func
def pkg_color(text):
return text
class ClUpdateAction(Action):
"""
Действие обновление конфигурационных файлов
"""
# ошибки, которые отображаются без подробностей
native_error = (FilesError, UpdateError,
TemplatesError,
GitError, EmergeError)
successMessage = None
failedMessage = None
interruptMessage = __("Update manually interrupted")
emerge_tasks = [
{'name': 'premerge_group',
@ -99,8 +94,8 @@ class ClUpdateAction(Action):
'message': __('Find & rebuild packages broken due '
'to a Python upgrade'),
'method': 'Update.emergelike("python-updater")',
'condition': was_installed('dev-lang/python$',
EmergeMark.PythonUpdater),
'condition': UpdateConditions.was_installed(
'dev-lang/python$', EmergeMark.PythonUpdater),
'decoration': 'Update.update_task("%s")' %
EmergeMark.PythonUpdater
},
@ -113,8 +108,8 @@ class ClUpdateAction(Action):
'message': __('Find & rebuild packages and Perl header files '
'broken due to a perl upgrade'),
'method': 'Update.emergelike("perl-cleaner", "all")',
'condition': was_installed('dev-lang/perl$',
EmergeMark.PerlCleaner),
'condition': UpdateConditions.was_installed(
'dev-lang/perl$', EmergeMark.PerlCleaner),
'decoration': 'Update.update_task("%s")' % EmergeMark.PerlCleaner
},
]
@ -125,7 +120,8 @@ class ClUpdateAction(Action):
{'name': 'update_other:update_depclean',
'message': __("Calculating dependencies"),
'method': 'Update.depclean()',
'condition': need_depclean('.*', EmergeMark.Depclean),
'condition': UpdateConditions.need_depclean(
'.*', EmergeMark.Depclean),
'decoration': 'Update.update_task("%s")' % EmergeMark.Depclean
},
]
@ -136,32 +132,34 @@ class ClUpdateAction(Action):
{'name': 'update_other:module_rebuild',
'message': __('Updating Kernel modules'),
'method': 'Update.emerge("","@module-rebuild")',
'condition': was_installed('sys-kernel/.*source',
EmergeMark.KernelModules),
'condition': UpdateConditions.was_installed(
'sys-kernel/.*source', EmergeMark.KernelModules),
'decoration': 'Update.update_task("%s")' %
EmergeMark.KernelModules
},
{'name': 'update_other:x11_module_rebuild',
'message': __('Updating X.Org server modules'),
'method': 'Update.emerge("","@x11-module-rebuild")',
'condition': was_installed('x11-base/xorg-server',
EmergeMark.XorgModules),
'condition': UpdateConditions.was_installed(
'x11-base/xorg-server', EmergeMark.XorgModules),
'decoration': 'Update.update_task("%s")' %
EmergeMark.XorgModules
},
{'name': 'update_other:preserved_rebuild',
'message': __('Updating preserved libraries'),
'method': 'Update.emerge("","@preserved-rebuild")',
'condition': was_installed('.*', EmergeMark.PreservedLibs),
'condition': UpdateConditions.was_installed(
'.*', EmergeMark.PreservedLibs),
'decoration': 'Update.update_task("%s")' %
EmergeMark.PreservedLibs
},
{'name': 'update_other:revdev_rebuild',
'message': __('Checking reverse dependencies'),
'method': 'Update.revdep_rebuild("revdep-rebuild")',
'condition': lambda Get:(Get('cl_update_skip_rb_set') == 'off'
and ClUpdateAction.was_installed('.*',
EmergeMark.RevdepRebuild)()),
'condition': lambda Get: (Get(
'cl_update_skip_rb_set') == 'off' and
UpdateConditions.was_installed(
'.*', EmergeMark.RevdepRebuild)()),
'decoration': 'Update.update_task("%s")' %
EmergeMark.RevdepRebuild
},
@ -318,5 +316,3 @@ class ClUpdateAction(Action):
'condition': lambda Get: Get('cl_rebuild_world_set') == 'on'
},
]
was_installed = staticmethod(was_installed)

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2010-2013 Calculate Ltd. http://www.calculate-linux.org
# Copyright 2010-2015 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -22,6 +22,7 @@ from calculate.lib.utils.files import FilesError
from calculate.update.update import UpdateError
from calculate.lib.utils.portage import GitError
_ = lambda x: x
setLocalTranslate('cl_update3', sys.modules[__name__])
__ = getLazyLocalTranslate(_)
@ -39,7 +40,6 @@ class ClUpdateProfileAction(Action):
failedMessage = __("Failed to update the profile")
interruptMessage = __("Profile update manually interrupted")
# список задач для действия
tasks = [
{'name': 'migrate_repository',
@ -70,6 +70,7 @@ class ClUpdateProfileAction(Action):
'foreach': 'cl_update_profile_sync_rep',
'message': __("Syncing the {eachvar:capitalize} repository"),
'method': 'Update.syncRepositories(eachvar)',
# TODO: неиспользуемое условие
# 'condition': lambda Get: Get('cl_update_profile_sync_rep')
},
{'name': 'sync_reps:regen_cache',
@ -125,7 +126,8 @@ class ClUpdateProfileAction(Action):
'message': __("The system is being configured"),
'method': 'Update.applyProfileTemplates(cl_template_clt_set,'
'True,False,"merge")',
'condition': lambda Get: (Get('cl_update_templates_locate') and
'condition': lambda Get: (
Get('cl_update_templates_locate') and
Get('cl_update_skip_setup_set') == 'off')
},
{'name': 'dispatch_conf',

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2008-2013 Calculate Ltd. http://www.calculate-linux.org
# Copyright 2013-2015 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -14,10 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
from os import path
from calculate.lib.datavars import Variable,VariableError,ReadonlyVariable
from calculate.lib.datavars import ReadonlyVariable
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_update3',sys.modules[__name__])

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2008-2013 Calculate Ltd. http://www.calculate-linux.org
# Copyright 2013-2015 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -19,18 +19,17 @@ import sys
import re
from os import path
from calculate.lib.datavars import (Variable, VariableError,
ReadonlyVariable, ReadonlyTableVariable, TableVariable, FieldValue,
ReadonlyVariable, ReadonlyTableVariable,
TableVariable, FieldValue,
SimpleDataVars, DataVarsError)
from calculate.lib.utils.files import readFile, \
listDirectory, process, pathJoin
from calculate.lib.utils.git import Git
from calculate.lib.utils.files import readFile, listDirectory, process, pathJoin
from calculate.lib.configparser import ConfigParser
from calculate.lib.cl_lang import setLocalTranslate
from calculate.lib.utils.text import simplify_profiles
from calculate.lib.utils.portage import Git, GitError, Layman
from ..profile import RepositoryStorageSet, DEFAULT_BRANCH, \
LocalStorage, ProfileRepository, CacheStorage
from ..profile import (RepositoryStorageSet, DEFAULT_BRANCH,
LocalStorage, ProfileRepository, CacheStorage)
from calculate.lib.variables import linux as lib_linux
from calculate.lib.variables import env
@ -552,7 +551,7 @@ class VariableClUpdateOtherRepData(ReadonlyTableVariable):
if rname in layman_overlays and rname not in repNames:
yield (rname, rpath)
def get(self):
def get(self, hr=False):
return list(self.generator())
class VariableClUpdateOtherRepName(FieldValue,ReadonlyVariable):

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2010-2013 Calculate Ltd. http://www.calculate-linux.org
# Copyright 2010-2015 Calculate Ltd. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@
import sys
from calculate.lib.datavars import VariableError,DataVarsError,DataVars
from calculate.lib.datavars import VariableError,DataVarsError
from calculate.core.server.func import WsdlBase
from calculate.install.install import InstallError
@ -25,7 +25,8 @@ from calculate.lib.utils.portage import GitError
from utils.cl_update import ClUpdateAction
from utils.cl_update_profile import ClUpdateProfileAction
from utils.cl_setup_update import ClSetupUpdateAction
from calculate.lib.cl_lang import setLocalTranslate,getLazyLocalTranslate
from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate, _
setLocalTranslate('cl_update3', sys.modules[__name__])
__ = getLazyLocalTranslate(_)

Loading…
Cancel
Save