From 1626b0f13c3513fcec613df18a08ea8f58f818a5 Mon Sep 17 00:00:00 2001 From: Mike khiretskiy Date: Mon, 14 Apr 2014 18:06:48 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D1=82=D0=B8=D0=BB=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sys-apps/calculate-core/Manifest | 2 + .../calculate-core-3.2.0_alpha4-r3.ebuild | 51 ++ .../calculate-core-3.2.0_alpha4-r3.patch | 465 ++++++++++++++++++ sys-apps/calculate-update/Manifest | 2 + .../calculate-update-3.2.0_alpha4-r3.ebuild | 33 ++ .../calculate-update-3.2.0_alpha4-r3.patch | 182 +++++++ sys-apps/calculate-utilities/Manifest | 1 + ...calculate-utilities-3.2.0_alpha4-r5.ebuild | 26 + 8 files changed, 762 insertions(+) create mode 100644 sys-apps/calculate-core/calculate-core-3.2.0_alpha4-r3.ebuild create mode 100644 sys-apps/calculate-core/files/calculate-core-3.2.0_alpha4-r3.patch create mode 100644 sys-apps/calculate-update/calculate-update-3.2.0_alpha4-r3.ebuild create mode 100644 sys-apps/calculate-update/files/calculate-update-3.2.0_alpha4-r3.patch create mode 100644 sys-apps/calculate-utilities/calculate-utilities-3.2.0_alpha4-r5.ebuild diff --git a/sys-apps/calculate-core/Manifest b/sys-apps/calculate-core/Manifest index c09760d..d935fd1 100644 --- a/sys-apps/calculate-core/Manifest +++ b/sys-apps/calculate-core/Manifest @@ -1,6 +1,7 @@ AUX calculate-core-3.2.0_alpha1-r1.patch 3909 SHA256 95338af9088ff7a8b535836c542c73aaaaeda2ae51c4fc070dee64ca015d65fe SHA512 743627d58a4c0c1ec0b57753fa5df320bbdec9102d4e6e3df63abe4e55323e4fac2de26ea22f69cb348f50070618eff5fb9b6848df0679bf73260a238507f4e0 WHIRLPOOL b186232ae83f4b40156bae4a0a66e1cde6b25768a329f7d7144cf4a4c6eee92e11319849cacb0ec2689a1f9801a96c1ae621505143c6bbc6979dd23c6fb4cade AUX calculate-core-3.2.0_alpha4-r1.patch 16117 SHA256 cf06430288a9074388dfb92dcfc930691819a8233023b6560256a0da4086c52b SHA512 b6705837520166f21f3b920e110e1a653039a9e964fec333dc46fce36c4d1a55b6c2096f88c8a932f7105cfd2e517d482623217deeec12079f49eab16384b555 WHIRLPOOL 60ce776de8a1b3e8187e81c63b89551a3db3ab1baaac1394f9537f639ee01170be9d85b39a5f0b75df03ddb8c90bcdc244af23c9f4c1468b9322db06df0628f3 AUX calculate-core-3.2.0_alpha4-r2.patch 16188 SHA256 cd2ea5c818f9fa80db9e2164c35f563bc5a53710c8773e8699872bc133637b98 SHA512 441f08285dbd2ef813645df5c71ff1bf9442aeff39b965436c63ac596e3ba551cb5e9dee6e040655b440a171a893716dc8689891d3a25757fd2cc34b7142a907 WHIRLPOOL bd3006df43f4505006bb3e7f2b5520fda45e18a1e0a580ca48a6b5296b09e02cb78557ce614ad826945dabe085195d84522a054a301c8d3220beede84474fd94 +AUX calculate-core-3.2.0_alpha4-r3.patch 16585 SHA256 f51cecc73fd1085e65922a6c17168baf667833a8edcb5d89fbe82dcc88d87716 SHA512 768a3d8a14248755157cdf015e058efee9ae1ab3d018b4a94a081ae154ce15509ebc952cda01ca753a4d31695d2e2d114d118d74a16dc3c0e7ecb9d2dfd03742 WHIRLPOOL 0b9091130641b14c2f06ca4afe61aefc4557126289db59f5e550b2fda1a5298dff3823bdff88d8b5eacad76b0b1bf09f5eba7a6ddb71a2f01a2041ab75530a46 DIST calculate-core-3.2.0_alpha1.tar.bz2 83658 SHA256 780a4107fcf2d6ee84be721e571f595ae8eb6cebf313cf6feef9c1d64d3a6575 SHA512 906a653de9286cd4d1d922937aa6afafef9a854ebf49f0636a4ad7e5e7ae136d353fe4b8c196c037688f8df7fd3df213800d184734193058df0ebb42090866d0 WHIRLPOOL ca8fe5f238111d78a65f2d42e8f3c169b7074cd5ebd7b8a653824b23d59cdcbfbfc7146ab7d96cc34300a7d418a036729a8c7931fd020c993e97103440e90c4c DIST calculate-core-3.2.0_alpha2.tar.bz2 84591 SHA256 bed467810d02c14ac9e501a0057b652b8e610960193cf3d64c6a78acc5eb5140 SHA512 e77bf6f102c02006d559b96ca51cdb84d25ba9a4b1170c61fbe5158f2539e91acab2ae857a940b030d5b37d430822aa5e2cfe1fbe903436e284d43a3eeec3e09 WHIRLPOOL b299b1a43dbd70fb68efb6ea21b8d8beeef63985b5e0a5deb66668a76e46b7c621af19bf442bbc6cbb289a05beb59e69e3e3464fa392d4c2da56307daa960c20 DIST calculate-core-3.2.0_alpha3.tar.bz2 84808 SHA256 271d4d5752e26f0e4d435b2cad825fbeedeb146418f42f387fcdfc4ead683a0d SHA512 7dbd5a693eebd5d931f3ec8a377c613a6fbaa757bb48cfa90921fd608ce311deac32dee48d619a05f8b24781551142ca1af4d5fc437bedea4d259eaafb0aa52f WHIRLPOOL 5a2ec89684cfcbdb9afdb860b97e331d39ec4bdae5234bdafe856e2d69aa9e1367a184cce8e98a5b68ee5c108d84f6eadaeb94dfb6bde793af0cbc9be5302139 @@ -11,5 +12,6 @@ EBUILD calculate-core-3.2.0_alpha2.ebuild 1129 SHA256 0778b2b2cfa7d8a3b915d3db8a EBUILD calculate-core-3.2.0_alpha3.ebuild 1129 SHA256 59a9203c3139b158fdfdd48d2d594048f8dacd8612e71c4ef26842c7d70edb53 SHA512 07ae01440c1f274145c876b20586db3fda50b4630a238521956239d887a9dcafc38ffa468821d9126bb4f8c3daae3b2f5d7092a8beefda44e1a715a8efd6413e WHIRLPOOL c13d3d6ca6642793ed2ac38a5b9cedd9535337ca1edfa18c941e92be26ddf4fde2fad9d6c143316dc08311415cc423b81a42e7b141c76aca4f73930a4994d7b5 EBUILD calculate-core-3.2.0_alpha4-r1.ebuild 1271 SHA256 f8a79b4bec6d2549705ecddd0353e5ad83d375b3f836fefe48cff36a8fcbb75a SHA512 4614f7dfd4ab99bf2e38095bf02f7fcf5522b630423ab88e9e40ab95793590dd97e1cfb6bb0215cceebcf06c367bcb84b0457bab6c4a7f708dee3799ed22b220 WHIRLPOOL a6096d6e3289a22a20cd0f35ebeda9cc20820e80f39fa6c51a5711123973cb9f70bc720627561438f078c78c56129aac664ef8e9cf439ad22d53c302f4f79ed5 EBUILD calculate-core-3.2.0_alpha4-r2.ebuild 1271 SHA256 527901c373e6bc466bb2651f42fe339871037046f4e1c9b91eddddfd17b97a2b SHA512 74d0638e7072cdf64f646696c313e563404fc1096cf24b71bf42d0d288c4da106b27c8ea4b0f84e6a1c0a97fd3fd9dae4ce69868608e894216f944bb1296b17c WHIRLPOOL 42f765c5f85388eb05ffa83d6f67c584e99ac6ab4426f53e50544f9560bdcbdd81bb1036df382ad29dda69240aed85a9bc83b328a95e34c0dd662e0f9c3b35a8 +EBUILD calculate-core-3.2.0_alpha4-r3.ebuild 1271 SHA256 0ce1729ff0a879ed40c4254d380f75239dbad7c5de4be59a4658cc7c58d2846e SHA512 d19f6f95c97604d46d69175ea0f0589270cde657b5f024bb80ed18f21e7ea271a8dd09566b7520a75345b125419f6efa2ca46f7ac3987cdb25d4f89a864e3a07 WHIRLPOOL 9398a93b877c21ed99ee94a5bf206d198a2720f28cfa6183a68b1cad4e60edf3cac4cd77fdf2456657be46699f76f03aba10ecc62fc4c848e6385cf9e1ed3d72 EBUILD calculate-core-3.2.0_alpha4.ebuild 1129 SHA256 5265cd458eaf572bcdc443d19fceaef043ed57855890f0a017810bbbc835523e SHA512 6265973cb9b86ad68d0c2fc6cffceb14e0713fe2b6140c4daff5d18b71286572996332bd6e6b3679238e6e12cedd76f2d0e0b65fd7e0394426bc39ae65bb8d07 WHIRLPOOL d3f62367e9277aae8123efc10a91f4d614568e365ebeceabc22a3782dbbb3711ea3e8686ec8864c2f2f2856a945c66e5125fbb20d1fd07c169d1925e49e7f99d EBUILD calculate-core-3.2.9999.ebuild 656 SHA256 39383ebc527d7155b147355108ec0b069f7cad95d5fcabc33520f0fe1ee0b971 SHA512 e20a8dea6e20615baeb56069331cdc35a7c37a05afa125c7174c5082852242da446830940c962fd890bb6627d9f5cacf0848834b75bfb1a184a6acfef17f95f8 WHIRLPOOL 3e9f06bf7e2f99a46e3c681fa6f381b7b1883bb15e05c535a7acde55f9092418d0b71d95ce4b2906e8505ea73c4157620303e4e4e4e4de430f11bfd6214b4a88 diff --git a/sys-apps/calculate-core/calculate-core-3.2.0_alpha4-r3.ebuild b/sys-apps/calculate-core/calculate-core-3.2.0_alpha4-r3.ebuild new file mode 100644 index 0000000..9ca700c --- /dev/null +++ b/sys-apps/calculate-core/calculate-core-3.2.0_alpha4-r3.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="3" +SUPPORT_PYTHON_ABIS="1" +PYTHON_DEPEND="2:2.7" +RESTRICT_PYTHON_ABIS="2.4 2.5 2.6 3.*" + +inherit distutils eutils + +SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2" + +DESCRIPTION="The WSDL core for Calculate 3" +HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2" +LICENSE="Apache-2.0" +SLOT="3" +KEYWORDS="amd64 x86" +IUSE="minimal" + +DEPEND="~sys-apps/calculate-lib-3.2.0_alpha4 + >=dev-python/soaplib-1.0 + !minimal? ( dev-python/sudsds + net-libs/dslib + dev-python/pyopenssl + dev-libs/openssl + dev-python/m2crypto + dev-python/cherrypy )" +RDEPEND="${DEPEND}" + +pkg_preinst() { + dosym /usr/sbin/cl-core /usr/sbin/cl-core-setup + dosym /usr/sbin/cl-core /usr/sbin/cl-core-patch +} + +pkg_postinst() { + einfo "For autoconfigure calculate-core for adminuser perform:" + einfo " cl-core --bootstrap " + einfo "For run calculate-core perform:" + einfo " /etc/init.d/calculate-core start" + einfo "Add calcualte core to autorun:" + einfo " rc-update add calculate-core boot" +} + +src_unpack() { + unpack "${A}" + cd "${S}" + + # apply revision changes + epatch "${FILESDIR}/calculate-core-3.2.0_alpha4-r3.patch" +} diff --git a/sys-apps/calculate-core/files/calculate-core-3.2.0_alpha4-r3.patch b/sys-apps/calculate-core/files/calculate-core-3.2.0_alpha4-r3.patch new file mode 100644 index 0000000..6090056 --- /dev/null +++ b/sys-apps/calculate-core/files/calculate-core-3.2.0_alpha4-r3.patch @@ -0,0 +1,465 @@ +diff --git core/server/api_types.py core/server/api_types.py +index 3863d53..eb205c1 100644 +--- core/server/api_types.py ++++ core/server/api_types.py +@@ -164,6 +164,97 @@ class Table(DataVarsSerializer): + self.onClick = onClick + self.addAction = addAction + ++class ChoiceValueAdapter(object): ++ def __init__(self, choicevalue): ++ self.choicevalue = choicevalue ++ ++ @property ++ def values(self): ++ return self.choicevalue.values.string ++ ++ @property ++ def comments(self): ++ return self.choicevalue.comments.string ++ ++ @property ++ def onChanged(self): ++ return self.choicevalue.onChanged.string ++ ++ def __getattr__(self, item): ++ return getattr(self.choicevalue, item) ++ ++ @classmethod ++ def from_detect(cls, choicevalue): ++ if isinstance(choicevalue, ChoiceValue): ++ return choicevalue ++ else: ++ return cls(choicevalue) ++ ++class TableAdapter(object): ++ def __init__(self, table): ++ self.table = table ++ ++ @property ++ def fields(self): ++ return self.table.fields.string ++ ++ @property ++ def head(self): ++ return self.table.head.string ++ ++ @property ++ def body(self): ++ if hasattr(self.table.body,'stringArray'): ++ return [row.string ++ for row in self.table.body.stringArray ++ if hasattr(row, "string")] ++ return [] ++ ++ @property ++ def values(self): ++ return [ChoiceValueAdapter(x) for x in self.table.values.ChoiceValue] ++ ++ def __getattr__(self, item): ++ return getattr(self.table, item) ++ ++ @classmethod ++ def from_detect(cls, table): ++ if isinstance(table, Table): ++ return table ++ else: ++ return cls(table) ++ ++class FieldAdapter(object): ++ def __init__(self, field): ++ self.field = field ++ ++ @property ++ def choice(self): ++ return self.field.choice.string ++ ++ @property ++ def listvalue(self): ++ return self.field.listvalue.string ++ ++ @property ++ def comments(self): ++ return self.field.comments.string ++ ++ @property ++ def tablevalue(self): ++ return TableAdapter(self.field.tablevalue) ++ ++ def __getattr__(self, item): ++ return getattr(self.field, item) ++ ++ @classmethod ++ def from_detect(cls, field): ++ if isinstance(field, Field): ++ return field ++ else: ++ return cls(field) ++ ++ + class Option(DataVarsSerializer): + shortopt = String + longopt = String +diff --git core/server/replace_class.py core/server/replace_class.py +index 23c5282..1318deb 100644 +--- core/server/replace_class.py ++++ core/server/replace_class.py +@@ -34,6 +34,7 @@ from calculate.lib.utils.colortext.output import BaseOutput + from calculate.lib.cl_print import color_print + from calculate.lib.datavars import VariableError + from calculate.lib.cl_lang import setLocalTranslate ++from calculate.core.server.api_types import FieldAdapter + + from methods_func import get_method_argparser, collect_object, \ + check_result_msg, get_param_pwd, _print +@@ -44,7 +45,7 @@ from func import shortTraceback, CommonMethods + + + setLocalTranslate('cl_core3', sys.modules[__name__]) +-from itertools import cycle ++from itertools import cycle, izip, ifilter + import time + + +@@ -531,7 +532,7 @@ class replaceClass(): + def startGroup(self, message): + _print = get_terminal_print() + self.printDefault( +- _print.foreground(TextState.Colors.WHITE).bold(message)) ++ _print.foreground(TextState.Colors.WHITE)(message)) + #self.addMessage(type='startGroup', message=message) + + def endGroup(self): +@@ -766,159 +767,179 @@ def print_brief(view, brief_label): + print_brief_group(Group.fields, Group.name) + + +-def print_brief_group(Fields, group_name): +- print_group_flag = False +- # if group_name: +- # _print ('\b'+group_name) +- uncompatible_count = 0 +- colorPrint = color_print() +- _colorprint = get_terminal_print(_print) +- for field in Fields: +- if field.uncompatible: +- uncompatible_count += 1 +- continue +- if field.element in ['input', 'openfile']: +- value = field.value if field.value else '' +- if not print_group_flag: +- if group_name: +- print_group_flag = True +- _colorprint.bold.foreground( +- TextState.Colors.WHITE)(group_name) +- colorPrint.printSUCCESS('%s: %s' % (field.label, value)) +- +- elif field.element in ['combo', 'comboEdit', 'radio', 'file']: +- if field.choice: +- if not field.choice[0]: +- field.choice.pop(0) +- if field.comments: +- if not field.comments[0]: +- field.comments.pop(0) +- if field.comments and field.choice: +- if not field.value in field.choice: +- field.choice.append(field.value) +- value = map(lambda x: field.comments[x] \ +- if len(field.comments) > x else field.choice[x], +- map(lambda x: field.choice.index(x), +- filter(lambda x: x in field.choice, +- [field.value]))) +- value = ', '.join(value) +- else: +- value = field.value if field.value else '' +- if not print_group_flag: +- if group_name: +- print_group_flag = True +- #_print('\b' + group_name) +- _colorprint.bold.foreground( +- TextState.Colors.WHITE)(group_name) +- colorPrint.printSUCCESS('%s: %s' % (field.label, value)) +- +- elif field.element in ['multichoice', 'multichoice_add', \ +- 'selecttable', 'selecttable_add']: +- if field.choice: +- if not field.choice[0]: +- field.choice.pop(0) +- if field.comments: +- if not field.comments[0]: +- field.comments.pop(0) +- if field.listvalue: +- if not field.listvalue[0]: +- field.listvalue.pop(0) +- if field.choice: +- value = map(lambda x: field.comments[x] \ +- if len(field.comments) > x \ +- else field.choice[x], +- map(lambda x: field.choice.index(x), \ +- field.listvalue)) ++class Display(object): ++ def __init__(self): ++ self._print = get_terminal_print(color_print().defaultPrint) ++ ++ def print_info(self, label, value): ++ GREEN = TextState.Colors.GREEN ++ self.display_asterisk(GREEN) ++ self._print("%s: " % label) ++ WHITE = TextState.Colors.WHITE ++ self._print.foreground(WHITE)(value) ++ self._print("\n") ++ ++ def print_label(self, label): ++ GREEN = TextState.Colors.GREEN ++ self.display_asterisk(GREEN) ++ self._print("%s: " % label) ++ self._print("\n") ++ ++ def display_asterisk(self, color): ++ self._print(" ") ++ self._print.foreground(color).bold("*") ++ self._print(" ") ++ ++ def print_error(self, message): ++ RED = TextState.Colors.RED ++ self.display_asterisk(RED) ++ self._print(message) ++ self._print("\n") ++ ++ def print_table(self, data, head): ++ ++ sys.stdout.write('%s\n' % printTable(data, head)) ++ ++ def print_group(self, label): ++ #WHITE = TextState.Colors.WHITE ++ #self._print.foreground(WHITE).bold(label) ++ #self._print.underline(label) ++ self._print(label) ++ self._print("\n") ++ ++ ++class InformationElement(object): ++ def __init__(self, field, display): ++ self.value = "" ++ self.label = "" ++ self.display = display ++ ++ @classmethod ++ def from_field(cls, field, display): ++ if field.type == 'steps': ++ return None ++ map_elements = {'input': ValueInfo, ++ 'openfile': ValueInfo, ++ 'combo': ChoiceInfo, ++ 'comboEdit': ChoiceInfo, ++ 'radio': ChoiceInfo, ++ 'file': ChoiceInfo, ++ 'multichoice': MultiChoiceInfo, ++ 'multichoice_add': MultiChoiceInfo, ++ 'selecttable': MultiChoiceInfo, ++ 'selecttable_add': MultiChoiceInfo, ++ 'error': ErrorInfo, ++ 'check': CheckInfo, ++ 'check_tristate': CheckInfo, ++ 'table': TableInfo ++ } ++ if field.element in map_elements: ++ return map_elements[field.element](field, display) ++ return None ++ ++ def show(self): ++ self.display.print_info(self.label, self.value) ++ ++ ++class ValueInfo(InformationElement): ++ def __init__(self, field, display): ++ super(ValueInfo, self).__init__(field, display) ++ self.value = field.value or '' ++ self.label = field.label ++ ++class CheckInfo(InformationElement): ++ def __init__(self, field, display): ++ super(CheckInfo, self).__init__(field, display) ++ self.label = field.label ++ map_answer = {'on':_('yes'), 'off': _("no"), 'auto': _('auto')} ++ self.value = map_answer.get(field.value, field.value) ++ ++class ChoiceInfo(InformationElement): ++ def __init__(self, field, display): ++ super(ChoiceInfo, self).__init__(field, display) ++ self.label = field.label or '' ++ if field.choice and field.comments: ++ map_comment = dict(zip(field.choice, field.comments)) ++ self.value = map_comment.get(field.value, field.value) or '' ++ else: ++ self.value = field.value if field.value else '' ++ ++ ++class MultiChoiceInfo(InformationElement): ++ def __init__(self, field, display): ++ super(MultiChoiceInfo, self).__init__(field, display) ++ self.label = field.label or '' ++ if field.listvalue: ++ value = field.listvalue ++ # удалить пустой первый элемент (особенности wsdl) ++ if value and not value[0]: ++ value.pop(0) ++ if field.choice and field.comments: ++ map_comment = dict(zip(field.choice, field.comments)) + else: +- value = [] +- value = ', '.join(value) +- if field.listvalue and not value: +- value = ', '.join(field.listvalue) +- elif not value: +- value = field.value if field.value else '' +- if not print_group_flag: +- if group_name: +- print_group_flag = True +- #_print('\b' + group_name) +- _colorprint.bold.foreground( +- TextState.Colors.WHITE)(group_name) +- colorPrint.printSUCCESS('%s: %s' % (field.label, value)) +- +- # elif field.element == 'label': +- # print field.label +- +- elif field.element == 'error': +- if not print_group_flag: +- if group_name: +- print_group_flag = True +- _colorprint.bold.foreground( +- TextState.Colors.WHITE)(group_name) +- colorPrint.printERROR(field.label) +- +- elif field.element in ['check', 'check_tristate']: +- if field.value == 'on': +- value = _('yes') +- elif field.value == 'off': +- value = _('no') +- elif field.value == 'auto': +- value = _('auto') ++ map_comment = {} ++ self.value = ", ".join([map_comment.get(x, x) or '' for x in value]) ++ else: ++ self.value = field.value or "" ++ ++ ++class ErrorInfo(InformationElement): ++ def __init__(self, field, display): ++ super(ErrorInfo, self).__init__(field, display) ++ self.label = field.label ++ ++ def show(self): ++ self.display.print_error(self.label) ++ ++ ++class TableInfo(InformationElement): ++ """ ++ Табличная информация ++ """ ++ ++ def map_row(self, row, typedata): ++ map_answer = {'on':_('yes'), 'off': _("no"), 'auto': _('auto')} ++ for cell, typefield in izip(row, typedata): ++ if typefield in ['check', 'check_tristate']: ++ yield map_answer.get(cell, cell) or "" ++ elif "password" in typefield: ++ yield "***" + else: +- value = field.value +- if not print_group_flag: +- if group_name: +- print_group_flag = True +- _colorprint.bold.foreground( +- TextState.Colors.WHITE)(group_name) +- colorPrint.printSUCCESS('%s: %s' % (field.label, value)) +- +- elif field.element == 'table' and field.type != 'steps': +- head = field.tablevalue.head +- +- body = [] +- for row in field.tablevalue.body: +- if not row[0]: +- row.pop(0) +- body.append(row) +- +- # if empty table +- if not filter(None, map(lambda x: x, body)): +- body = [[''] * len(head)] +- res = printTable(body, head) +- sys.stdout.flush() +- sys.stdout.write(res + "\n") +- continue +- ChoiceValue = field.tablevalue.values +- for row in xrange(len(ChoiceValue)): +- if ChoiceValue[row].typefield in ['check', 'check_tristate']: +- for i in xrange(len(body)): +- if body[i][row] == 'on': +- body[i][row] = _('yes') +- if body[i][row] == 'off': +- body[i][row] = _('no') +- if body[i][row] == 'auto': +- body[i][row] = _('auto') +- if "password" in ChoiceValue[row].typefield: +- for i in xrange(len(body)): +- if body[i][row]: +- body[i][row] = '***' +- data = [] +- for body_row in body: +- data.append(map(lambda x: x if x else '', body_row)) +- if not print_group_flag: +- if group_name: +- print_group_flag = True +- _colorprint.bold.foreground( +- TextState.Colors.WHITE)(group_name) +- colorPrint.printSUCCESS(field.label + ': ') +- res = printTable(data, head) +- sys.stdout.flush() +- sys.stdout.write(res + "\n") ++ yield cell or "" ++ ++ def __init__(self, field, display): ++ super(TableInfo, self).__init__(field, display) ++ self.label = field.label ++ self.head = field.tablevalue.head ++ ++ # удаление первого элемента строки (для wsdl) ++ body = [x[1:] if x and not x[0] else x for x in field.tablevalue.body] ++ ++ if not filter(None, map(lambda x: x, body)): ++ self.body = None + else: +- uncompatible_count += 1 ++ type_values = [x.typefield for x in field.tablevalue.values] ++ self.body = [list(self.map_row(x, type_values)) for x in body] ++ ++ def show(self): ++ if self.body: ++ self.display.print_label(self.label) ++ self.display.print_table(self.body, self.head) + + +-# if uncompatible_count == len (Fields) and group_name: +-# colorPrint.printSUCCESS(_('Not used')) ++def print_brief_group(Fields, group_name): ++ display = Display() ++ show_group = True ++ for element in ifilter(None, ++ (InformationElement.from_field( ++ FieldAdapter.from_detect(x), ++ display) ++ for x in Fields if not x.uncompatible)): ++ if show_group: ++ display.print_group(group_name) ++ show_group = False ++ element.show() ++ + + class Table(tableReport): + def __init__(self, *args, **kwargs): +@@ -953,4 +974,3 @@ def printTable(data, header=None): + except Exception as e: + print str(e) + raise +- diff --git a/sys-apps/calculate-update/Manifest b/sys-apps/calculate-update/Manifest index 3103ca0..12f739b 100644 --- a/sys-apps/calculate-update/Manifest +++ b/sys-apps/calculate-update/Manifest @@ -3,6 +3,7 @@ AUX calculate-update-3.2.0_alpha3-r1.patch 1506 SHA256 e02436a3f56d49eb96f4c3e9e AUX calculate-update-3.2.0_alpha3-r2.patch 1651 SHA256 2d8bc30666b5327d8212bac7262ba3d518a5e401600046bc85dd52531686bbbb SHA512 0193ea7a3b88bb77bfdadddb3c6bf84561aa54b0edcee7492d745326637df138ca86f611cd4459e125eec68fa73616e1093d37ece508e2ef1a9b3b0ef34b196f WHIRLPOOL 29d3cd3790a2085a060ecc964a45d65a13ef8fa0ac21d12b005d66ce160e0edc0ae75b8277bd459a60a10b8e4d764cfcdae108d7bee543d80426c3c819534041 AUX calculate-update-3.2.0_alpha4-r1.patch 2410 SHA256 5e69ded9db0e676d142674e53dc5b84d90120e58474fdd43a27b7024f4888a92 SHA512 51ee3eb4fe96cfbf44c9f706a0eaca34b732bf54f865d3ef6d36d24c56ad9b01f2d3b43201e058acc800cfa8ed2171aa2266469647492109d495cd3db6cff04f WHIRLPOOL d381f59f2a8f1a4fbf9d6f390b28cf43b7e124c3062cc90e85eff40bc3470b39a169b8e7ff94d07049c6a2ef18d83622dab2c8b7c8b8906e53d644f2349a1a79 AUX calculate-update-3.2.0_alpha4-r2.patch 6582 SHA256 57e9b6f162ca9f1c1e9295cc4dbbb9410617d9f2a04ed528189ace9e72e27bf8 SHA512 3d39899a85386bc223023fd60ddbacc9823d15f5319c379d4f1b71a1ef930f9ac375dbd527599cdecc9c4f54435afffe63a9e223a0f18b3683d6f3818c6e637d WHIRLPOOL 96fe4a57bf47a866f8be4365bc9ae1b06525e34076a0a6a2c04e96d7558b79302c7b14e62044b8fa305a5b4c3108795b5fe2ab700c221fbe922635ac25d20b48 +AUX calculate-update-3.2.0_alpha4-r3.patch 6988 SHA256 148483a99fa374a3f0e75fbc9ea5cd024171fc9ef973fa200bbcb8d997f71935 SHA512 0c79191712b2cb1aa1c2a3f3cdd4a4d9ae144ae5c1749707cc4dcf6fadbdbe638436136698228c979338ab365d4b7c54d17151697ad844af9ecc697f484853e5 WHIRLPOOL 4be6ce6f917065702052bbbd97ae9ee67afc59a2a1554772e163a5a40f525f33667db2754e4a1358b3f75de0373946a07a448079674806d703121002dca7c38b DIST calculate-update-3.2.0_alpha1.tar.bz2 14159 SHA256 6c5e73041029e93f04fe897447984c1f52f66f3486309d4e3bb741c0151dc44d SHA512 aac77b42e51f3be5f266bc3a7c233d2fa443b6316a7a618c61ef07be8e25704322bec6c39352184ee8fae227e4b2bbf276dfa038d4006be12079c71e983d16d4 WHIRLPOOL 8f395718c3332286ce47783fc42601f3dea9b9f7fd7225e5549ff8d04013a4d6a2208f103fde112b6ebf6791650a61aa5974dbfa435aecfd7d8e7b2d7ff9ae8b DIST calculate-update-3.2.0_alpha2.tar.bz2 24294 SHA256 b626f371db8def2823f5f2a5081122a0746a9dae5f04bb1e38bc82c618d69042 SHA512 32e216097ad19444b16200082a8796a6a7a2d824310e271df51e931e73eef1b13a57cbe9b6eaeddd6bf4e8b0e3a3d3f4a41def509ed1c55a960a3df524afd472 WHIRLPOOL 7b241545ce18af117481a813b2b0b2d9450f0b638068867fc60d2a759f4345d50114459646f51f6972267586678149efc5f4c26f1090d8f1fa4485b3bc4b4d5f DIST calculate-update-3.2.0_alpha3.tar.bz2 24313 SHA256 934f4b55f9df42090a128c524e2874b27f2e91b7f5b9c0eb2170ad8ee899362e SHA512 31c593b8d70592aa5f05011583317054c7bb75f558ae792cc3289820eaa87d85f4be91e29485c2aa824d1f2d7cbde942ed7f66fd9937d8950e59d83d41f6f7a2 WHIRLPOOL b995a3806cf7c964a26d979ad6c1416ec4b7315e79546c079c72c0ee12eb7dcc589198149186aba65ab860736389bfd9f0c3b534d88c97769d0ece5d8f013c1a @@ -15,5 +16,6 @@ EBUILD calculate-update-3.2.0_alpha3-r2.ebuild 767 SHA256 a2d534813424e7ee22c6fc EBUILD calculate-update-3.2.0_alpha3.ebuild 623 SHA256 9747a7f19c9cd545b38f74f283a1c7aecb451bc1769a833935217cfe53b01baa SHA512 c2910b1427589e6fa869840d15dcd3149c84da02d5a6f09a1f1ac23c8702a4efaf0bbbd778057395217e7e70c20eb6a1716e933710719669c9236fa9ca3c4c3a WHIRLPOOL aaae73a86f00e62990528e9a01e5f9f41c57f38a4407452433362189fddd3c5230ce69016c93ffb4e5f0694e1c811d6e9c2f631f854422d1195021c656fa9292 EBUILD calculate-update-3.2.0_alpha4-r1.ebuild 767 SHA256 f12912de4c0bfea487c8b1a135fc9293cb8550f9443f10d59cdf514ea50aed1e SHA512 d021b334806c95424614c2bc0c702bb3bd75f17b12a7ea41361d053627b187564eab65be08c1418ac0de186d2bb97d96c7824760f4c52d14dd68faacea216fe9 WHIRLPOOL ae97441c8478a13f4cddbbbf8c1f16d0fab9ed40b5af565701beae2f9db7ee8a0c93b717a6654045b11e2c001313a77c7f04b42e12cdb3fa4b0a06246a880b5f EBUILD calculate-update-3.2.0_alpha4-r2.ebuild 767 SHA256 710e26f93755be8a5a6faf2857bd4fc5c29b55a2034a4dc9e18c20ba1e993eb2 SHA512 0ad565fd9f7240bd2347dadb12574ef1916e6946c20f0f414312a48229a7e128edd6dce545faa6aa20f69c8ece4d184b108e2afabb568f36801dd0f279e5c119 WHIRLPOOL 8267f5128363b52e4870298685e38375585329cb21d9e5b8f9e36a4362c58e90bffb8e6d8d8b871bb0fb85ccf323354174f11574dc28fbb71941c7a1f7dd87d8 +EBUILD calculate-update-3.2.0_alpha4-r3.ebuild 767 SHA256 f5dc6601800363d095a93e8726a8758aa3e42a010623a1a0aa973b18e9d05c47 SHA512 57d9f397a1e3ba3f89ce15ce7daebc2cb5f93e6d9600d31a23076cae6e27a3209468c983bbd5eca6b618b344beefe98d68c343d7b8123f101d704fc00f521eb4 WHIRLPOOL f512e66ad18047a6cbe49cbfc8085a11b18b07d34cdde28257d024017e981b4f7bc24573c518ab4e330c1e7d395728d3c1d0357c713ad32130ac0c372c39d2da EBUILD calculate-update-3.2.0_alpha4.ebuild 623 SHA256 51f176a0b12ff53b612634c391e3504059bb8f5bfba20325e86efda1cd0f2787 SHA512 f693242808a683f9bfb895dd4a5330b9bb50a27d51ab51a272619724a03ad5a531cc23434abbaae6773f974dc5d699f1aee7d9062d2b19076335ccbe4bd7febd WHIRLPOOL 39ce52a3ae9fe1f7bca4b00a96929a58cb50cdd9c0a22f801bd9b8fdafbece62f9033c48f9e3a549136d4b838f4ace423710cbd63e2e3b7da9fa72fa81802255 EBUILD calculate-update-3.2.9999.ebuild 530 SHA256 9558d49a6b95f73c67f79c835e4003725ba7ae7e0492ea336737da16fe2f5005 SHA512 466bce621f4073bfbf4d34063cbb54077910baa5e40637d5d8d23044edccc9d79bb764db25e05b68969f1bd63573a1c0bc04676f45a6bbeca173503df6887767 WHIRLPOOL 0107e9b7746739a9be77664aa9e6907c9e511ac0422721d709fe63ffb4a55246a2d6c494280bd3b72e50d8e1aecb7f811cfdd112c482168bd9fa17c4ff0d5eaf diff --git a/sys-apps/calculate-update/calculate-update-3.2.0_alpha4-r3.ebuild b/sys-apps/calculate-update/calculate-update-3.2.0_alpha4-r3.ebuild new file mode 100644 index 0000000..d9fc224 --- /dev/null +++ b/sys-apps/calculate-update/calculate-update-3.2.0_alpha4-r3.ebuild @@ -0,0 +1,33 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="3" +SUPPORT_PYTHON_ABIS="1" +PYTHON_DEPEND="2:2.7" +RESTRICT_PYTHON_ABIS="2.4 2.5 2.6 3.*" + +inherit distutils eutils + +SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2" + +DESCRIPTION="The program of update Calculate Linux" +HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2" +LICENSE="Apache-2.0" +SLOT="3" +KEYWORDS="amd64 x86" +IUSE="" + +DEPEND="~sys-apps/calculate-core-3.2.0_alpha4 + ~sys-apps/calculate-install-3.2.0_alpha4 + dev-python/pexpect" + +RDEPEND="${DEPEND}" + +src_unpack() { + unpack "${A}" + cd "${S}" + + # apply revision changes + epatch "${FILESDIR}/calculate-update-3.2.0_alpha4-r3.patch" +} diff --git a/sys-apps/calculate-update/files/calculate-update-3.2.0_alpha4-r3.patch b/sys-apps/calculate-update/files/calculate-update-3.2.0_alpha4-r3.patch new file mode 100644 index 0000000..878fe17 --- /dev/null +++ b/sys-apps/calculate-update/files/calculate-update-3.2.0_alpha4-r3.patch @@ -0,0 +1,182 @@ +diff --git update/emerge_parser.py update/emerge_parser.py +index 50d53aa..6d677a0 100644 +--- update/emerge_parser.py ++++ update/emerge_parser.py +@@ -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 + from os import path +@@ -159,9 +160,9 @@ class EmergeInformationBlock(object): + + def __contains__(self, item): + if self.result is None: +- return 0 ++ return False + else: +- return item in self.result ++ return item in str(self) + + def _get_text(self, result): + """ +@@ -448,6 +449,29 @@ class EmergeingErrorBlock(EmergeInformationBlock): + raise EmergeError(_("Emerge %s is failed") % self.package) + + ++class RevdepPercentBlock(NotifierInformationBlock): ++ """ ++ Блок определния статуса revdep-rebuild ++ """ ++ token = "Collecting system binaries" ++ end_token = [re.compile("Assigning files to packages|" ++ "All prepared. Starting rebuild"), pexpect.EOF] ++ re_block = re.compile("\[\s(\d+)%\s\]") ++ ++ def notify(self, observer, groups): ++ percent = int(groups[0]) ++ observer(percent) ++ ++ def get_block(self, child): ++ while True: ++ index = child.expect([self.re_block]+self.end_token) ++ if index == 0: ++ for observer in self.observers: ++ self.notify(observer, child.match.groups()) ++ else: ++ self.result = child.match ++ break ++ + class EmergeParser(object): + """ + Парсер вывода emerge +@@ -531,6 +555,10 @@ class MtimeCheckvalue(object): + return self.get_check_values(self.fname) + + ++class Md5Checkvalue(MtimeCheckvalue): ++ def value_func(self, fn): ++ return hashlib.md5(readFile(fn)).hexdigest() ++ + class GitCheckvalue(object): + def __init__(self, rpath): + self.rpath = rpath +@@ -550,9 +578,9 @@ class EmergeCache(object): + # список файлов проверяемый по mtime на изменения + check_list = [MtimeCheckvalue('/etc/make.conf', + '/etc/portage', +- '/var/lib/portage/world', +- '/var/lib/portage/world_sets', +- '/etc/make.profile')] ++ '/etc/make.profile'), ++ Md5Checkvalue('/var/lib/portage/world', ++ '/var/lib/portage/world_sets')] + + def __init__(self): + self.files_control_values = {} +diff --git update/update.py update/update.py +index 5d8936c..ac654b1 100644 +--- update/update.py ++++ update/update.py +@@ -20,6 +20,7 @@ from os import path + from calculate.lib.utils.tools import AddonError + from calculate.lib.utils.colortext.palette import TextState + from calculate.lib.utils.colortext import get_color_print ++from calculate.update.emerge_parser import RevdepPercentBlock + import pexpect + + from package_tools import Git, Layman,\ +@@ -298,6 +299,31 @@ class Update: + raise + return True + ++ def revdep_rebuild(self, cmd, *params): ++ cmd_path = getProgPath(cmd) ++ if not cmd_path: ++ raise UpdateError(_("Failed to find %s command") % cmd) ++ with EmergeParser( ++ emerge_parser.CommandExecutor(cmd_path, params)) as emerge: ++ revdep = RevdepPercentBlock(emerge) ++ self.addProgress() ++ revdep.add_observer(self.setProgress) ++ revdep.action = lambda x: (self.endTask(), self.startTask( ++ _("Calculating dependencies")) if "Assign" in revdep else None) ++ emerge.emerging.add_observer(self._printEmergePackage) ++ emerge.installing.add_observer(self._printInstallPackage) ++ emerge.uninstalling.add_observer(self._printUninstallPackage) ++ try: ++ emerge.run() ++ except EmergeError: ++ if emerge.emerging_error: ++ self.printPre( ++ self._emerge_translate(emerge.emerging_error.log)) ++ else: ++ self.printPre(self._emerge_translate(emerge.prepare_error)) ++ raise ++ return True ++ + def _display_pretty_package_list(self, pkglist, remove_list=False): + """ + Отобразить список пакетов в "удобночитаемом" виде +@@ -323,7 +349,7 @@ class Update: + else: + size = "" + mult = _print.bold("*") +- self.printDefault(" {mult} {fullname} {shortname}{size}".format( ++ self.printDefault(" {mult} {fullname} {shortname}{size}".format( + mult=mult, fullname=fullname, shortname=shortname, size=size)) + + def _display_install_package(self, emerge): +@@ -467,7 +493,7 @@ class Update: + emerge.uninstalling.add_observer(self._printUninstallPackage) + try: + emerge.run() +- except EmergeError as e: ++ except EmergeError: + self.emerge_cache.drop_cache() + if emerge.emerging_error: + self.printPre( +diff --git update/utils/cl_update.py update/utils/cl_update.py +index 111b369..6122db4 100644 +--- update/utils/cl_update.py ++++ update/utils/cl_update.py +@@ -180,16 +180,16 @@ class ClUpdateAction(Action): + 'preserved_libs'] + }, + {'name': 'update:revdev_rebuild', +- 'message': __('Executing {0}').format("revdep-rebuild"), +- 'method': 'Update.emergelike("revdep-rebuild")', ++ 'message': __('Checking reverse dependencies'), ++ 'method': 'Update.revdep_rebuild("revdep-rebuild")', + 'condition': was_installed('.*', log_names['revdep']), + 'decoration': 'Update.update_task("%s")' % log_names['revdep'] + }, +- {'name': 'update:set_upto_date_cache', +- 'method': 'Update.setUpToDateCache()' +- } + ] + }, ++ {'name': 'update:set_upto_date_cache', ++ 'method': 'Update.setUpToDateCache()' ++ } + ] + + # список задач для дейсвия +diff --git update/variables/update.py update/variables/update.py +index 0f79468..a000e45 100644 +--- update/variables/update.py ++++ update/variables/update.py +@@ -117,8 +117,10 @@ class VariableClUpdateSystemProfile(ReadonlyVariable): + """ + def get(self): + try: ++ make_profile = self.Get('cl_make_profile') + return path.normpath( +- path.join('/etc',os.readlink('/etc/make.profile'))) ++ path.join(path.dirname(make_profile), ++ os.readlink(make_profile))) + except: + raise VariableError(_("Failed to determine system profile")) + diff --git a/sys-apps/calculate-utilities/Manifest b/sys-apps/calculate-utilities/Manifest index 22a1175..f871385 100644 --- a/sys-apps/calculate-utilities/Manifest +++ b/sys-apps/calculate-utilities/Manifest @@ -8,5 +8,6 @@ EBUILD calculate-utilities-3.2.0_alpha4-r1.ebuild 821 SHA256 5dce13bb317b2ae448e EBUILD calculate-utilities-3.2.0_alpha4-r2.ebuild 827 SHA256 5bc052d0127a8d9eb83fb309730f11d54f0381e57926c42907d74f3fe60c5433 SHA512 19d5e3c07ee79359ec10c3bb724e104aea05acdbf6f615dad442177c0885b1a4927e3342149221e0dc044ba0e09ab371912790040321e151b1feac18d9c7068f WHIRLPOOL 2a5bb42ece1c8966601916b347916e5bad524704ab06f45d66aa082452abfe3e1ae60592f7331ca306bfde3923447fbb3e231d3d48f0bc144e4fd35be0056494 EBUILD calculate-utilities-3.2.0_alpha4-r3.ebuild 827 SHA256 55e3c689f7b9f63d44d5ee4463f2a9ca5e935961b47b999d6936244a2f3cca07 SHA512 7ad917b33b415a442c5022f81df4f81fb83c0a68ce5ab68bc2709fc3b051f693aa6a9768640759a7aaa70dcabe6870f4a43dea4943d526e9e52c54ea9d7f595c WHIRLPOOL 5062f3f2e6523c59e2bf48298a789024af5c81a969f1b182d481fb3b830a811ae9cf4aeefea49025c3baa33970b2d11deb56b547f6838c70597c80489ef3cefb EBUILD calculate-utilities-3.2.0_alpha4-r4.ebuild 827 SHA256 af1f37610602ad63affaabdb89a4fc86176712346021b82dfae9cbed3c525dc0 SHA512 83569e0abda57714131f63e0bd6188e9f26fe76d0246de6ed4e9e72dcd6568e1f35bf6da5680a283fc4c57caf64d0eca8bd59cef33d9643dcf828948a0746037 WHIRLPOOL 1636428c5177413bd18d461d5724d5e75dd60edf1fe573c53e0f0a3ba6147167ceddf4b3b86b38745b5fb51b1a6d1ec4ca9ef90e33a698c936480ce61c5d6f60 +EBUILD calculate-utilities-3.2.0_alpha4-r5.ebuild 827 SHA256 788046721074b571d1da3ddcebdff9b512c7f4e53535a38ad7271b41a7bc60e2 SHA512 ce858fa8da3fa4bff0ce56b22b4a09f0d323cf755da48b957622e4268c67f4382beab9160f4416050885838fe3d43dc54e9275526e695e9042f11728bf34fa55 WHIRLPOOL 814f7cbb331444df618d1a5a8b106612118616f172fa7462c5070021cf7832daf385482e23d281eb745938045f6ef0bd8ee0a87483d627568fd17729695f12c1 EBUILD calculate-utilities-3.2.0_alpha4.ebuild 812 SHA256 c3528f2fcb9980d90b8948fe672a64c0a899364a4a8f7a8290990536f7f31631 SHA512 ffad0effd883749802e6dc12779054010949aa2eccf68ee3560f5239c2b45f683cc5ae00d7582fec7d1d0382a35fc6a73411abf1aa58e43417e26b52130885a8 WHIRLPOOL 56d339c417b70eb53d942d533e56bc530e85fdc4f3bf6c8c30ff07af69e0bd98d373d6dbb27b944af4c8e9d596cd1b75424699391cd49b21a48a3ae8bc014fa1 EBUILD calculate-utilities-3.2.9999.ebuild 800 SHA256 acbb7a4e34387baa1ade9bf97637972fbfc97afa56367381d622198b5237e983 SHA512 9e0c74eb499157b6d3ace20d7e9da630660e46b74a6d575e222e1638c87f85660635187489b9312a45f193780c301d87c1dbb9a0f60414e178e8f54080c71ffd WHIRLPOOL 9b56f590f36d29d3518c66c453f97b14d083e36b62adb70a8916ae4e30b527431602a9edd40d703e5cb4296a01f8c982157b602651ee57a9c0ddb7a4c6aa2fe1 diff --git a/sys-apps/calculate-utilities/calculate-utilities-3.2.0_alpha4-r5.ebuild b/sys-apps/calculate-utilities/calculate-utilities-3.2.0_alpha4-r5.ebuild new file mode 100644 index 0000000..d21d0e9 --- /dev/null +++ b/sys-apps/calculate-utilities/calculate-utilities-3.2.0_alpha4-r5.ebuild @@ -0,0 +1,26 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=4 + +DESCRIPTION="Calculate Utilities meta package" +HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2" +SRC_URI="" + +LICENSE="Apache-2.0" +SLOT="3" +KEYWORDS="amd64 x86" +IUSE="cl_consolegui cl_client cl_desktop cl_console" + +RDEPEND="${RDEPEND} + =sys-apps/calculate-install-3.2.0_alpha4-r1 + =sys-apps/calculate-i18n-3.2.0_alpha4 + =sys-apps/calculate-lib-3.2.0_alpha4-r3 + =sys-apps/calculate-core-3.2.0_alpha4-r3 + =sys-apps/calculate-update-3.2.0_alpha4-r3 + cl_client? ( =sys-apps/calculate-client-3.2.0_alpha4 ) + cl_desktop? ( =sys-apps/calculate-desktop-3.2.0_alpha4 ) + cl_consolegui? ( =sys-apps/calculate-console-gui-3.2.0_alpha4 ) + cl_console? ( =sys-apps/calculate-console-3.2.0_alpha4-r1 ) +"