Добавлена обработка revdep-rebuild для update

mhiretskiy
Mike khiretskiy 10 years ago
parent 0af98c25b7
commit b0024f816c

@ -1,5 +1,6 @@
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
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
@ -9,5 +10,6 @@ EBUILD calculate-core-3.2.0_alpha1.ebuild 1131 SHA256 08d7216cdc3618ae7a73f5cbce
EBUILD calculate-core-3.2.0_alpha2.ebuild 1129 SHA256 0778b2b2cfa7d8a3b915d3db8ad6bfa3de60d3f268732e3488182818adc05983 SHA512 b6f6da14537a3fc3ebe12426b20080b5b19f884b387527bec8511bdabdcef4b2cac4fda48a3847dfbb2787b0ba8e19762b9b842cf1b779958467948ccf674c43 WHIRLPOOL 53158020860e2be6691e1aafb2f47fa74ae120d8408c728af305c4f50e47d24817581efa3b82bfd7e36c5a41166cfae3d677344a3f92b91b4e77fc902a118605
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.ebuild 1129 SHA256 5265cd458eaf572bcdc443d19fceaef043ed57855890f0a017810bbbc835523e SHA512 6265973cb9b86ad68d0c2fc6cffceb14e0713fe2b6140c4daff5d18b71286572996332bd6e6b3679238e6e12cedd76f2d0e0b65fd7e0394426bc39ae65bb8d07 WHIRLPOOL d3f62367e9277aae8123efc10a91f4d614568e365ebeceabc22a3782dbbb3711ea3e8686ec8864c2f2f2856a945c66e5125fbb20d1fd07c169d1925e49e7f99d
EBUILD calculate-core-3.2.9999.ebuild 656 SHA256 39383ebc527d7155b147355108ec0b069f7cad95d5fcabc33520f0fe1ee0b971 SHA512 e20a8dea6e20615baeb56069331cdc35a7c37a05afa125c7174c5082852242da446830940c962fd890bb6627d9f5cacf0848834b75bfb1a184a6acfef17f95f8 WHIRLPOOL 3e9f06bf7e2f99a46e3c681fa6f381b7b1883bb15e05c535a7acde55f9092418d0b71d95ce4b2906e8505ea73c4157620303e4e4e4e4de430f11bfd6214b4a88

@ -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 <username>"
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-r2.patch"
}

@ -0,0 +1,456 @@
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..6597928 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
@@ -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
-

@ -1,6 +1,7 @@
AUX calculate-lib-3.2.0_alpha1-r1.patch 1248 SHA256 6b1b3d062a082ca34c708d9700d0501225cd18a6a255ed16517b3815e619f536 SHA512 d77196c708e76fd2cb261fe6ac6d66249ceffd567a730a51b075a667c416e6c481302917874cc4dc2b982b0495695486580e79af0fa96ed54bada581badd6a37 WHIRLPOOL 0fe7e95183e80c5bd1e62b6615f7ed022ef9edd077ab6dc8c75b41afcee451544de3b653436d68b41e5ed30e29621697c5a739ca4c355e0a4c7abc2862f083ab
AUX calculate-lib-3.2.0_alpha4-r1.patch 6748 SHA256 236837ce239f3f320f6aa1be194b0a5eac34247ea3bcbbb35a4bd1d8c7b1c84e SHA512 4120021db63a44072f472928ad459553aee5f84a52a78afa90387801df7c4dd1832afae771962ee2f9aaf22ffc33faecefa276ee6631080ae8f2db8621321ab9 WHIRLPOOL 8839d8a96f30c6ddbf6221f0a7cb235cf7866c1158030943c2dcc51e5c89e06f1e7a97d4a8aff2170a4f7dd9327831bfe7962d86c7b3b618d479248d6169acf3
AUX calculate-lib-3.2.0_alpha4-r2.patch 7413 SHA256 9e49d514d21f3305cf4ad5052f3c2ab03e2afeed14a24a6ce952e4ebb689142a SHA512 cf84c413dfab87accfa47cc0aac43ecde2b3d014e2b1b23f9c547067a90c0d1cf3b3c287ddfa6564c7aa160211bd91e110c3af34daa9187a07c6cb1811e8ebf6 WHIRLPOOL dd485b0cfc6b45eb6eabd1ca056216a6374ea596c71d184e1ad2306001082954dd09d38415f7729e25527b24345ee7105d83523f01dd500723ec74898ec8040b
AUX calculate-lib-3.2.0_alpha4-r3.patch 7981 SHA256 36b903823d4d2020518beccaa00ef26eeb4dba56fca2d90aeaede9d1e6063dce SHA512 8f91d8f45d505a1ba646152fb0471083bc138162aae8ad48686cb72d20b3e4544fcab3817e5b1e19561813892c8acee162cfb6662886181f872aaf7ead4b9002 WHIRLPOOL 77f16da7c30008a2ca57a91ffd92345204c53f294a3b01a73e29c8bf2abe6735d3010143231b846d57c66f941e4d2a4cade6187fe203e4d415ee681d1d6efe39
DIST calculate-lib-3.2.0_alpha1.tar.bz2 121698 SHA256 a1c605690dbb8c9fa6bcccd1a3bd1ff6500e4566e9d9a8ddc1ef4967ea38fbb8 SHA512 30196b7cba04f218c2e3105951fdaaa1a8c916d5b2265a4a09d1cce7b317f7ec501cd2edb70ecb41f25a1ee4ecfa89e23e3255a4adbfbf3ba7715c384171d0a3 WHIRLPOOL 0e9525e2b728a98c02b0a11f70dc13fb3922fd7e5ac01b168d9aeaa8c2544707533a1ecbd6aea4dd28a7836288efd8a8393216a68176c32615af8417e1acd4fc
DIST calculate-lib-3.2.0_alpha2.tar.bz2 131437 SHA256 726e062234ea0d668c1f05c8ab9a3093d25faf2825f028a0879339471d80de97 SHA512 9f7d1de80ac08b15b575ffb396ac01fbbf94cb6d57960854175256274039f83b619849d4930830682d110df7d28a789ac2b23ea5c3e5fb73dd06a48b4c28e455 WHIRLPOOL 2b5feb2d7aa97861ad2691056ecd8a8f43fc837b4f95e83b23780f53db8285950cc3a029acd83b6f287ef76d29a29c3fe896c920c633b81a235c5d124f650e24
DIST calculate-lib-3.2.0_alpha3.tar.bz2 131427 SHA256 17851382ad90e511132428fdbc3e4736ad78e6add64174b863f4470e86ad9ebc SHA512 46f2c2d9e31e88f215037935ac8b0dc0086ed98663a2174e425f77d3b9256345837c7803ae3c55dbd9ce9d38609d776b3058a128b1d12f621e64b4a2fe92d606 WHIRLPOOL 90d81f3adbda01b99b3b09f1cc1fd13d87580b0586c7a28e93968ceabf79eee7328c6fd272237d13985d9ebac2e7f0645f9b101a326b6105b36ea19c5f0e561f
@ -11,5 +12,6 @@ EBUILD calculate-lib-3.2.0_alpha2.ebuild 690 SHA256 c89c29f5de3f70146e98f1503536
EBUILD calculate-lib-3.2.0_alpha3.ebuild 690 SHA256 c89c29f5de3f70146e98f15035366506933f03e8a5066b1ad55aeccbebdeae2c SHA512 a7277c2e5fa64a5e5840be7fc8d3df9a31f41926386c5fe6a9bed31eeed6321af5881c218d9ce7eeb12aee518edb682b438e10397dcb815cc63645100430e43e WHIRLPOOL 8f19e4d46381e26fec81e20fa35599f4658b3891d6372c921a8b1354ad3b1821ea9c78f71caebf54610e0b5aacfb6e6ded018e155e1979322406a0ac1e823d09
EBUILD calculate-lib-3.2.0_alpha4-r1.ebuild 831 SHA256 edd3d3445555f8482283f1afcb7c74de1e76034f7f3d682b0b83a47f782ad0b8 SHA512 f0fe1fbdd5576e27ccdd407f1234589b143410e75dfc762ae7608a162dd5ade63c3d31dc5a1bfbc86a26f04a8cb40286dbcbcc2f5c6b88da6a22dfae398c9ed0 WHIRLPOOL 62e69309a12642d3c453cac64598d544c9a76d167a6cf268d4c23e532237c6f6b41d71b4611f4953b8d9180806c4d5a259316d2365ba7dada9bc240d4f54a4bc
EBUILD calculate-lib-3.2.0_alpha4-r2.ebuild 831 SHA256 813deccd2d61926b871cfae98ced012826925fdcc51920f454da772dfb396dab SHA512 140bf8eda9a45fdc0448c701f00756c85dbfa9f1114afdc3547cb26cacf2b8f45e11b33577b3f042ba6c8979f18398189a4dfe1f3b0d1b795050eddef48ef4cd WHIRLPOOL f074d1fa5741f5a3232457149b5529677ddac206a6189094285e8ff3b9179515954b3b94403fb25cb102035d032e985cfaedd2054ac27e7d3b930ac18df4413c
EBUILD calculate-lib-3.2.0_alpha4-r3.ebuild 831 SHA256 73b2a4f12533a0433348a26317bda4755fe21590cf20fa485fb4bf721e7773bc SHA512 2492796b8076452c100efbe65be5b44cff6326c983f6150bf3a70c145a8c5510e490e8d140f01f9e717e9a0dfd8e8a817f9bbe0d05c7585d2b5b2f444c6b01e9 WHIRLPOOL 251e14554cb1978c041f7899493a22d40afe3c5d42a95286d42da8ed4dba78def4e2f5f1315643bd079eb353fc99785129d28c808f3292062f565e877c6e5c90
EBUILD calculate-lib-3.2.0_alpha4.ebuild 690 SHA256 c89c29f5de3f70146e98f15035366506933f03e8a5066b1ad55aeccbebdeae2c SHA512 a7277c2e5fa64a5e5840be7fc8d3df9a31f41926386c5fe6a9bed31eeed6321af5881c218d9ce7eeb12aee518edb682b438e10397dcb815cc63645100430e43e WHIRLPOOL 8f19e4d46381e26fec81e20fa35599f4658b3891d6372c921a8b1354ad3b1821ea9c78f71caebf54610e0b5aacfb6e6ded018e155e1979322406a0ac1e823d09
EBUILD calculate-lib-3.2.9999.ebuild 708 SHA256 a1d64b7f014831bf6b0a38928d53cb55758b7a12e5f3e98fffd28025ffacbce1 SHA512 3873859a791941d421e2338b437521955da383ce986408f1a951305e2dd75a1a4f771c9ec2caa096c5c8ea6a1776d6d0ed99e025ffa786ba029cafdbadfa439b WHIRLPOOL 5ac1a10b53f810ab527a0ebe52bc87e8397e61375cf6e0acbed89d8f6b8385e72bf234e0fdce479c3a3f1652bb6e520710ce9356750a97d644c0db0a33f6facb

@ -0,0 +1,36 @@
# 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 library for Calculate 3"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="amd64 x86"
IUSE="minimal"
DEPEND="!minimal? ( dev-python/py-smbpasswd )
>=dev-python/pyxml-0.8
sys-apps/iproute2
sys-apps/pciutils
sys-fs/lvm2
sys-fs/mdadm
dev-python/pyinotify
sys-apps/file[python]"
RDEPEND="${DEPEND}"
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-lib-3.2.0_alpha4-r3.patch"
}

@ -0,0 +1,188 @@
diff --git calculate/lib/cl_progressbar.py calculate/lib/cl_progressbar.py
index 36bb6c4..5734d28 100644
--- calculate/lib/cl_progressbar.py
+++ calculate/lib/cl_progressbar.py
@@ -110,6 +110,7 @@ try:
def __init__(self):
self.outQueue = Queue()
+ self.finished = False
self.inQueue = Queue()
Process(target=self.runProgress,
args=(self.outQueue,self.inQueue)).start()
@@ -127,6 +128,7 @@ try:
def quit(self):
self.outQueue.put(("quit",(),False))
+ self.finished = True
self.outQueue.close()
self.inQueue.close()
except:
diff --git calculate/lib/datavars.py calculate/lib/datavars.py
index 1881294..3690083 100644
--- calculate/lib/datavars.py
+++ calculate/lib/datavars.py
@@ -1017,9 +1017,10 @@ class DataVars(SimpleDataVars):
"""
if not self.iniCache:
# get initialized section names
- if os.path.exists('/etc/make.profile'):
+ make_profile = self.Get('main.cl_make_profile')
+ if os.path.exists(make_profile):
profiles = [('profile',
- path.join('/etc',os.readlink('/etc/make.profile')))]
+ path.join('/etc',os.readlink(make_profile)))]
else:
profiles = []
for iniName,iniFile in profiles+\
diff --git calculate/lib/utils/colortext/printing.py calculate/lib/utils/colortext/printing.py
index 147d1d7..75227ee 100644
--- calculate/lib/utils/colortext/printing.py
+++ calculate/lib/utils/colortext/printing.py
@@ -32,6 +32,11 @@ class Print(object):
self.buffer.append(self.output.setBold())
return self
+ @property
+ def underline(self):
+ self.buffer.append(self.output.setUnderline())
+ return self
+
def foreground(self, color):
self.buffer.append(self.output.setForeground(color))
return self
diff --git calculate/lib/variables/env.py calculate/lib/variables/env.py
index ab295ca..87d43cc 100644
--- calculate/lib/variables/env.py
+++ calculate/lib/variables/env.py
@@ -414,6 +414,17 @@ class VariableClMakeProfile(Variable):
"""
Путь до актуального make.profile
"""
+ systemRoot = "/"
+
+ def get_work_link(self, *links):
+ for link in links:
+ if path.exists(link):
+ return link
+
def get(self):
- # TODO: заглушка, нужно учитывать /etc/portage/make.profile
- return "/etc/make.profile"
+ files = ["etc/portage/make.profile", "etc/make.profile"]
+ val = self.get_work_link(
+ *[path.join(self.systemRoot, x) for x in files])
+ if not val:
+ raise VariableError(_("Failed to detect system profile"))
+ return val
diff --git calculate/lib/variables/linux.py calculate/lib/variables/linux.py
index 5d907f6..d49c773 100644
--- calculate/lib/variables/linux.py
+++ calculate/lib/variables/linux.py
@@ -18,10 +18,10 @@ import os
from os import path
import re
import platform
-from calculate.lib.datavars import Variable,ReadonlyVariable,SimpleDataVars
+from calculate.lib.datavars import Variable, SimpleDataVars
from calculate.lib.utils.portage import isPkgInstalled
-from calculate.lib.utils.files import countFiles,readFile
-import calculate.lib.cl_template as cl_template
+from calculate.lib.utils.files import readFile
+from env import VariableClMakeProfile
class Linux:
dictLinuxName = {"CLD":"Calculate Linux Desktop",
@@ -51,7 +51,7 @@ class Linux:
def getShortnameByMakeprofile(self,systemroot):
"""Get shortname by symlink of make.profile"""
- makeprofile = path.join(systemroot,'etc/make.profile')
+ makeprofile = self.Get('cl_make_profile')
if path.exists(makeprofile):
link = os.readlink(makeprofile)
reMakeProfileLink = re.compile('/calculate/(desktop|server)/(%s)/'%
@@ -78,11 +78,11 @@ class Linux:
def detectOtherShortname(self,systemroot):
"""Detect other system. Now only Gentoo."""
- gentooFile = path.join(systemroot,"etc/gentoo-release")
+ gentooFile = path.join(systemroot, "etc/gentoo-release")
if path.exists(gentooFile):
return "Gentoo"
- if all(map(lambda x:path.lexists(path.join(systemroot,x)),
- ['bin','var','lib','etc'])):
+ if all(map(lambda x: path.lexists(path.join(systemroot, x)),
+ ['bin', 'var', 'lib', 'etc'])):
return "Linux"
return None
@@ -92,17 +92,17 @@ class Linux:
"""
overlayPath = 'var/lib/layman/calculate'
releaseFile = 'profiles/calculate-release'
- return readFile(path.join(systemroot,overlayPath,releaseFile))
+ return readFile(path.join(systemroot, overlayPath, releaseFile))
def getVersionFromMetapackage(self,systemroot,shortname):
"""Get version from meta package"""
- for pkg in ("app-misc/calculate-meta","app-misc/%s-meta"%shortname):
- calcMeta = isPkgInstalled(pkg,systemroot)
+ for pkg in ("app-misc/calculate-meta", "app-misc/%s-meta" % shortname):
+ calcMeta = isPkgInstalled(pkg, systemroot)
if calcMeta:
return calcMeta[0]['PV']
return None
- def getVersionFromCalculateIni(self,systemroot):
+ def getVersionFromCalculateIni(self, systemroot):
"""Get version from calculate ini"""
pathname = path.join(systemroot,
'etc/calculate/calculate.ini')
@@ -124,11 +124,9 @@ class Linux:
def getVersionFromGentooFiles(self,systemroot):
"""Get version from gentoo files"""
gentooFile = path.join(systemroot,"etc/gentoo-release")
- systemVersion = ""
- flagGentoo = False
reVer=re.compile("^(\d+\.)*\d+$",re.S)
if path.exists(gentooFile):
- gentooLink = path.join(systemroot,"etc/make.profile")
+ gentooLink = self.Get('cl_make_profile')
if path.islink(gentooLink):
vers = filter(reVer.search,
os.readlink(gentooLink).split('/'))
@@ -227,9 +225,10 @@ class VariableOsLinuxFiles(Variable,Linux):
class LinuxDataVars(SimpleDataVars):
- def __init__(self,systemRoot="/"):
+ def __init__(self, systemRoot="/"):
self.systemRoot = systemRoot
SimpleDataVars.__init__(self,
+ VariableClMakeProfile(systemRoot=systemRoot),
VariableOsLinuxShortname(systemRoot=systemRoot),
VariableOsLinuxName(systemRoot=systemRoot),
VariableOsLinuxSubname(systemRoot=systemRoot),
@@ -238,14 +237,12 @@ class LinuxDataVars(SimpleDataVars):
VariableOsLinuxSystem(systemRoot=systemRoot),
VariableOsLinuxVer(systemRoot=systemRoot),
VariableOsLinuxBuild(systemRoot=systemRoot))
- makeprofile = path.join(systemRoot,'etc/make.profile')
+ makeprofile = self.Get('cl_make_profile')
if os.path.exists(makeprofile):
- inifile = path.join(systemRoot,'etc',
- os.readlink(path.join(systemRoot,'etc/make.profile')))
+ inifile = path.join(systemRoot, 'etc',
+ os.readlink(makeprofile))
self.flIniFileFrom(inifile)
- inifile = "etc/calculate/calculate.env"
- self.flIniFileFrom(path.join(systemRoot,inifile))
- iniFile = "etc/calculate/calculate3.env"
- self.flIniFileFrom(path.join(systemRoot,iniFile))
- iniFile = "etc/calculate/calculate2.env"
- self.flIniFileFrom(path.join(systemRoot,iniFile))
+ for inifile in ("etc/calculate/calculate.env",
+ "etc/calculate/calculate3.env",
+ "etc/calculate/calculate2.env"):
+ self.flIniFileFrom(path.join(systemRoot, inifile))

@ -2,6 +2,7 @@ AUX calculate-update-3.2.0_alpha1-r1.patch 683 SHA256 39edbee7b73bbb34d31ce88170
AUX calculate-update-3.2.0_alpha3-r1.patch 1506 SHA256 e02436a3f56d49eb96f4c3e9e53450dd93943d23ba4ff8b5d1b7332bc3fb03df SHA512 f237e2d3f72e236293d5e6eb4887be41a314ea0a16d5a4d29fe6179d957598743dc3e28e665c7ecdff66d2f8973dbeb7c9fc7c07a0da93db576446b2d8aefcbf WHIRLPOOL a7ac88f77218fbde7f8a2b50f60fbb647143b6c58f15cb376d163e885ce72fc24086f408eacb04fb1eda582ca6bba039b677c8532334fc95d642f4f20cac27e6
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
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
@ -13,5 +14,6 @@ EBUILD calculate-update-3.2.0_alpha3-r1.ebuild 767 SHA256 30d51073f279718f20cd04
EBUILD calculate-update-3.2.0_alpha3-r2.ebuild 767 SHA256 a2d534813424e7ee22c6fcbda9f459ad16b4d8eefd0691f124e728d260b03b34 SHA512 30ea415d70e2d65a35aeb05b28d55c2499588dd9659e330b9c7567b680a50242793bd32b6d3b20b93d7f1dde915a56b7c4145adbcf76a1d8c1fd5ca0b34e46ff WHIRLPOOL 2f64e6d3d0e7e3d2855888ee2bd9110ced3e82750aeb15481ed22e6c1a74053359cfa7b8fd9fd72cd0c408955b6c1bfa43c39a9624ac958f508fb6558a20dd42
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.ebuild 623 SHA256 51f176a0b12ff53b612634c391e3504059bb8f5bfba20325e86efda1cd0f2787 SHA512 f693242808a683f9bfb895dd4a5330b9bb50a27d51ab51a272619724a03ad5a531cc23434abbaae6773f974dc5d699f1aee7d9062d2b19076335ccbe4bd7febd WHIRLPOOL 39ce52a3ae9fe1f7bca4b00a96929a58cb50cdd9c0a22f801bd9b8fdafbece62f9033c48f9e3a549136d4b838f4ace423710cbd63e2e3b7da9fa72fa81802255
EBUILD calculate-update-3.2.9999.ebuild 530 SHA256 9558d49a6b95f73c67f79c835e4003725ba7ae7e0492ea336737da16fe2f5005 SHA512 466bce621f4073bfbf4d34063cbb54077910baa5e40637d5d8d23044edccc9d79bb764db25e05b68969f1bd63573a1c0bc04676f45a6bbeca173503df6887767 WHIRLPOOL 0107e9b7746739a9be77664aa9e6907c9e511ac0422721d709fe63ffb4a55246a2d6c494280bd3b72e50d8e1aecb7f811cfdd112c482168bd9fa17c4ff0d5eaf

@ -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-r2.patch"
}

@ -0,0 +1,173 @@
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..cb6702b 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):
"""
Отобразить список пакетов в "удобночитаемом" виде
@@ -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"))

@ -7,5 +7,6 @@ EBUILD calculate-utilities-3.2.0_alpha3.ebuild 812 SHA256 7aa150fabd4171e2dd45f6
EBUILD calculate-utilities-3.2.0_alpha4-r1.ebuild 821 SHA256 5dce13bb317b2ae448edb8f61db57a442f21e7a15cdeb90f550ea1cf98d00f9d SHA512 dc8c2c4a3651a0d4b928acc4b47e1a2cd817ec5145207c9eb8ffd9765691ad1fc8bdbe0e44d977bdf1e2c3663a2762ecb6b65cb9e05e5c5793e22293a6add303 WHIRLPOOL 107d63d512a784e296bccd0fbac94904f26df2e4d9a867c8e1cbe347eec183922d7c5addfebc2f896456b866ff59eee93f4951d6c12c7bbb809ab75c007c574e
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.ebuild 812 SHA256 c3528f2fcb9980d90b8948fe672a64c0a899364a4a8f7a8290990536f7f31631 SHA512 ffad0effd883749802e6dc12779054010949aa2eccf68ee3560f5239c2b45f683cc5ae00d7582fec7d1d0382a35fc6a73411abf1aa58e43417e26b52130885a8 WHIRLPOOL 56d339c417b70eb53d942d533e56bc530e85fdc4f3bf6c8c30ff07af69e0bd98d373d6dbb27b944af4c8e9d596cd1b75424699391cd49b21a48a3ae8bc014fa1
EBUILD calculate-utilities-3.2.9999.ebuild 800 SHA256 acbb7a4e34387baa1ade9bf97637972fbfc97afa56367381d622198b5237e983 SHA512 9e0c74eb499157b6d3ace20d7e9da630660e46b74a6d575e222e1638c87f85660635187489b9312a45f193780c301d87c1dbb9a0f60414e178e8f54080c71ffd WHIRLPOOL 9b56f590f36d29d3518c66c453f97b14d083e36b62adb70a8916ae4e30b527431602a9edd40d703e5cb4296a01f8c982157b602651ee57a9c0ddb7a4c6aa2fe1

@ -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-r2
=sys-apps/calculate-update-3.2.0_alpha4-r2
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 )
"
Loading…
Cancel
Save