Добавлено логгирование в утилиты alpha

mhiretskiy
Mike khiretskiy 10 years ago
parent cb2c3efb84
commit 0a26da8b59

@ -2,6 +2,7 @@ AUX calculate-core-3.2.0_alpha10-r1.patch 1286 SHA256 3c749267ade1eac9cb241ab51a
AUX calculate-core-3.2.0_alpha10-r2.patch 2440 SHA256 8950e954161078245875a08fcd5468731024eea22ef2ec4f95607896a74a0c88 SHA512 3eba6219edc2659987287b7c8c60e1c15e19bf1c3852f8e178b0d9c53514df4d9d5f55a4a69255195a7fef6a025da7cf3a6472c7795acbc6ddb0ab644ada4a68 WHIRLPOOL 5d898b8719a46c4cc3ea846f2c8d1bab476f76f10798b07a5edc55387e2fdccc79290aab5719cf1505962a18a4391d0b68f70620ecfd16eba42a9b7151a6866e
AUX calculate-core-3.2.0_alpha10-r3.patch 2789 SHA256 0c0a023529b35f0fc09e17abca883dc46afa25ebf510a48c29f0fe62ed9a61e9 SHA512 b3f078aacedde24fe09ede80b19224c394216627f4b355a06b8b32209df85fc70b8f23731a3b3497b4078181bcdaa683962fd927a58066ae2e9d36f595c90284 WHIRLPOOL f106af1c9a09b620446e1cd761dbc5ee0d2fc0785b41f6575cc62430ea3abe24acfe4be111d8e00e06bcffc6c0aa893f52732d14c30aa55b675c5fa061efab0c
AUX calculate-core-3.2.0_alpha10-r4.patch 3149 SHA256 89c9bdc7c9798484d6472d6c0888d474f4d6549e71dce92c407c20f5a613de71 SHA512 5d3f1d12a9afdf59218863a5581fcbad001ccaea4c0652f1797f43b9f00f71c2807787da59d1c0cd11fbee8cfa7a834ed8907754f4364e220d215a08cc173856 WHIRLPOOL 8c284f25b19a346a66a61c8a2cbdb77851b2bf8bb65fb38dc704d4746d00250ddfa763b833092efde69a402dd0ee657f3351b2d642dee4d533d5f951b88b5e6b
AUX calculate-core-3.2.0_alpha10-r5.patch 7494 SHA256 0ce43d8224514264b71afed7e4bc5d03dbade1138e9486949f00e5ec58e553cc SHA512 9ce6a3b902b0c5310d3f2940029bef5f9a9aca2e8ee689d8550890b188c4a1b44ba678dbaf21feb01658edc588ea2518695bd11cd51f8807c6a9fef69262bc9f WHIRLPOOL fa84c8a736374e85f19a4f5aef4eb7076aa3b854a6baec1173baa405aa77603ca102b0b5d88cf4d3c91874f51293fc60624f626afb0b1720184a1a2e42c703c8
AUX calculate-core-3.2.0_alpha6-r1.patch 28016 SHA256 d99381bd316fba8256b5eb54945124c5f32d816b06ad3d32c7d972ff0d01e71e SHA512 a60106837082dd4e4f2794f71cf69a782fcb22f823a1f9f325e14145cbb195fd79e2b0bf5cfb1de486c0bb76b7b00c4694c33c1a9a639a7022f4b34c4f08f3b5 WHIRLPOOL d96a915b3755b061667e1ce8234c480e677429b6bae118774027a4d58930a9b2c13af635638d0c3a972e6ff64a7a19cbadf6abe1d048eb9c55e0e41ecfa522e3
AUX calculate-core-3.2.0_alpha7-r1.patch 1253 SHA256 d1fa9b92b9616e22f7ff48de153a0b07e5c5f30727784048c341135e2b992869 SHA512 b0fd0053961d62a0eba396ca34d7bd41551b3430bae1a8467410758222c8367809e16edc2b1282fe2ef31f469a0cc3619ecbf0581952f9a1a8c5fed4102e9477 WHIRLPOOL 9e90ce6979ac1e8db54a12bd04eac784650a0feffaffdc51569a52a4a84fdfa7f0afc60c2f370e18798a7cadf0d638530f1dd1d014aa23af6810507706792b1e
AUX calculate-core-3.2.0_alpha7-r2.patch 2540 SHA256 89541f9da25b7b4fd71410c5369f8e53f5e589740a644150e78d685c7d867fb4 SHA512 d40195a176c24a891cb6fa84e215c45a6961853fcce775727c39c55a7abe851ba35e2582e11aeb43ee84f7565bc4006f9376136c9570f61710d0b3487ecdd630 WHIRLPOOL c6912581585122ef4759b51d19b20aeea8befa7b96d67431b6e7a88f33908f2eed4c14172bd41a62e6fc836447263d0203936f80728e268f208ab79dc20aa167
@ -14,6 +15,7 @@ EBUILD calculate-core-3.2.0_alpha10-r1.ebuild 1273 SHA256 359b9202de2b02ccb7c4a5
EBUILD calculate-core-3.2.0_alpha10-r2.ebuild 1273 SHA256 3ed7f006373c40d2d024a24615a0c24b6849f2ddfafba681f8fafcd77fe0caf1 SHA512 44a5c40a69112a6f85dc4c0935638b3d72fd93f0492f549b29cf2591b4b50eb757ac0f1e1e31c94205acddb36739cd0ce206f9b4115eb7ac74380ce1cc6bfc04 WHIRLPOOL ca817adf43c41f42bcb4613e563e98d4748e82d25c68d33329767b5133cdf802330baf0ff6ba068b17245797ee812ca5f15e70d9500967ca933baccfd734560f
EBUILD calculate-core-3.2.0_alpha10-r3.ebuild 1273 SHA256 feeea465cc1514e5bf2f8230bee5c1314bc32e578373ceb54eb049e310358a87 SHA512 60861c617597bac8dbc2a85287d57a347a0b0b9260502d856c0377e3dade3e8a207f5d9c5abeee0917b1f96b9f35cf9783f4c72c73ce2f891c467149c67b9727 WHIRLPOOL 448e2755107eaabbf625e1c382f51f9610355f27c60553d5d39df33c9119c0dafdca7bcf780322e5ba2818c4279a1e97352a685de0e9c4dbe65d00b01af69f4d
EBUILD calculate-core-3.2.0_alpha10-r4.ebuild 1273 SHA256 7e5a8a96cd82f46f4572b2a574b8d206661d87e74495801aa4c762b53054d24f SHA512 2142f8446b24f07226e790cbbf2c13cd8f0ceb6012dd77b4c8f646ee23a4ab641d13dfe452eca15c7251688c9a89ddd91855f6de4795bc5715aae1f710a173f0 WHIRLPOOL d53e375ab1ea4b722db12174f9655c70a6a8e12416a94bad9eae6324651a8f07b4195abb013bbed206aab977767e9676a713df2c90e0435eda6fbe45d26df70a
EBUILD calculate-core-3.2.0_alpha10-r5.ebuild 1273 SHA256 d23dbd51ab4c413a903a6543a1b9325c427546b23043b0a994a6788f301b35e5 SHA512 f4702d76d45722689bb7919c104f9adc1a5addf64b87b6ca9a53c8f42611852af9411d9319267b189ecc2a459146738db33d8a6ab220d1d1d04080fa05dfdd28 WHIRLPOOL 7448daa2bbe3200436a0bc71a736442fcfc7a2fc12d3d4187bafe031469722f4f14082b36c253a710f8a57654f3c060b543a08309b20a6a4f7f397dcbef83c7b
EBUILD calculate-core-3.2.0_alpha10.ebuild 1130 SHA256 b5fd665e9bdd2768881d7036b4fd6b6a1951d80c1f35ce4a3d718f7be7d0696a SHA512 317e92465c4a563a9f8f0f77d9026c8d7bebdec046cf6b5e18fc4d64db7ed025ca868b047468e511b81c282812813300d4a7f09956dec6bc8f0e732513422d31 WHIRLPOOL 56a65ee5a91ed9044eb8d45e519b72e46a50a8cd12de8f88c70553b928c71a68f0593d2246e83808b97ec180182e9a78eb021b2c38f5e48ad0fa4cf09caff0bf
EBUILD calculate-core-3.2.0_alpha6-r1.ebuild 1271 SHA256 eeb673d23352cb9df02b93f47eaf3c2e3558a89fa94867fb1f3d1f8b5bfcf096 SHA512 ae4b2dc1f27e84c18e35fc0674ff522398f4c90965f67e278c830da707d9d00cb885b5b11deaabde32f3646e8de9929d38605cf35f14a755b1e772e19fce8b21 WHIRLPOOL ec4d78b528eafc85f1bbdc139d0ac5847b1470ca74a2d1db62b5bf00d54af937ac6c8228256cb2643180f477670efdb230834d2294a097558bb1c84e42992cdb
EBUILD calculate-core-3.2.0_alpha6.ebuild 1129 SHA256 e97ed753f108f340b41475c02a65fd4a05576e6f112e677271df991a680143fd SHA512 ce1f5eb6fdade47f2dd8d2a2a306eaa8ad9b57e52ea88fe5cf5fcabd933fbdec2e7cc114a2ad8e242aacb2bf2b90f5e74c7f22dae743ff063f29c71dcc01714e WHIRLPOOL c47b85f17c567c550bfec337f5d241593fd789c441af1ecaf366f20c5c594f21367e381610a7ca1901e6fded6b1c159b16a8f5645b0d7af812679175b40b9ea8

@ -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_alpha10
>=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_alpha10-r5.patch"
}

@ -0,0 +1,166 @@
diff --git core/server/api_types.py core/server/api_types.py
index b5d7e76..d9f268c 100644
--- core/server/api_types.py
+++ core/server/api_types.py
@@ -531,8 +531,8 @@ class CoreWsdl:
checkall = info.CheckAll
errors = map(lambda x:ReturnedMessage(**x),
dv.checkGroups(info,allvars=checkall or not checkonly))
- if dv.Get('cl_env_debug_set') == 'on':
- dv.printGroup(info)
+ #if dv.Get('cl_env_debug_set') == 'on':
+ # dv.printGroup(info)
if errors:
return errors
if checkonly:
diff --git core/server/func.py core/server/func.py
index 00249b8..c9e1b02 100644
--- core/server/func.py
+++ core/server/func.py
@@ -20,6 +20,7 @@ import sys, os, re
from os import path
import traceback
from traceback import print_exc
+from calculate.lib.cl_log import log
from api_types import ReturnProgress,ViewParams,Integer,ViewInfo
from loaded_methods import LoadedMethods
from calculate.lib.cl_lang import setLocalTranslate,getLazyLocalTranslate
@@ -140,7 +141,9 @@ class CommonMethods:
# определение каталогов содержащих шаблоны
dirs_list, files_list = ([],[])
useClt = useClt in ("on",True)
- clTempl = ProgressTemplate(self.setProgress,self.clVars,
+ self.addProgress()
+ nullProgress = lambda *args,**kw:None
+ clTempl = ProgressTemplate(nullProgress,self.clVars,
cltObj=useClt,
cltFilter=cltFilter,
printSUCCESS=self.printSUCCESS,
@@ -708,8 +711,15 @@ class Action:
def run(self, objs, dv):
"""Запустить список действий"""
result = {}
+
self.group_name = ""
self.clVars = dv
+ logger = log("core-action.log",
+ filename="/var/log/calculate/core-action.log",
+ formatter="%(asctime)s - %(levelname)s - %(message)s")
+ if dv.Get('cl_env_debug_set') == 'off':
+ import logging
+ logger.logger.setLevel(logging.WARNING)
for obj in objs.values():
obj.set_link(self)
obj.clVars = dv
@@ -717,6 +727,8 @@ class Action:
obj.init()
try:
self.beginFrame()
+ logger.info("Start {methodname}".format(
+ methodname=self.method_name))
for action in self.get_tasks(result):
foreach = action.get("foreach","")
if foreach:
@@ -732,6 +744,15 @@ class Action:
task = False
try:
run_context = self.get_condition_context(action, result)
+ actinfo = "Run" if all(run_context.values()) else "Skip"
+ logger.info(
+ "{action} {name}: condition: {condition}, "
+ "depend: {depend}".format(
+ action=actinfo,
+ name=name,
+ condition=run_context['condition'],
+ depend=run_context['depend']))
+
elsePrint, elseMessage = (
self.getFormatMessage(action,"else_error",
"else_warning","else_message"))
@@ -810,6 +831,8 @@ class Action:
failedPrint(failedMessage)
if task and res in (True,False,"skip"):
self.endTask(res)
+ logger.info("{name}: Result is {result}".format(
+ name=name, result=res))
if res is True:
on_success = action.get('on_success',None)
if on_success:
@@ -822,15 +845,19 @@ class Action:
self.endTask(False)
self.printWARNING(_("Task interrupted"))
result["interrupt"] = False
+ logger.info("{name}: Interrupeted".format(name=name))
except self.native_error as e:
if hasattr(e,"addon") and e.addon:
self.printERROR(str(e.addon))
self.printERROR(str(e))
result[name]=False
+ logger.info("{name}: Native error".format(name=name))
except BaseException as e:
result[name]=False
error = shortTraceback(*sys.exc_info())
self.printERROR("%s:%s"%(name,error))
+ logger.info("{name}: Unknown exception {exp}".format(
+ name=name, exp=e.__class__.__name__))
finally:
dv.close()
self.endFrame()
@@ -1087,7 +1114,7 @@ class CoreWsdl():
self.process_dict['counter'] -= 1
return res
- def addProgress(self,message):
+ def addProgress(self,message=""):
id = random.randint(1, self.Num)
while id in self.progress_dict:
id = random.randint(1, self.Num)
diff --git core/server/methods_func.py core/server/methods_func.py
index 5a25e4e..fb9565b 100644
--- core/server/methods_func.py
+++ core/server/methods_func.py
@@ -237,7 +237,8 @@ def get_method_argparser(view, args, cl_core = False):
# data['metavar'] = field.name.upper()
if "choice" in field.type:
data['help'] = "%s (%s)" % (
- data['help'], _("'list' for display possible values"))
+ data['help'],
+ _("'list' for displaying possible values"))
if field.element in ['check']:
data['metavar'] = "ON/OFF"
try:
@@ -388,7 +389,7 @@ def display_error(error, args, groups):
elif error.type != "commonerror":
colorPrint.printERROR(params_text % error.message)
else:
- colorPrint.printWARNING(params_text % error.message)
+ colorPrint.printWARNING(error.message)
def check_result_msg(method_result, view, input_error_dict={}, args=None):
diff --git core/setup_package.py core/setup_package.py
index f920af7..3285b52 100644
--- core/setup_package.py
+++ core/setup_package.py
@@ -113,7 +113,7 @@ class UpdateConfigs(UpdateLogger):
"""
Получить пользователей в X сессии
"""
- return self.clVars.Get('desktop.cl_desktop_online_user')
+ return list(self.clVars.Get('desktop.cl_desktop_online_user'))+["root"]
def getConfiguredPasswdUsers(self):
"""
diff --git core/variables/setup_package.py core/variables/setup_package.py
index ac6daf6..9da4e0d 100644
--- core/variables/setup_package.py
+++ core/variables/setup_package.py
@@ -201,7 +201,7 @@ class VariableClCorePkgDesktopSet(Variable):
def check(self,value):
if self.Get('cl_templates_locate') == ["clt"] and value == "on":
raise VariableError(
- _("You shouldn't choice only clt location "
+ _("You must not choose only clt location "
"for desktop templates"))
def init(self):

@ -1,6 +1,7 @@
AUX calculate-i18n-3.2.0_alpha10-r1.patch 239341 SHA256 237867da968f03263f7b7209fbb3278b4f8db0b55f872a6d697134e3cd0cf828 SHA512 47405f5d8092fa007cf45416f8a8963165705f8ce9922488634c2b4ec73bef68cb0235d54f6d513d00e3feef561c7f5237bda60f3b592c2b22d03547954be194 WHIRLPOOL 9c40e17eb0dc5d5819783647623d4b3f2906dfea343705c63021184b5e9bbd843c48a5759e81bf6d2621564dc5d7d41425f9e96885a0b565db86334f6ca23533
AUX calculate-i18n-3.2.0_alpha10-r2.patch 239633 SHA256 eb45bf3936c023a17b803f1ed21959f0f5855ff356b88c529006a7e416ecbe47 SHA512 06f1e2210cd1f64a342570af6a514cb7a439152dbf857515a352f6d8699e7ad34de6da43f9be40ac000e7eaf28d9fd94c66646681a6011e09a89c7484afd2d4b WHIRLPOOL fcdc8782b6ed2e0e3ade0225b298dc8c3132806351a2ee6193381bcea1a0435989ad7c1b36550907c3ab452e82522e3c836157a5db2c4493ed21d1e364c5edea
AUX calculate-i18n-3.2.0_alpha10-r3.patch 241985 SHA256 30f7b4e20b8843c8e09bf8364ccf875b5ec2465ee71de22f8edca95f0c61d382 SHA512 0057ff8751db2eeae8278661fc8930868f90ea6a23175df57068db23aaf747c6e5ec2be24db7c22b52af7380e54f33392ae4970c250e58824a771f5d153310e7 WHIRLPOOL 273f7261077a53560f5ce6ee0c61641be02b44cea6a2a29ba76d1ca5ea90c0b168671aa63e094f7336c5c409344a84fcbfd30092982ca7a23b04b537f1c8daf0
AUX calculate-i18n-3.2.0_alpha10-r4.patch 242367 SHA256 6de71fb7ac471000df0f0d37821aa582be104f1f67434a333381dd3baca4f398 SHA512 9b034476a5137fb57e418667e3afa8c0f3bafed311a35743107c9ae2276785c0e5fa7c1ae4bfb63515aed5720cc9cfc430d8ae478702dddbdb49fa0296a3bba7 WHIRLPOOL a1c6be2761ad14074d06d0e0b579346d6b44e1705e5ef956442ad99c533d8c5118e36cdaf8147670c65e536d38d74ae02f3fe27e2c5f8e82486a012312e116b9
AUX calculate-i18n-3.2.0_alpha6-r1.patch 2028 SHA256 b9e8577bdd11aa5e37e276bfca165816456ac43407bd509043b23740cc5e4d60 SHA512 b66a449e3b6d2f44f91b920c33e3f69d12d9659eb9973653babe5a15e5fc7c4d6ff5774957c231fdbcb435faf7042b327deb5f7c968d0f75ae412cd5938da66d WHIRLPOOL 14fd8b210ef316b82e9993320e014a79c4f263b48124ff344c87cd22f72285070667063ea6a5a299191e50f38e2e378272f80daffa93e0075ab00d936274b775
DIST calculate-i18n-3.2.0_alpha10.tar.bz2 111001 SHA256 484c2135f361dfaaa326c2dc5c0f29cfc685f8a4dcf6fc363d8df72e3692b6c1 SHA512 c87e6e7d196c23012e6a1999ec93652a29d28ccef219702b85445237d3cce6a8fcad3929ef1ffeb5204747d025c3f79a6ae2f5fe1288f48e81144ca9479db5cf WHIRLPOOL 94614bd8c49cc0fa3636271dd43b91e24b193a00262837e7e17fa9aa02e475ba141e56fde566bd33f272818ac0dc6d915627b680c3ccc74fb642239fe6d869fc
DIST calculate-i18n-3.2.0_alpha6.tar.bz2 64584 SHA256 19a08288593778bb81df32c4c7d8ec6c2e3cfab3e98c778cc661d47a6d9c66e1 SHA512 b512ba91756af95ce7f388139280a9e8015a1a41c41b8101d56f5202df5cf42d1038d25dd3f97ab13542b5c85a6999eb303c338bf0aace7033cfb2987bfec660 WHIRLPOOL 80863dc1eeb451df069ca31e3b0cf5bbfdc56fcd838dd7047a9f494aaed1b0b4890dbc4fe812a6f46ad24b91606ec224380d5c5bc909a13965aa1defd907a364
@ -10,6 +11,7 @@ DIST calculate-i18n-3.2.0_alpha9.tar.bz2 108347 SHA256 7da6778e253e1a58a459d6dea
EBUILD calculate-i18n-3.2.0_alpha10-r1.ebuild 733 SHA256 27b827e75f6eb0d2e18c879216dfcaf0613b56eb5f661d56ba5bbda6409dabf3 SHA512 6c91ddbe89ee909e711af64aa2e0dd66e8d6198e98dd687116b055d3ca0cfc2633cd3c69ece4256c2a8fd8ba8e85c74fcc39cc2c355db31ffd668ac9470fb98c WHIRLPOOL 2c7d91a6d1529472feae6684ef389796f95f27134f8b353b05a8993f5270f26c9f001d189c7e7d1379844dc325850a50be39bd665c9a67116d66d9e22702c592
EBUILD calculate-i18n-3.2.0_alpha10-r2.ebuild 733 SHA256 c842ca44ca04de6645fce892658d62a7b26c43a35fd971f657c13d39fdd25c09 SHA512 50dc4cf0f67c122d4685dd826bf0e688692408ff6a0841095c23f8d7247675e728538284b48d24914b30b9ba84237e4821ede284a22d2eda605595329d05f56e WHIRLPOOL c3b78ec6c799587588ce6ba845b6a862fca26d767b9a1e4504164231aa4bf5a0454932239f990b42e456113ab714f50bb23af81b3ad14b97dd2a8edc7c4ca058
EBUILD calculate-i18n-3.2.0_alpha10-r3.ebuild 733 SHA256 504fcf519add1db10907ae7b795bb9f5b7471dba990f98b3564755bd33b044f2 SHA512 7c791af9c7e4df32ec4b3321d71f954e12789a3dd5d42536377347490395220f71de5491e761f3d365563e0598d106193c80746bb2e69454f6311f602f24c4de WHIRLPOOL ff1096e7ea788fc16f6b1847a35180c28dd34e5fea48d461d550af4a58afe3983a51641ceb2eb4ef1b73d1444c1a7f04a65a8bc0710cc547301faf9c89d7777a
EBUILD calculate-i18n-3.2.0_alpha10-r4.ebuild 733 SHA256 760e33a8fcbddce828fcb6cbaf864d7cb6cbb3b2a90ce2a63f6a7be524a430d2 SHA512 95501815c6a74b94f45ce71d7a736e65afd53674865404fe40263ef449468a7398b3100d09b435d241fb845051db92751c451cbc95a1e757b6a0567b16b481e9 WHIRLPOOL 6070e69be2d7ad9e7e5942eec7a2b483a5685c21572ce21d2737b1de739f4213733faab05bd3555822f63aa93c3124e4a94a9df91dca443c2f8cf093265d303a
EBUILD calculate-i18n-3.2.0_alpha10.ebuild 590 SHA256 b14e52620a2230b40251a8111da01d0b6a460f880b55699099de644f73cbe275 SHA512 0e65611eea92c4d014f3f4ba8b5a16e1fd4a7f0df8e776c556d6852cf6d5c5352d101e5551bcd2d104869f1b4b652f37430640bc4bd43bf7144d69703bb8374f WHIRLPOOL ed98deedd644814000d1e4873feb4993f37950009e2a8b2b2e0dfb2d05159e5b56856b34871c1536c99845418c690c335770483145b25f35c2e1ae01234a653c
EBUILD calculate-i18n-3.2.0_alpha6-r1.ebuild 731 SHA256 be88afd34ad405aa054f0e2d571272005abcdb0fae565aee4831170cb8da2826 SHA512 f23bdf7f67ca241abcfc287a86d322119a9b34cbc733658b9f95d3836d669849eaed3b0704c2f22a50b43c14974bc33bc94837b4be60c073f54283d0a819f09b WHIRLPOOL 8bd173141576e8add3622d794175db07cd8edae447d6d95bff10fc6276c65db2c83f9dd4045feaffd019daf2d33d8055a108fd5ee39e57613753ffe328750369
EBUILD calculate-i18n-3.2.0_alpha6.ebuild 589 SHA256 4f8fa37f38584c2cf677381de4eb0b29d950e267092021b261646fc399c9ced0 SHA512 38ae5bd8627cef3b67177705f1f03d379161cca364de0adc8bcffb60616f234a45ffc1eb62b56966a4b4de39f75c6d7055b51bcaa05c4460e4bfbc546fc6fbf7 WHIRLPOOL ba058adfe7ce88bd7de4286e4cdeaa306cf4ccc560ffcc170f503e13e2bd10415b8325445ee4b7f975425142525030193802f2a6dddf18d5af9c8bd66768fd52

@ -0,0 +1,31 @@
# 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 utilities for assembling tasks of Calculate Linux"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="amd64 x86"
RDEPEND=">=sys-apps/calculate-lib-3.2.0_alpha10"
DEPEND="sys-devel/gettext
${RDEPEND}"
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-i18n-3.2.0_alpha10-r4.patch"
}

@ -2,6 +2,7 @@ AUX calculate-lib-3.2.0_alpha10-r1.patch 4196 SHA256 43ed4f580cbfd46c99b4e028003
AUX calculate-lib-3.2.0_alpha10-r2.patch 4918 SHA256 7496e59a2aed034d48180b8c48f271192f87c0102b8dd4db2415c9cdcaf32f12 SHA512 5abc2a1541ee498ecc335fa3322c2b1961d310ef7d3545a5eef2dbcf19e1cf90909dad437714a5b54469225ab2780e43ce19b5637ce64276f40c95d344730330 WHIRLPOOL 08402c14210d02551cead7b598d98db19c0263f3595f9a89949399092b5e21e73794d1f3779a4ccb2f8b2fb4cfb01c7b886865cabdc700525270ca2b960ba77f
AUX calculate-lib-3.2.0_alpha10-r3.patch 6726 SHA256 ee2f77fc6c0f2e3c3d1fc7d69d1e00eee37e86cfa10bf4a58740c9fe319a1972 SHA512 9d878122e5b0784fc5e184247c3de48385631c3f6e8b0e8b2f3ad7876759d8a89c8c2a14c59546bba425448ca88438dfb199b7a06b7d1e9de9e70ef15feba98d WHIRLPOOL 640c3e533b5d13e05fe01cd732fec921130be6acd9c07a31d9789b147855b90357cee8d6f76e2d5b70d6c8112b0d5d9002bfe2e81bd46285a441bd73fb2c94dd
AUX calculate-lib-3.2.0_alpha10-r4.patch 9215 SHA256 4a3a3b9e868d81417db50030f52837dc9eadc2859701b8d7b0eff3da91f9c7db SHA512 cd1cc64bbd6be0f2a5ddc5aa3939243b73c38d3a07f9f81987cf7ec0d8eb5447b0f31c11e38415e2c23bdb2806d03cc15b745dd9c1e0a8406ea438b6f02b8ef5 WHIRLPOOL 33ed20fa177469ba419d02f88ac4c41b9a25ebbced650ab2be1de409f95eee7cfacc5387e66eb7da2fd9ad3d900a1571413a432a14051b540bdf594362520174
AUX calculate-lib-3.2.0_alpha10-r5.patch 10381 SHA256 f48ab2ea22a79a965e286c496a72d83fc52e3a02daee5be5a11fe27f9ca2955b SHA512 ec4b3a33702822c35c4d17783703cc5009ea2271105de14b619ce370002f14b3ff93c28bb98a3c501642eaec3c59d9f8fba00f5692dc13d2696822cf0b9cd3b0 WHIRLPOOL cdfb530d2a26fb9c2408e2fb6e55936218eb33dc4f4612f5b5f1eb7926e79f71e70900a73c7c1c3a89385db2384cfb277dbb4fc56a5380d0e7fc51f0aed743fb
AUX calculate-lib-3.2.0_alpha6-r1.patch 4151 SHA256 4070948bf227f5fb60dc89f1794d9dcf15a9fce48a5b9b5318d9223d71364da7 SHA512 4dbfa5a48c24556979a2a73b184eecc976b8738cc05bbffccfa2792a992e9d21ed1f37bbe21e4401eb2c92678f90b692e30b25119473908b3585a2fd226f74cd WHIRLPOOL bff16327876d77abc7b37006ff06d44f17aeb8de1043fc86c59b76833c97a5de52b73a966e3174cc5ff57d347c829d3f219767855458a5e46cb4b948da7be5d8
AUX calculate-lib-3.2.0_alpha7-r1.patch 1118 SHA256 35133f7a5eda8d6e53d64f01ba473b0c219a8f2b333d4cd0ab43a40648b8d987 SHA512 cdd362da23c490846ad923b407f5bc26204ee3023a0dd600768222f31aedef9cdf42bac1a8f1a7cf3264847cb61705d3fc9a19f10de14afa3f0abe4e38b31555 WHIRLPOOL 820b6e8f5233ba1ccdbaf8ef78650ca0ef07bd83b1ba08a6747103b34c4858a89a5066267d84054072eaa0e98bba86ff50da625042b1f4cf251714dbaa8d1b34
DIST calculate-lib-3.2.0_alpha10.tar.bz2 133003 SHA256 fcb00981d41ee116fd802daa54ca2f47dca26d3ae7f2bba0cd9a9f811f6d7d1f SHA512 786fbc24ae50491d6638ca8c28f101979d661f868d015ad4dce7af7d58588c3553882221ff15f01d1a0f1dbd4ccfe8c92dc55d6fcd2ec363ff9de693626eabf7 WHIRLPOOL 867c8716f6ab84fe2ae76f1f184ca9c1405a27806f1c1a1e809c208653b60eb9e0e6d74cacb44f6042b3857ee984d1ef484d22ca81fa4598316ff6aa1231dd1e
@ -13,6 +14,7 @@ EBUILD calculate-lib-3.2.0_alpha10-r1.ebuild 856 SHA256 d01828d00a9347eb963167e0
EBUILD calculate-lib-3.2.0_alpha10-r2.ebuild 856 SHA256 6468336a01a361a11a73b32ad7bb91d3785da2fa441f04349d37c92d62ca6d8a SHA512 99656bb9ea07bd7b9cf10b2a872c727da82c4a67fdcf84c91c09eb27a673d4efdf41efd608b9bdc74da69a1f1dd7ae981118511fdfb6419fc668f3d92d5a3608 WHIRLPOOL f24a9125cfad4259ae24c0b95dd4ff9770d5f79b2bd4ea111bec26bac4c81548ecd0066f46867e113221b022fd696412e1f2c2c1f87ca28c1959949b0fd41c2e
EBUILD calculate-lib-3.2.0_alpha10-r3.ebuild 856 SHA256 eaf4afc0a2f6558d71a3b9e6b48cd98cb7fb20a4e3e9c6cef3f79d9d086f36c9 SHA512 b0e36a401bcfa9e02eaa27e3d56664080cd4d57ec5a6cf17eadecba2da909a2bf1a52b15061fbd2d96234fea6dfa007eed3adba3989127644337043187926940 WHIRLPOOL fb438f31d713ecc60d4ef37d828813dffbcc1f68a533e42cfc5fa7d98bc9b3492eefea50209451d794664fa4419bb5ae793eb3e8fc44020d276853a88ea528a3
EBUILD calculate-lib-3.2.0_alpha10-r4.ebuild 856 SHA256 ff435b64f138729fbd5a077e324846ec106be437457d6d4ebea86309c2fdd16a SHA512 04466d5dd969b8921384262001382401d6e526df8defebcbf03f0816b5397e7b25f7406b5da7c7af0f6b78bffbdc0f7d26ae583f3a7e1adafc360c426a361dfc WHIRLPOOL 1309f07e6c0265ba499f1cfe318704f79658e2c3300ebdc3a63de9fd2919c7873aad0af2c84778e0882c0abceeefc8761ffebacb897a20f379258e5cedd6f67f
EBUILD calculate-lib-3.2.0_alpha10-r5.ebuild 856 SHA256 75b909f7b76026deadf85b29c2f0e8724e8fd7032c661e0cc377a76d17bb064c SHA512 530b7054233f18fce0b8420299c20e3970efe2087544f1bca3164949d0ef041f1aaf1bc59be2a99a1347fd46a5f58030aad61dd8c83dffd50f21b5f00d4a5613 WHIRLPOOL 33dc9923e1d75f0b50f4027304aed621011291a38a0dc9556f08ce2ef3885b1fb7791bc6d22f5f497f22bca0ecc21b0bf0d966628e2f1ddca1c42df058410d45
EBUILD calculate-lib-3.2.0_alpha10.ebuild 714 SHA256 34d7199436229c50f7f78909decb90e36aff881c761970a9a57a524f08757d8e SHA512 500db3d23718662b4e3023ce0306da00dbf09642722ac7c83d1cbda01121170b39bd322d502955985a65440358196ea1a6e4882dc866fc377e6082714e05ca6f WHIRLPOOL e2911a0ec8c1ae4e610925fcfa1182ca771311a6bf19cf625558fa650a7614bbd3b608cc3de9966c05c2b7d82904f8df34bbf01fc2e6eba8d1ff7c6ccdfc2685
EBUILD calculate-lib-3.2.0_alpha6-r1.ebuild 831 SHA256 6ef8bf48d4fc1b2210c0940aa8300eef928a381e86eb90fff1e7c0862dba182a SHA512 1582bbf375bc8c5f10aa65c18aa7ab886d84cafe991ae799483c10a5025a5b4bd12b58f5a1d172e425e542d595951c495d80417782b321b8c2efaca5d697c1e1 WHIRLPOOL 43fe9b18cf7669b6869dd6ae94f75ab40affdb10993cfc50437a6b6bed06bdf20bbb5a8c663c33a557e5a3d78f60ee5a272458b74dc988ced56945d7befa67d6
EBUILD calculate-lib-3.2.0_alpha6.ebuild 690 SHA256 c89c29f5de3f70146e98f15035366506933f03e8a5066b1ad55aeccbebdeae2c SHA512 a7277c2e5fa64a5e5840be7fc8d3df9a31f41926386c5fe6a9bed31eeed6321af5881c218d9ce7eeb12aee518edb682b438e10397dcb815cc63645100430e43e WHIRLPOOL 8f19e4d46381e26fec81e20fa35599f4658b3891d6372c921a8b1354ad3b1821ea9c78f71caebf54610e0b5aacfb6e6ded018e155e1979322406a0ac1e823d09

@ -0,0 +1,37 @@
# 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
dev-python/progressbar
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_alpha10-r5.patch"
}

@ -0,0 +1,244 @@
diff --git calculate/lib/cl_progressbar.py calculate/lib/cl_progressbar.py
index cfdf384..e417881 100644
--- calculate/lib/cl_progressbar.py
+++ calculate/lib/cl_progressbar.py
@@ -139,6 +139,7 @@ try:
def update(self, value):
self.setMaximum(100)
+ self.setTextVisible(True)
self.setValue(min(value, 99))
@@ -203,7 +204,7 @@ def get_progress_bar(bartype="text", title=""):
pbar.setAutoReset(False)
pbar.setMaximum(0)
pbar.setLabelText(title.decode('utf-8'))
- #progressbar.setTextVisible(False)
+ pbar.setTextVisible(False)
return pbar
return StubProgressBar()
diff --git calculate/lib/cl_template.py calculate/lib/cl_template.py
index 7363a50..cc31ad2 100644
--- calculate/lib/cl_template.py
+++ calculate/lib/cl_template.py
@@ -46,7 +46,8 @@ from utils.files import (getModeFile, listDirectory,removeDir, typeFile,
pathJoin,readFile,readLinesFile,process,STDOUT)
from datavars import DataVarsError
-from calculate.lib.cl_lang import setLocalTranslate
+from calculate.lib.cl_lang import setLocalTranslate, RegexpLocalization
+
setLocalTranslate('cl_lib3',sys.modules[__name__])
PORTAGEUID,PORTAGEGID = getPortageUidGid()
@@ -3818,6 +3819,7 @@ class Template(_file,_terms,_warning,xmlShare,templateFormat,_shareTemplate):
printERROR=lambda x:x,askConfirm=lambda x:x,
userProfile=False,dispatchConf=None):
# совместимость с вызовами из модулей предыдущих версий
+ self.translator = RegexpLocalization("cl_templates3")
if userProfile and objVar:
objVar.Set('cl_protect_use_set','off',force=True)
@@ -3970,17 +3972,23 @@ gettext -d cl_template "$*"
p.write(code)
p.pipe.stdin.close()
for line in p.readByLine():
+ if line:
+ line = self.translator.translate(line)
self.printSUCCESS(line.strip())
p.pipe.wait()
if p.success():
self.executedFiles.append((code,execPath))
if p.readerr():
for line in p.readerr().split('\n'):
+ if line:
+ line = self.translator.translate(line)
self.printWARNING(line.strip())
return True
else:
if p.readerr():
for line in p.readerr().split('\n'):
+ if line:
+ line = self.translator.translate(line)
self.printERROR(line.strip())
return False
@@ -4266,7 +4274,7 @@ gettext -d cl_template "$*"
"""Check template variable cl_name in first directories and files"""
skipDirs = []
skipTemplates = []
- debug = self.objVar.Get('cl_env_debug_set') == "on"
+ debug = False
for dirsTemplate in dirsTemplates:
filesAndDirs = map(lambda x: os.path.join(dirsTemplate,x),
listDirectory(dirsTemplate))
@@ -4764,7 +4772,7 @@ gettext -d cl_template "$*"
self.postmergePkgs.append(pkg)
except:
self.printWARNING(
- _("Failed to reconfigure %s package")%pkg)
+ _("Failed to reconfigure package %s")%pkg)
else:
mergePkgs = mergePkgs + postmergePkgs
@@ -4959,9 +4967,8 @@ gettext -d cl_template "$*"
try:
os.chmod(applyDir, mode)
except:
- self.setError(
- _("Failed to change mode for directory: ") +\
- applyDir)
+ self.setError(_("Failed to change the mode for "
+ "the directory: ") +applyDir)
else:
self.setError(_("Wrong value 'chmod' in the template") + ": " +\
templateDirFile)
diff --git calculate/lib/datavars.py calculate/lib/datavars.py
index eb7f38d..052a5e5 100644
--- calculate/lib/datavars.py
+++ calculate/lib/datavars.py
@@ -394,13 +394,13 @@ class Variable:
if "list" in self.type:
if not type(value) in (list,tuple):
raise VariableError(
- _("Value for variable '{varname}' may be {vartype} only").format(
+ _("The value for variable '{varname}' may be {vartype} only").format(
varname=self.label or self.name,
vartype="list"))
error = _("Values for variable '{varname}' may be {vartype} only")
else:
value = repeat(value,1)
- error = _("Value for variable '{varname}' may be {vartype} only")
+ error = _("The value for variable '{varname}' may be {vartype} only")
if "string" in self.type:
value, valuecopy = tee(value,2)
for v in (x for x in valuecopy if not type(x) in (str,unicode)):
@@ -425,7 +425,7 @@ class Variable:
error = _("Values for variable '{varname}' may "
"be {vartype}")
else:
- error = _("Value for variable '{varname}' may be "
+ error = _("The value for variable '{varname}' may be "
"{vartype}")
self.raiseWrongChoice(name, tipChoice, val, error)
if "choice" in self.type and not "choiceedit" in self.type:
@@ -589,7 +589,7 @@ class TableVariable(Variable):
if not type(value) in (list,tuple) or \
any(i for i in value if not type(i) in (tuple,list)):
raise VariableError(
- _("Value for {varname} may be '{vartype}' only").format(
+ _("The value for {varname} may be '{vartype}' only").format(
varname=self.label or self.name,
vartype="table"))
# check len all entries
diff --git calculate/lib/utils/colortext/info.py calculate/lib/utils/colortext/info.py
index 218c72f..64d94d4 100644
--- calculate/lib/utils/colortext/info.py
+++ calculate/lib/utils/colortext/info.py
@@ -30,13 +30,20 @@ class Terminal(object):
WRONG = -1
def __init__(self):
- curses.setupterm(environ.get('TERM', 'linux'))
+ try:
+ curses.setupterm(environ.get('TERM', 'linux'))
+ self.curses = curses
+ except curses.error:
+ self.curses = None
self.__echo = True
self.__cursor = True
@property
def colors(self):
- return curses.tigetnum('colors')
+ if self.curses:
+ return self.curses.tigetnum('colors')
+ else:
+ return 16
@property
def width(self):
@@ -78,7 +85,8 @@ class Terminal(object):
@cursor.setter
def cursor(self, flag):
- param = "cnorm" if flag else "civis"
- sys.stdout.write(curses.tigetstr(param))
- sys.stdout.flush()
- self.__cursor = flag
+ if self.curses:
+ param = "cnorm" if flag else "civis"
+ sys.stdout.write(self.curses.tigetstr(param))
+ sys.stdout.flush()
+ self.__cursor = flag
diff --git calculate/lib/utils/colortext/printing.py calculate/lib/utils/colortext/printing.py
index c8ef675..0e5753f 100644
--- calculate/lib/utils/colortext/printing.py
+++ calculate/lib/utils/colortext/printing.py
@@ -82,7 +82,8 @@ class Print(object):
return self
def __call__(self, s, *args, **kwargs):
- s = s.format(*args, **kwargs)
+ if args or kwargs:
+ s = s.format(*args, **kwargs)
self.buffer.append(self.output.outputText(s))
self.buffer.append(self.output.endText())
try:
diff --git calculate/lib/utils/common.py calculate/lib/utils/common.py
index 9f13c66..75dcdce 100644
--- calculate/lib/utils/common.py
+++ calculate/lib/utils/common.py
@@ -178,8 +178,9 @@ def getDistfilesVideo(prefix="/"):
return list(set(
map(lambda x:'fglrx' if "amd" in x or "ati" in x else "nvidia",
filter(lambda x:"ati" in x or "amd" in x or
- x.startswith('NVIDIA-Linux'),
- listDirectory(distFiles)))))
+ x.startswith('nvidia-linux'),
+ map(lambda x:x.lower(),
+ listDirectory(distFiles))))))
def getAvailableVideo(prefix="/"):
"""Get available video drivers (installed and maybe installed)"""
diff --git calculate/lib/variables/env.py calculate/lib/variables/env.py
index f35e3f7..86f1bfb 100644
--- calculate/lib/variables/env.py
+++ calculate/lib/variables/env.py
@@ -337,7 +337,8 @@ class VariableClEmergeInfo(ReadonlyVariable):
def get(self):
return filter(lambda x:x.startswith('PORTDIR_OVERLAY=') or \
x.startswith('PORTDIR='),
- process("emerge","--info",envdict=os.environ).read().split('\n'))
+ process("/usr/bin/emerge","--ask=n","--info",
+ envdict=os.environ).read().split('\n'))
class VariableClPortdirOverlay(ReadonlyVariable):
"""
@@ -366,7 +367,7 @@ class VariableClTemplatesLocate(Variable):
descriptionMap = {'overlay': _('Overlay templates'),
'local': _('Local templates'),
- 'distro': _('Distributive templates'),
+ 'distro': _('Distribution templates'),
'remote': _('Remote templates'),
'clt': _('clt templates')}
@@ -409,7 +410,7 @@ class VariableClEnvDebugSet(Variable):
Переменная для включения отладки
"""
type = "bool"
- value = "off"
+ value = "on"
class VariableClMakeProfile(Variable):
"""
@@ -427,5 +428,5 @@ class VariableClMakeProfile(Variable):
val = self.get_work_link(
*[path.join(self.systemRoot, x) for x in files])
if not val:
- raise VariableError(_("Failed to detect system profile"))
+ raise VariableError(_("Failed to detect the system profile"))
return val

@ -4,6 +4,7 @@ AUX calculate-update-3.2.0_alpha10-r3.patch 21132 SHA256 45c1294a6b38123ee215acf
AUX calculate-update-3.2.0_alpha10-r4.patch 22930 SHA256 bb8d7fc90780ea99f38f0831d53d48d112c06db397d41b13469251ca4a187cbb SHA512 5e9e5c8768f6c9636f257bad28cd233180a06f3232e745d4d0228d9cb40445d5107a59a1d67a76f2583fc9c304497cf3a5cc447ae55c8fa02747c701c1eb778b WHIRLPOOL aa6771993617187f0d2e3dbcace8e39cb10f94f678ff580d347996cd577ad0aed744f24003e1073823fea6a7850db09a459f87fccd5c8124f5acdce47f724ef4
AUX calculate-update-3.2.0_alpha10-r5.patch 22933 SHA256 3fedf2dca426d3e81cfb7855b1ae95fcc646d1c5c31de7606b7d9bc918612682 SHA512 85a5a6af470200fc49b482076fabeaf8f9c0cf33d03956b038fe267aa5c5694bdeea53e1377c5dd6e3a1f4559cc7412bbb9a14ddd8c6b3794799aeeb9181e4d2 WHIRLPOOL bef8e333249b4ae5937df0816b684d0962b928ae7737750442bd9ff188a5f28842f689c78b34cdce60f3405ebb260626dc5ca1f158c09e2834fb361af3e2bdbc
AUX calculate-update-3.2.0_alpha10-r6.patch 23842 SHA256 52ff1833754d7842317651b54141e3bbcbb021c6ae4ec0bb7477f5e9aab2a1b9 SHA512 63cba334d7e7c524d32ee527ef748e3e250685fecaa348bd9717568d66d64574c8bbf9434f53a70196b060375d091ee2d946774c1efb29354b022a2c7e85e0a7 WHIRLPOOL bbd6b7e65fd6b2b603b03f0246f6b47897392fb1b3e192933dee463195a87687e6f3d77a1a8530915ccbc7ae6dc1a2d6c41d9ce95eb9682117c29df24873df55
AUX calculate-update-3.2.0_alpha10-r7.patch 32191 SHA256 e1661fc5d4fa7ce0d4e9abddc5effe7090410cbb2a15305533af39cc136e9214 SHA512 6b72ec4919c43d7bcf4687e3359521860372d3951f58e2135f2a7accf8ccb8aa680a47dd7aaedf36388b25e0dbd3234143499b58076f277eefc9c11a0032bdfb WHIRLPOOL fa2196ba44ecec0752ee081549011739a449bb802c1a7e7d4fae4ade8b6a34f2a6fa52ce9cf7e1b57802a45c29a281963f1860171e9587abb1e034542f4ebd4e
AUX calculate-update-3.2.0_alpha7-r1.patch 1086 SHA256 4de503ac11c623bae15c770e2d8a66679972dd3d358cb1852c34c553ebde77aa SHA512 eaa0e099441e4e55e0d98818c679590bdc421ac3029df4111ac280847921bb100fbc2af7886917e48582f3d1220e0b3e221d5537cf1a029265d790f1077b209a WHIRLPOOL 6b00347e85c4ee747a43e4cf0ad6dc411b9529d62c8296f0ed82291ccdd68823f45f110d3f23347a637e822f9a4407c57a3f3dd4aafbd0953ba83f935d4f3b1f
DIST calculate-update-3.2.0_alpha10.tar.bz2 25298 SHA256 8a20822ceea8fee9fc5cd9c790463f389f776ccb8cd80a9ddc56019913e48805 SHA512 ea66987e0e276f8050c218f863f6bb2b9c3fbc604c1427982f740a929a85a8dabe4fbdf1e776e61320642e47a117c301c5fe63b4f3ebc69d190dcd33bc00749f WHIRLPOOL 4910453edce2d21e020dbd7558e718983b1547efbce99e94f151980a0a8c09fd1bb8d4870d4f04c8e0d421696cb31977b422506a05249bff880d4b4c4b046135
DIST calculate-update-3.2.0_alpha6.tar.bz2 24918 SHA256 ba6c633330d68761bc426750dd5b3bb52d75843c1e5adc6f1ee41daa032e1e2e SHA512 c44e02e158758e5f1bfb26d1f1f276d27664e072df9aa3485840d4853320671a0323dc03ccfc31e78f1ae66003416d5723383967991fefbb5c427ec8447dccee WHIRLPOOL 14d5fbec32105e18f31304d7c70f1c57b98b4c3ffd83ca4bc209c622b71df218f2c63f006fb15b5804676c0421b86c05ac6ffef26651e1336a5cf820701900ff
@ -16,6 +17,7 @@ EBUILD calculate-update-3.2.0_alpha10-r3.ebuild 770 SHA256 8f5b5a038e1317b30a856
EBUILD calculate-update-3.2.0_alpha10-r4.ebuild 770 SHA256 e6c00b4eb44471c36d45f5fe5b59050eaf52a3668bfc7d577dc5158842bd0df0 SHA512 fb8ec55244db8a1ad361e2d36d5fa6c682b8480d1d4fcdb9db7951adf70f1bbccec2ebbdce89d1af281f8dc56969f3cb92f810bfe028540a568eea59d18abf1c WHIRLPOOL bc1179b41e93b3c2e6cc25c7b476693811d784cf4ec6a60927414d398cba6adfe5006c9fcdf70520065a537aec632d8ac6656e7121467907d563705afc2a99cb
EBUILD calculate-update-3.2.0_alpha10-r5.ebuild 770 SHA256 5058663bb7288a531948e1c6496e651b802c23337b1a1c065d1d5e602e29cfbe SHA512 ee3515729cda597e27da74acbcc9cb4fda0ba3780432bc78cbaf74fd9a1f053949739720f41698e22aa97b661a10e0e43aad91806a9ef40f0e5324075678b937 WHIRLPOOL e64bf4f8889fd308148fca5434677465e504125980039849de43f4f6bf646d0b970bd1d025121eb162c60bbd8e3a97c8af528337d14c890fdba173b32ad2bbdb
EBUILD calculate-update-3.2.0_alpha10-r6.ebuild 770 SHA256 2693e0a8c42a7d670b3d9e106425e446c6b4bb5796652041698e12ac5fd07208 SHA512 cf3c733e991efec51f7ea8d672a7172961c1a9245861b683841c45a290fe57681387b347be2c99030ce95aed04915bff1d10ce33aa380914a1855148350fa55e WHIRLPOOL 3338b38499d1b0a15afeda77b226f2a1f46bd8b9c64a373137dd510329326cfaf198f721cedf758f3dd71cd97a1b095b2b72953e4ede8956b561bbf7db3fe7ce
EBUILD calculate-update-3.2.0_alpha10-r7.ebuild 770 SHA256 8f3f8e6efa875b74dd51b0c172b5c274f9ea6118fcca6ce871cda06d42e1c2a8 SHA512 d90a16bc55591d0597e592d001f2f11ff5cdf3fd417d7a551ae8fc31e362569344f2e53d01e218d995a62ea6ae5167220f0d73c64a5ebb87b75325bce994fed8 WHIRLPOOL f532909219dcc0f6a13f5d5be2efbecff5b52ce3cff8778e6cdc604b37bec6841d36341df7a244099a608b707b8662249cdfc7f1023fd566e945a6ca79e28961
EBUILD calculate-update-3.2.0_alpha10.ebuild 625 SHA256 fcf7c67110cd4b726c5acd91dbc121488261ee03fa02c1ce987cd1a552c3af74 SHA512 f0cdb147661c97907926db8a70c9dbd8142c91110b2a3caf56791dab5d7c53a821800ed777ea15765fbeea5e1c3e4b26fda614b4d9a1b1fcd48793185b440133 WHIRLPOOL d2323042d9d6db1d13f322877279cd2d39bee97a371ba393b8b8ed17df7fbcb3c141e26f02d1b3d9faf309d4b1458515fe277ff656cc5ff399ec416463c2e3f3
EBUILD calculate-update-3.2.0_alpha6.ebuild 613 SHA256 926d0feedb17e6ed88239296a28cc8113a9e81f3d2369d587f1647bb778bfb7b SHA512 141b324867ea1f744141a3facef0b87a33947085b53e8894387e402855dbab95bce203855f1923ea55c9ceae239227cae44cc840baeabca944ac07fd156a3720 WHIRLPOOL adf9914f598fc16f76c4a9b95115d22ff0a993f5e0c0823ff31e45395bfd9becf0f5dc23f41ff69a911a20673e7d3be45b08be1d7bf9cfc550ccdcc7c7515252
EBUILD calculate-update-3.2.0_alpha7-r1.ebuild 757 SHA256 b7991c8c837ea3be6ba82abe88fe80db1cdb1ab3b13daca86286884beb7dd06b SHA512 ba0604f395d14855146aa6a6fc1eab087789cb3379db7f7925fd13a3eed094459dcdcfc7fff7cfea99a398fe5dad307147711749c2d2eca308aca4e7d6eedd8d WHIRLPOOL d30db8bf3fe1ce41c12b49289be83801d5338970b06add9c63b49a6bf9d8b348f059cfb30025a1b5a56e44b983316a54e2a1ebc301fc3a42fa06a0210e2f37f8

@ -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_alpha10
~sys-apps/calculate-install-3.2.0_alpha10
dev-python/pexpect"
RDEPEND="${DEPEND}"
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-update-3.2.0_alpha10-r7.patch"
}

@ -0,0 +1,730 @@
diff --git update/emerge_parser.py update/emerge_parser.py
index 80d012b..b3a8c96 100644
--- update/emerge_parser.py
+++ update/emerge_parser.py
@@ -32,6 +32,7 @@ from calculate.lib.utils.files import getProgPath, readLinesFile, listDirectory,
from calculate.lib.utils.colortext.output import XmlOutput
from calculate.lib.utils.colortext.converter import (ConsoleCodes256Converter,
XmlConverter)
+from calculate.lib.cl_log import log
from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate, _
@@ -403,6 +404,16 @@ class UnemergingPackage(NotifierInformationBlock):
observer(EmergePackage(groups[2]), num=groups[0], max_num=groups[1])
+class FetchingTarball(NotifierInformationBlock):
+ """
+ Происходит скачивание архивов
+ """
+ token = "Saving to:"
+ re_block = re.compile("Saving to:\s*(\S+)?")
+
+ def notify(self, observer, groups):
+ observer(groups[0])
+
class InstallingPackage(NotifierInformationBlock):
"""
Запуск устанавливаемого пакета
@@ -447,7 +458,7 @@ class EmergeingErrorBlock(EmergeInformationBlock):
return self.text_converter.transform(readFile(self.result))
def action(self, child):
- raise EmergeError(_("Emerge %s is failed") % self.package)
+ raise EmergeError(_("Failed to emerge %s") % self.package)
class RevdepPercentBlock(NotifierInformationBlock):
@@ -500,8 +511,10 @@ class EmergeParser(object):
self.installing = InstallingPackage(self)
self.uninstalling = UnemergingPackage(self)
self.emerging = EmergingPackage(self)
+ self.fetching = FetchingTarball(self)
self.emerging.add_observer(self.mark_binary)
+ self.emerging.add_observer(self.skip_fetching)
if run:
self.run()
@@ -509,6 +522,9 @@ class EmergeParser(object):
if binary:
self.installing.mark_binary(package)
+ def skip_fetching(self, *argv, **kw):
+ self.fetching.action = lambda child: None
+
def add_element(self, element):
if element.token:
if type(element.token) == list:
@@ -587,6 +603,9 @@ class EmergeCache(object):
'/etc/make.profile'),
Md5Checkvalue('/var/lib/portage/world',
'/var/lib/portage/world_sets')]
+ logger = log("emerge-cache",
+ filename="/var/log/calculate/emerge-cache.log",
+ formatter="%(asctime)s - %(levelname)s - %(message)s")
def __init__(self):
self.files_control_values = {}
@@ -602,14 +621,20 @@ class EmergeCache(object):
f.write('\n')
for pkg in package_list:
f.write("%s\n"% str(pkg))
+ self.logger.info("Setting cache (%d packages)"%len(package_list))
- def drop_cache(self):
+ def drop_cache(self, reason=None):
if path.exists(self.cache_file):
with ignore(OSError):
os.unlink(self.cache_file)
+ self.logger.info("Droping cache. Reason: %s"%reason)
+ else:
+ self.logger.info("Droping empty cache. Reason: %s"%reason)
def get_cached_package_list(self):
self.read_cache()
+ if not path.exists(self.cache_file):
+ self.logger.info("Requesting empty cache")
if self.check_actuality():
return self.pkg_list
return None
@@ -618,7 +643,20 @@ class EmergeCache(object):
"""
Кэш считается актуальным если ни один из файлов не менялся
"""
- return self.get_control_values() == self.files_control_values
+ if self.get_control_values() == self.files_control_values:
+ self.logger.info(
+ "Getting actuality cache (%d packages)" % len(self.pkg_list))
+ return True
+ else:
+ reason = "Unknown"
+ for k,v in self.get_control_values().items():
+ if k in self.files_control_values:
+ if v != self.files_control_values[k]:
+ reason = "%s was modified"%k
+ else:
+ reason = "Checksum of file %s is not exist" % k
+ self.logger.info("Failed to get cache. Reason: %s" % reason)
+ return False
def read_cache(self):
self.files_control_values = {}
diff --git update/package_tools.py update/package_tools.py
index dd86cbd..a99af36 100644
--- update/package_tools.py
+++ update/package_tools.py
@@ -29,6 +29,7 @@ from calculate.lib.utils.files import (getProgPath, STDOUT,
PercentProgress, process, readFile,
readLinesFile)
from calculate.lib.utils.common import cmpVersion
+from calculate.lib.utils.tools import ignore
from contextlib import closing
@@ -140,11 +141,11 @@ class Git:
if path.exists(rpath):
if not path.isdir(rpath):
raise GitError(
- _("Repository {path} is not directory").format(
+ _("Repository {path} is not a directory").format(
path=rpath))
if not path.isdir(self._gitDir(rpath)):
raise GitError(
- _("Repository {path} is not git").format(
+ _("Repository {path} is not Git").format(
path=rpath))
return True
return False
@@ -155,7 +156,7 @@ class Git:
"""
git = getProgPath("/usr/bin/git")
if not git:
- raise GitError(_("Git utility is not found"))
+ raise GitError(_("The Git tool is not found"))
return git
@staticmethod
@@ -191,9 +192,9 @@ class Git:
error = gitClone.read()
if "Remote branch %s not found" % branch in error:
raise GitError(
- _("Branch {branch} not found in {url} repository").format(
+ _("Branch {branch} not found in repository {url}").format(
branch=branch, url=url))
- raise GitError(_("Failed to clone {url} repository").format(
+ raise GitError(_("Failed to clone repository {url}").format(
url=url), error)
return True
@@ -272,7 +273,7 @@ class Git:
if command("get_rev_tag") or command("fetchshallow"):
if not command("has_branch"):
raise GitError(
- _("Branch {branch} not found in {url} repository"
+ _("Branch {branch} not found in repository {url}"
).format(branch=branch, url=url))
# если среди коммитов есть указанный коммит
if command("has_revision"):
@@ -281,7 +282,7 @@ class Git:
return True
elif command("checkout"):
return False
- raise GitError(_("Failed to clone {url} repository").format(
+ raise GitError(_("Failed to clone repository {url}").format(
url=url), error[-1])
def pullRepository(self, rpath, quiet_error=False, cb_progress=None):
@@ -294,7 +295,7 @@ class Git:
if not quiet_error:
error = gitPull.read()
raise GitError(
- _("Failed to update repository in {rpath}").format(
+ _("Failed to update the repository in {rpath}").format(
rpath=rpath), error)
return False
return True
@@ -316,7 +317,7 @@ class Git:
if gitFetch.failed():
error = gitFetch.read()
raise GitError(
- _("Failed to update repository in {rpath}").format(
+ _("Failed to update the repository in {rpath}").format(
rpath=rpath), error)
return True
@@ -332,7 +333,7 @@ class Git:
return not any(x.strip() for x in git_status)
else:
raise GitError(
- _("Wrong repository in {rpath} directory").format(
+ _("Wrong repository in the {rpath} directory").format(
rpath=rpath))
def parseStatusInfo(self, data):
@@ -376,8 +377,7 @@ class Git:
return git_show.read().strip()
else:
raise GitError(
- _("Failed to get status of repository in "
- "{rpath} directory").format(
+ _("Failed to get the repository status for {rpath}").format(
rpath=rpath))
def getStatusInfo(self, rpath):
@@ -395,13 +395,12 @@ class Git:
retDict = self.parseStatusInfo(git_status.read())
if not retDict:
raise GitError(
- _("Failed to get status of repository in "
- "{rpath} directory").format(
+ _("Failed to get the repository status for {rpath}").format(
rpath=rpath))
return retDict
else:
raise GitError(
- _("Wrong repository in {rpath} directory").format(
+ _("Wrong repository in the {rpath} directory").format(
rpath=rpath))
def resetRepository(self, rpath, to_origin=False, to_rev=None, info=None):
@@ -434,7 +433,7 @@ class Git:
rpath,
"clean", "-fd", stderr=STDOUT)
if git_reset.failed() or git_clean.failed():
- raise GitError(_("Failed to clean {rpath} repository").format(
+ raise GitError(_("Failed to clean the {rpath} repository").format(
rpath=rpath))
return True
@@ -456,11 +455,11 @@ class Git:
error = git_checkout.read()
if "pathspec '%s' did not match" % branch in error:
raise GitError(
- _("Branch {branch} not found in {rpath} repository").format(
+ _("Branch {branch} not found in repository {rpath}").format(
branch=branch, rpath=rpath))
raise GitError(
- _("Failed to change branch to {branch} in "
- "{rpath} repository").format(branch=branch,
+ _("Failed to change branch to {branch} in the {rpath} "
+ "repository").format(branch=branch,
rpath=rpath), error)
return True
@@ -600,16 +599,18 @@ class PackageInformation:
pkg_list = "|".join(
[x['CATEGORY/PN'].replace("+", r"\+") for x in self.query_packages])
output = pexpect.spawn(self.eix_cmd, ["--xml", pkg_list]).read()
- xml = ET.fromstring(output)
- for pkg in self.query_packages:
- cat_pn = pkg['CATEGORY/PN']
- if not cat_pn in self.information_cache:
- descr_node = xml.find(
- 'category[@name="%s"]/package[@name="%s"]/description'
- % (pkg['CATEGORY'], pkg['PN']))
- if descr_node is not None:
- self.information_cache[cat_pn]['DESCRIPTION'] = \
- descr_node.text
+ re_cut = re.compile("^.*?(?=<\?xml version)",re.S)
+ with ignore(ET.ParseError):
+ xml = ET.fromstring(re_cut.sub('',output))
+ for pkg in self.query_packages:
+ cat_pn = pkg['CATEGORY/PN']
+ if not cat_pn in self.information_cache:
+ descr_node = xml.find(
+ 'category[@name="%s"]/package[@name="%s"]/description'
+ % (pkg['CATEGORY'], pkg['PN']))
+ if descr_node is not None:
+ self.information_cache[cat_pn]['DESCRIPTION'] = \
+ descr_node.text
while self.query_packages:
self.query_packages.pop()
diff --git update/update.py update/update.py
index 2f867f4..2f28776 100644
--- update/update.py
+++ update/update.py
@@ -36,6 +36,7 @@ from calculate.lib.utils.files import (getProgPath, STDOUT, removeDir,
from calculate.lib.cl_lang import (setLocalTranslate, getLazyLocalTranslate,
RegexpLocalization, _)
import emerge_parser
+import logging
from emerge_parser import EmergeParser, EmergeCommand, EmergeError, EmergeCache
setLocalTranslate('cl_update3', sys.modules[__name__])
@@ -56,6 +57,8 @@ class Update:
emerge_parser.CommandExecutor.logfile = commandLog
self.color_print = get_color_print()
self.emerge_cache = EmergeCache()
+ if self.clVars.Get('cl_env_debug_set') == 'off':
+ EmergeCache.logger.logger.setLevel(logging.WARNING)
self.emerge_cache.check_list = (
self.emerge_cache.check_list +
map(emerge_parser.GitCheckvalue,
@@ -116,7 +119,7 @@ class Update:
raise UpdateError(_("Update is already running. "
"Try to run later."))
else:
- self.startTask(_("Waiting for complete another update"))
+ self.startTask(_("Waiting for another update to be complete"))
while any(ifilter(lambda x: os.getpid() != x,
search_worked_process('update', dv))):
time.sleep(0.3)
@@ -133,8 +136,8 @@ class Update:
"cl_update_rep_rev", "cl_update_branch_name"],
where="cl_update_rep_name", eq=repname, limit=1))
if not url or not rpath:
- raise UpdateError(_("Variables with repositories settings "
- "is not configured"))
+ raise UpdateError(_("Configuration variables for repositories "
+ "are not setup"))
self.addProgress()
if clean_on_error:
try:
@@ -148,7 +151,7 @@ class Update:
self.printWARNING(str(e))
self.endTask(False)
self.startTask(
- _("Re-fetch {name} repository").format(name=repname))
+ _("Re-fetching the {name} repository").format(name=repname))
self.addProgress()
try:
rpath_new = "%s_new" % rpath
@@ -157,7 +160,7 @@ class Update:
removeDir(rpath)
os.rename(rpath_new, rpath)
except OSError:
- raise UpdateError(_("Permission denied to change "
+ raise UpdateError(_("Permission denied to modify the "
"{repname} repository").format(
repname=repname))
finally:
@@ -179,7 +182,7 @@ class Update:
"""
layman = getProgPath('/usr/bin/layman')
if not layman:
- raise UpdateError(_("Layman utility is not found"))
+ raise UpdateError(_("The Layman tool is not found"))
rpath = self.clVars.Select('cl_update_other_rep_path',
where='cl_update_other_rep_name', eq=repname,
limit=1)
@@ -193,7 +196,7 @@ class Update:
p = process(layman, "-s", repname, stderr=STDOUT)
if p.failed():
raise UpdateError(
- _("Failed to update repository {rname}").format(rname=repname),
+ _("Failed to update the {rname} repository").format(rname=repname),
addon=p.read())
return True
@@ -203,12 +206,12 @@ class Update:
"""
egenCache = getProgPath('/usr/bin/egencache')
if not egenCache:
- raise UpdateError(_("Portage utility is not found"))
+ raise UpdateError(_("The Portage tool is not found"))
cpu_num = self.clVars.Get('hr_cpu_num')
p = process(egenCache, "--repo=%s" % repname, "--update",
"--jobs=%s" % cpu_num, stderr=STDOUT)
if p.failed():
- raise UpdateError(_("Failed to update cache of {rname} "
+ raise UpdateError(_("Failed to update the cache of the {rname} "
"repository").format(rname=repname),
addon=p.read())
return True
@@ -219,7 +222,7 @@ class Update:
"""
emerge = getProgPath("/usr/bin/emerge")
if not emerge:
- raise UpdateError(_("Emerge utility is not found"))
+ raise UpdateError(_("The Emerge tool is not found"))
self.addProgress()
p = PercentProgress(emerge, "--metadata", part=1, atty=True)
for perc in p.progress():
@@ -238,7 +241,7 @@ class Update:
"""
eixupdate = getProgPath("/usr/bin/eix-update")
if not eixupdate:
- raise UpdateError(_("Eix utility is not found"))
+ raise UpdateError(_("The Eix tool is not found"))
self.addProgress()
excludeList = []
if self.clVars.Get('cl_update_eixupdate_force') == 'force':
@@ -284,12 +287,10 @@ class Update:
"""
self.endTask()
_print = self.color_print
- if max_num > 1:
- one = _print.foreground(Colors.YELLOW).bold("{0}", num)
- two = _print.foreground(Colors.YELLOW).bold("{0}", max_num)
- part = " (%s of %s)" % (one, two)
- else:
- part = ""
+ one = _print.bold("{0}", num)
+ two = _print.bold("{0}", max_num)
+ part = _(" ({current} of {maximum})").format(current=one,
+ maximum=two)
if self.is_binary_pkg(pkg,binary):
_print = _print.foreground(Colors.PURPLE)
else:
@@ -312,19 +313,24 @@ class Update:
self.startTask(_("Installing %s") %
_print(str(pkg)))
+ def _printFetching(self, fn):
+ """
+ Вывод сообщения о скачивании
+ """
+ self.endTask()
+ self.startTask(_("Fetching binary packages"))
+
+
def _printUninstallPackage(self, pkg, num=1, max_num=1):
"""
Вывод сообщения удаления пакета
"""
self.endTask()
_print = self.color_print
- if max_num > 1:
- one = _print.foreground(Colors.YELLOW).bold("{0}", num)
- two = _print.foreground(Colors.YELLOW).bold("{0}", max_num)
- part = _(" ({current} of {maximum})").format(current=one,
- maximum=two)
- else:
- part = ""
+ one = _print.bold("{0}", num)
+ two = _print.bold("{0}", max_num)
+ part = _(" ({current} of {maximum})").format(current=one,
+ maximum=two)
_print = _print.foreground(Colors.RED)
self.startTask(
@@ -337,7 +343,7 @@ class Update:
"""
cmd_path = getProgPath(cmd)
if not cmd_path:
- raise UpdateError(_("Failed to find %s command") % cmd)
+ raise UpdateError(_("Failed to find the %s command") % cmd)
with EmergeParser(
emerge_parser.CommandExecutor(cmd_path, params)) as emerge:
self._startEmerging(emerge)
@@ -349,7 +355,7 @@ class Update:
"""
cmd_path = getProgPath(cmd)
if not cmd_path:
- raise UpdateError(_("Failed to find %s command") % cmd)
+ raise UpdateError(_("Failed to find the %s command") % cmd)
with EmergeParser(
emerge_parser.CommandExecutor(cmd_path, params)) as emerge:
revdep = RevdepPercentBlock(emerge)
@@ -409,7 +415,7 @@ class Update:
self._display_pretty_package_list(pkglist)
if emerge.install_packages.remove_list:
self.printSUCCESS(_print(
- _("List removal packages")))
+ _("Listing packages for removal")))
self._display_pretty_package_list(
emerge.install_packages.remove_list, remove_list=True)
if str(emerge.download_size) != "0 kB":
@@ -427,7 +433,7 @@ class Update:
_print = self.color_print
pkglist = emerge.uninstall_packages.list
self.printSUCCESS(_print.bold(
- _("List removal packages")))
+ _("Listing packages for removal")))
self._display_pretty_package_list(pkglist, remove_list=True)
def getCacheOnWorld(self, params, packages, check=False):
@@ -439,7 +445,8 @@ class Update:
elog = EmergeLog(
EmergeLogNamedTask(ClUpdateAction.log_names['premerge']))
if check and (elog.list or elog.remove_list):
- self.emerge_cache.drop_cache()
+ self.emerge_cache.drop_cache(
+ "Some packages was installed or removed")
return params, packages
installed_pkgs = elog.list
new_packages = self.emerge_cache.get_cached_package_list()
@@ -475,7 +482,8 @@ class Update:
emerge.run()
if "@world" in packages:
if emerge.install_packages.remove_list:
- self.emerge_cache.drop_cache()
+ self.emerge_cache.drop_cache(
+ "List has packages for remove")
else:
self.updateCache(emerge.install_packages.list)
if not emerge.install_packages.list:
@@ -483,7 +491,7 @@ class Update:
return True
self._display_install_package(emerge)
except EmergeError:
- self.emerge_cache.drop_cache()
+ self.emerge_cache.drop_cache("Emerge error")
self.printPre(self._emerge_translate(emerge.prepare_error))
raise
if self.clVars.Get('cl_update_pretend_set') == 'on':
@@ -516,10 +524,11 @@ class Update:
emerge.emerging.add_observer(self._printEmergePackage)
emerge.installing.add_observer(self._printInstallPackage)
emerge.uninstalling.add_observer(self._printUninstallPackage)
+ emerge.fetching.add_observer(self._printFetching)
try:
emerge.run()
except EmergeError:
- self.emerge_cache.drop_cache()
+ self.emerge_cache.drop_cache("Emerge error")
if emerge.emerging_error:
self.printPre(
self._emerge_translate(emerge.emerging_error.log))
@@ -547,7 +556,7 @@ class Update:
if not emerge.install_packages.list:
return True
except EmergeError:
- self.emerge_cache.drop_cache()
+ self.emerge_cache.drop_cache("Emerge error")
self.printPre(self._emerge_translate(emerge.prepare_error))
raise
self._startEmerging(emerge)
diff --git update/utils/cl_update.py update/utils/cl_update.py
index 2ac2c36..a58c827 100644
--- update/utils/cl_update.py
+++ update/utils/cl_update.py
@@ -51,8 +51,7 @@ class ClUpdateAction(Action):
return func
def pkg_color(text):
- _print = get_color_print()
- return _print.bold.foreground(Colors.BLUE)(text)
+ return text
log_names = {'premerge': "check updates",
'python_updater': "update python modules",
@@ -151,7 +150,7 @@ class ClUpdateAction(Action):
]
},
{'name': 'update_other:depclean',
- 'group': __("Cleaning system from needless packages"),
+ 'group': __("Cleaning the system from needless packages"),
'tasks': [
{'name': 'update_other:update_depclean',
'message': __("Calculating dependencies"),
@@ -209,19 +208,19 @@ class ClUpdateAction(Action):
'tasks': [
{'name': 'sync_reps',
'foreach': 'cl_update_sync_rep',
- 'message': __("Syncing {eachvar:capitalize} repository"),
+ 'message': __("Syncing the {eachvar:capitalize} repository"),
'method': 'Update.syncRepositories(eachvar)',
'condition': lambda Get: Get('cl_update_sync_rep')
},
{'name': 'sync_other_reps',
'foreach': 'cl_update_other_rep_name',
- 'message': __("Syncing {eachvar:capitalize} repository"),
+ 'message': __("Syncing the {eachvar:capitalize} repository"),
'method': 'Update.syncLaymanRepository(eachvar)',
'condition': lambda Get: Get('cl_update_other_set') == 'on'
},
{'name': 'sync_reps:regen_cache',
'foreach': 'cl_update_sync_overlay_rep',
- 'message': __("Updating {eachvar:capitalize} repository cache"),
+ 'message': __("Updating the {eachvar:capitalize} repository cache"),
'essential': False,
'method': 'Update.regenCache(eachvar)',
'condition': (
@@ -231,12 +230,12 @@ class ClUpdateAction(Action):
},
{'name': 'sync_other_reps:regen_other_cache',
'foreach': 'cl_update_other_rep_name',
- 'message': __("Updating {eachvar:capitalize} repository cache"),
+ 'message': __("Updating the {eachvar:capitalize} repository cache"),
'method': 'Update.regenCache(eachvar)',
'essential': False,
},
{'name': 'emerge_metadata',
- 'message': __("Metadata trasfer"),
+ 'message': __("Metadata transfer"),
'method': 'Update.emergeMetadata()',
'condition': (
lambda Get: (Get('cl_update_outdate_set') == 'on' and
@@ -244,7 +243,7 @@ class ClUpdateAction(Action):
Get('cl_update_metadata_force') == 'force'))
},
{'name': 'eix_update',
- 'message': __("Updating eix cache"),
+ 'message': __("Updating the eix cache"),
'method': 'Update.eixUpdate()',
'condition': (
lambda Get: (Get('cl_update_outdate_set') == 'on' and
diff --git update/variables/update.py update/variables/update.py
index 01eedf8..1c22e5c 100644
--- update/variables/update.py
+++ update/variables/update.py
@@ -74,8 +74,8 @@ class VariableClUpdateRevSet(Variable):
"cl_update_eixupdate_force"]
def init(self):
- self.help = _("revision update")
- self.label = _("Revision update")
+ self.help = _("make a revision update")
+ self.label = _("Make a revision update")
class VariableClUpdateRep(Variable):
"""
@@ -122,7 +122,7 @@ class VariableClUpdateSystemProfile(ReadonlyVariable):
path.join(path.dirname(make_profile),
os.readlink(make_profile)))
except:
- raise VariableError(_("Failed to determine system profile"))
+ raise VariableError(_("Failed to determine the system profile"))
class VariableClUpdateLaymanStorage(ReadonlyVariable):
"""
@@ -239,8 +239,8 @@ class VariableClUpdateSyncRep(Variable):
untrusted = True
def init(self):
- self.help = _("synchronize repositories (all by default)")
- self.label = _("Synchronize repositories")
+ self.help = _("synchronized repositories (all by default)")
+ self.label = _("Synchronized repositories")
def set(self,value):
orderList = self.Get('cl_update_rep_name')
@@ -288,15 +288,15 @@ class VariableClUpdateMetadataForce(Variable):
#untrusted = True
def init(self):
- self.help = ("'force' - " + _("force update ebuilds metadata") +
- ",\n'skip' - " + _("skip update ebuilds metadata") +
- ",\n'auto' - " + _("update metadata if they are outdated"))
+ self.help = ("'force' - " + _("force the update ebuilds metadata") +
+ ",\n'skip' - " + _("skip the ebuild metadata update") +
+ ",\n'auto' - " + _("update metadata if it is outdated"))
self.label = _("Update metadata")
def choice(self):
return [("force", _("Force")),
("skip", _("Skip")),
- ("auto", _("By need"))]
+ ("auto", _("If needed"))]
class VariableClUpdateEixupdateForce(Variable):
"""
@@ -310,15 +310,16 @@ class VariableClUpdateEixupdateForce(Variable):
#untrusted = True
def init(self):
- self.help = ("'force' - " + _("force update eix cache") +
- ",\n'skip' - " + _("skip update eix cache") +
- ",\n'auto' - " + _("update eix cache if it is outdated"))
- self.label = _("Update eix cache")
+ self.help = ("'force' - " + _("force the eix cache update") +
+ ",\n'skip' - " + _("skip the eix cache update") +
+ ",\n'auto' - " + _("update the eix cache if it "
+ "is outdated"))
+ self.label = _("Update the eix cache")
def choice(self):
return [("force", _("Force")),
("skip", _("Skip")),
- ("auto", _("By need"))]
+ ("auto", _("If needed"))]
class VariableClUpdateOtherSet(Variable):
"""
@@ -389,9 +390,10 @@ class VariableClUpdatePretendSet(Variable):
opt = ["-p", "--pretend"]
def init(self):
- self.label = _("Pretend package update")
- self.help = _("instead of actually performing packages update, "
- "simply only display what have been installed")
+ self.label = _("Pretend a package update")
+ self.help = _("instead of actually performing the update, "
+ "simply display the list of packages that "
+ "will be installed")
class VariableClUpdateSyncOnlySet(Variable):
"""
@@ -399,7 +401,7 @@ class VariableClUpdateSyncOnlySet(Variable):
"""
type = "bool"
value = "off"
- opt = ["-s","--sync-only"]
+ opt = ["-s", "--sync"]
def init(self):
self.label = _("Only synchronize repositories")
@@ -423,5 +425,5 @@ class VariableClUpdateWaitAnotherSet(Variable):
opt = ["--wait-another-update"]
def init(self):
- self.label = _("Wait for complete another update")
- self.help = _("wait until the other updates or abort")
+ self.label = _("Wait for another update to be complete")
+ self.help = _("wait until the running update is finished")
diff --git update/wsdl_update.py update/wsdl_update.py
index 10ec376..9bd535e 100644
--- update/wsdl_update.py
+++ update/wsdl_update.py
@@ -39,7 +39,7 @@ class Wsdl(WsdlBase):
# категория метода
'category': __('Update'),
# заголовок метода
- 'title': __("Update System"),
+ 'title': __("Update the System"),
# иконка для графической консоли
'image': 'software-properties,preferences-desktop',
# метод присутствует в графической консоли
@@ -60,7 +60,7 @@ class Wsdl(WsdlBase):
'setvars': {'cl_action!': 'sync'},
# описание груп (список лямбда функций)
'groups': [
- lambda group: group(_("Update system"),
+ lambda group: group(_("Update the system"),
normal=(),
expert=(
'cl_rebuild_world_set', 'cl_update_rev_set',

@ -1,4 +1,5 @@
EBUILD calculate-utilities-3.2.0_alpha10-r1.ebuild 842 SHA256 44749a0235d8542111cc94a2fcab68c0a3f9f8525ed386562ae3f16a05c74748 SHA512 257062e73d4656c78182c46c333cd13abae9e8bb4e4b2706557a9e9090ce221ef571d3b4f82515354b70efb68b588b33d1c9981c12d181514436b1a95ced715c WHIRLPOOL 248419a891dfb6a57a54b598685c03c0ce3940deb76336b85e188dec884dfda850530598f2bc7b91516a413790ec09f673c89aec6eebf84e027a5fd959f2b1d4
EBUILD calculate-utilities-3.2.0_alpha10-r10.ebuild 842 SHA256 5f57673b7d8fb4092e79ef4aadf9fa49848c8921a76aaa57b8f9d86de9197e20 SHA512 d5c87599fe58b8c457c2d37a142582e8d822010afcdecb284e71d71dca71fb704d2b2ee473c742ea8ad168b34dd7c6a044e70bfe87ca572532eeb6b8e0184665 WHIRLPOOL 1a9040177ad6daddd082c7a2d651da2d5646acfb3ced2140b2655547fca645c22bfb15744407ad39894fcdd778525569b897188866965b2e3d52e1ab37cfe130
EBUILD calculate-utilities-3.2.0_alpha10-r2.ebuild 842 SHA256 62a6fa86d44b51242d08753510c382076378aeaaba1b927f322d06fa0b17bca0 SHA512 5a39b25013adfe53d1d50efa87354308b384e956aff0a3a2b7072345df7b9c67d2642666a9dae2ccd77406870161ff88c150cf07eedacd9a6b541631d11de940 WHIRLPOOL 66ecd6e470ad72a7643227deba42125baa8ee72bfa67c7e4fbed71b6095c10a51ea601045f66f8612404cef60cdeb77372eb63a6a0cf932cfab759fd5d09cd6e
EBUILD calculate-utilities-3.2.0_alpha10-r3.ebuild 842 SHA256 5e86b76bac016fb80d9e8ea2f87f2e3281b15e66f30db317dc0f4c13194df150 SHA512 37c86dd04ef452ac88ea65fb0c978a7ce71461d20bcd90d6f492f0a063f2535510f6f33cd3d7331961b6857b699b24e15264356ec38e2c6192fdd993d8328d66 WHIRLPOOL bd3ecf0452354e0e2bf27d3d169885ab2940d7a196a85551d71c2f9607e19177e7cc867324fed824c4ac0c7fb534fbf3a4d90a361de86162e2b82ee676f17d97
EBUILD calculate-utilities-3.2.0_alpha10-r4.ebuild 842 SHA256 784b3b5e67ff3615090ea96c8b85b558bd8dbef4d1fabdcba58d5d5ff1139d52 SHA512 2d93039b127c977541a955a69a22ebdc3cb965489c75e6e125f8356fcafc1e934c2a8cc21ffe8ad8f75db26971b79adac8e25c13007b39d5ebecaee2dde78115 WHIRLPOOL caff4b42d86c465e5271099f2adf3b7347a62868e8828465922b0e6b09189f6787dcf5f4ee6f262787650ee5ee76e7317b5f147909e59c6230fc7fb6394516ed

@ -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_alpha10-r1
=sys-apps/calculate-i18n-3.2.0_alpha10-r4
=sys-apps/calculate-lib-3.2.0_alpha10-r5
=sys-apps/calculate-core-3.2.0_alpha10-r5
=sys-apps/calculate-update-3.2.0_alpha10-r7
cl_client? ( =sys-apps/calculate-client-3.2.0_alpha10-r1 )
cl_desktop? ( =sys-apps/calculate-desktop-3.2.0_alpha10 )
cl_consolegui? ( =sys-apps/calculate-console-gui-3.2.0_alpha10 )
cl_console? ( =sys-apps/calculate-console-3.2.0_alpha10-r1 )
"
Loading…
Cancel
Save