Add -l for cl-desktop

atratsevskiy
parent 8233c5140b
commit 8173aaa221

@ -9,6 +9,7 @@ AUX calculate-core-3.1.1_alpha2-r3.patch 2215 SHA256 c9c3e11c4e3136df2d9d0881d7a
AUX calculate-core-3.1.1_alpha2-r4.patch 4831 SHA256 b2bc44a819aae02db4d91f46c8456c733b729b34e7d64354c37cd0239d861cec SHA512 dc87463b066553f355222f14b440b3fbc624f69389822e978cfcd86a6292b9eab3c43f6419df47781f637e2bc785f4ee766a3ccc6f5d65c013c8337cf9e39aeb WHIRLPOOL bcf653e7776ff0bed4b23a9e6f0bf779187366ada6f19414e4b3a632992283c5caa8eea573cccd669223d8d9afefe769a71bf0e129b059f2537984e73e1d7c1d
AUX calculate-core-3.1.1_alpha2-r5.patch 7771 SHA256 66c7b3db36ffffdc47dff3cbcda63cf9223981caa615a636aaa0cc0d3193ae60 SHA512 db34d15e69e25f1a7c0830efcbfcff4049feee86aafeabb8858981d9b8f46e8ac174296d8697d6ce778848fe995625c0e7bdf277dee9629091ff20593a75c82f WHIRLPOOL 98935f89544fa40b0f6a3cd0332581ecb6b2b7c1211c1cf5de7a701ee9d1647880a3ab166c35e369ee59ab3e1b9bec21af929dd0d68ee424347b51aa430e111e
AUX calculate-core-3.1.1_alpha2-r6.patch 7992 SHA256 9b73698db6c6e48064cd2430ae1bdadfb70c36b0e0f82f7af367542997ae29af SHA512 206de90345a28beedd51e2521758dba5f19918a1659543743f08f76cbca282969ecbe24a821e6ad390ee02b0cb10b1ec90de39c5168059e3517bcb99704cd02a WHIRLPOOL 4a114f822bd543a3f056ec89fbf5439ba47d57e6a83a3bcfdb4bcb74005b3ce7f14c53f63a5f370bf3b5f7e7af4f56fb393ced57aaa6004851e4462bd2c5aaa8
AUX calculate-core-3.1.1_alpha2-r7.patch 8446 SHA256 7e324b364c51ad55467ab3b8074c049c94823d095ecf8c3fe2d467f16ce58a62 SHA512 e80eab4c04582654f46ced3e8d0fd6ec037221c9e1a991454079638c159e7aae8f714a4e68a5f59521bb67ca03136db813b6328ddd531ad0b648b4146db4d83a WHIRLPOOL eb951584e30eb6999d523f45da7aa89396ba3d37fecf31428227298be5736cdea20997ca0a9f7245c413876f718a810b59c7e5030bf69ac4d1da105f2b33d041
DIST calculate-core-3.0.0.tar.bz2 86337 SHA256 ee2df2b93a1bd824e94d7179ef15478ae5b15de7d48f29752eb332f247bfc054 SHA512 60b1fc54ba5ee5b07586b2d2fe900f4e51a0c6966366b0750823185bacd965ed9ee3eebeb2dc7c220aef8fe8271585616acfb22926edb6f779c0829e7bada2ed WHIRLPOOL b3e4413d4bbbbfa1f74887179639fe1291cca0adf2968e2fd5198364e97da7f3ee83a51efa6f22bcd83e55970ab743dcb2d539b5979bb52cadca982af54fa2d2
DIST calculate-core-3.0.1.tar.bz2 86674 SHA256 0e690bd85973831c2aeddcc002f3ed1fe6bd5533f367e48decf512e429cc790a SHA512 24df3e8eaef57748d24156d7b15ba85bcfe1ecb888a052c1b86f71cf25b51330f64df68369dff48040d8779e40d036115eb20c645fee1c5017f3b68b0aa9fc36 WHIRLPOOL b5ce9efbb10e534928c465a6f44065618eeca48c6c024353331993c713c2bf1e124c9b2b1eec01ae36fe5f24700bc43429cf8060ea45b94f54ecfe8da61e0f60
DIST calculate-core-3.0.2.tar.bz2 86741 SHA256 f35bfe8e34df9ad9c07ac7d281b2b6a593acf00faa38a1221229164406587993 SHA512 cd44a055fe17529f7996f8dd26106aed29488db36313b027a2dcd43c57fad999e7d53f24802da1b3f449a0b79fdc19a7d1e245eb9415d8ed2ee02a7e7984ee5c WHIRLPOOL 3992697faa72dd40710b06646e8a9cbf12eea92c4f2c6c609355769ec4a353696231d42b248f211177711bf8bf2109f431c22ce5b92ddd31841d5c1136fbc324
@ -45,6 +46,7 @@ EBUILD calculate-core-3.1.1_alpha2-r3.ebuild 1212 SHA256 36a57498d6d0c80c1a45036
EBUILD calculate-core-3.1.1_alpha2-r4.ebuild 1212 SHA256 91d69be135d7ad15044b0d6411b183cc8ef896b05a8575bd0d6e1dd9e6c63270 SHA512 7c8a2c0bd6e4cd1841465ceffd53a745bb7d50e487a981362c18f38495b9ea0a87925fa4e90a958dbe249d827d20e90fc74bc9fb71f1db2fd7774fc27809bf99 WHIRLPOOL 3b9a2435c7c73619140313bce5b585293aab9dfda002d90b2ff2984a48f5b72ee266c94b91c197b64b180095e70a46f8ddf22dd49ab7f9eb34885faa1eb92f3d
EBUILD calculate-core-3.1.1_alpha2-r5.ebuild 1212 SHA256 c257e81fc4f9b998634879b6ba490af989503c17b7e902a043de73f9d5cde379 SHA512 7d6c2d04928943feb43c506030fc1cf49db18b1913b06b00772de216bae75977564b141658f7387db77ede4af0fde21c06ec29845adf571fe37fb3ca9084a385 WHIRLPOOL 5abe2a9fdf326dc5b42cfcda3dc6962094cd2f254da83056a72ae0200c78a8d580d95fa05b99626bca07c82f9edd70cd4f6f25a061f80ba7c3e2451cb94b04e0
EBUILD calculate-core-3.1.1_alpha2-r6.ebuild 1212 SHA256 ca10f872e5faa941b6bb5599ecf8f71787c9cddf975ed0b8b058826a5dcef5ae SHA512 090fa929b6a8f6110a79343e6a09e7621e00f00e830d0a566054bee710f9eb389d783cea44298043d59c7fc5e1d7b78559185faf764dece3bac57c4686bdb486 WHIRLPOOL e7869c56cbc959aaa0d2dbe1c60a7923d129dfde6e9ae67dedbe8272d29d3be7126f3eaf3ba9b8fb5ba062f8cff82649d5b835deabd79cc1a687148868d4e0d9
EBUILD calculate-core-3.1.1_alpha2-r7.ebuild 1212 SHA256 5dd5c14a50b41af632297f93dbc3fa6000ee4d89cb1363bd3c784b6d39ae328a SHA512 fb8cdbe333ae54c21b2e4c07d3d0283637a9283b881ee90b77d459b8cb2d2ad4a65a1dd380cbcc283f96d1f7e8f62ce267257149d512c0b4f43061f779fa726e WHIRLPOOL 242b85753da649c6d2ba209dc5d71ba85d5029b33a125f769f61050c5db13f1bbaac9a49bd3c962491870755890db175d4d598a995341e44d30b972c0ab766d0
EBUILD calculate-core-3.1.1_alpha2.ebuild 1071 SHA256 2d8f835b81768187442240c6ec1ab426ad1288325e6b20c9eb326060eaa0f171 SHA512 076cc552109b6f1957ce6d398d6f3f135b1f29a5846a6a0d89ef4a7f87a9ea63530711e144eee15a726cd16018810957f12ae1b75efc03a60baa95664fdc3a9a WHIRLPOOL 1226109eeb069833f5ca872ce46f24879c5a8ec6d4d7f3ce82bdb60d0dc2e19529980bb38e9872042ad96da8aa32253e78d6b7630c75450f509d6d473aa7f1c4
EBUILD calculate-core-3.1.9999.ebuild 656 SHA256 475e34d10141354a4c60e029fc1cb74b080c3a1371d9e1e44a5e2936b7130ed4 SHA512 9ba865c5effa56079a3841a96d1a4a89d4bbc27e092042aa4a87d1b4ecde9d3a690c92c73e10b330724258aaf3138d2a58d50d18d2fbea9e657c3c5d2f8395ee WHIRLPOOL 89d3bcc657324d1ffb4265eab3e28e94e3d00fb7530c6654e75b52fe002d70f72998930729cfe3320a3ff571277e6e59c649b0df2fe071bcd9b050f9d42608eb
MISC ChangeLog 382 SHA256 ce74a6d08ec1ea80ee021f5378f705102435abfcd5304d851c3f7932a967065e SHA512 f5531edead30072e8fb8f278cad1d265762b8ecdf146b86cf514704f373f2bd8068b3ed35e68186687f83129814b73c6269024d442fb592515c72a9d0e6d3ca1 WHIRLPOOL 48571b2986c2f8797109a3a3440a43f4f87b601e8e52bd41a470bd077b37eb2b6118e6baf86179df065aa2e4a840d9501b2b2455b990a19dfaa2d4ee7784c922

@ -0,0 +1,49 @@
# 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=""
IUSE="minimal"
DEPEND="~sys-apps/calculate-lib-3.1.1_alpha2
>=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
}
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.1.1_alpha2-r7.patch"
}

@ -0,0 +1,200 @@
diff --git core/server/methods_func.py core/server/methods_func.py
index 59d1b5e..16b66b5 100644
--- core/server/methods_func.py
+++ core/server/methods_func.py
@@ -204,6 +204,8 @@ def get_method_argparser(view, args, cl_core = False):
else field.name.upper()
#if ':' in data['metavar']:
# data['metavar'] = field.name.upper()
+ if field.element in ['check']:
+ data['metavar'] = "ON/OFF"
try:
opts = filter(None,[opt.shortopt,opt.longopt])
if any(not "-" in x for x in opts):
diff --git core/server/replace_class.py core/server/replace_class.py
index 18f241f..d476d06 100644
--- core/server/replace_class.py
+++ core/server/replace_class.py
@@ -421,7 +421,6 @@ def call_method(metaObject, args, unknown_args, colorPrint):
try:
args, unknown_args = method_parser.parse_known_args(unknown_args)
except SystemExit as e:
- print str(e)
return 1
except Exception as e:
import traceback
diff --git core/server/setup_package.py core/server/setup_package.py
index 2111b8d..cb9838e 100644
--- core/server/setup_package.py
+++ core/server/setup_package.py
@@ -41,9 +41,10 @@ from calculate.lib import datavars
from calculate.lib.utils.files import (runOsCommand,scanDirectory,
pathJoin,readFile)
from calculate.lib.utils.common import getPasswdUsers,getTupleVersion
-from calculate.lib.utils.portage import isPkgInstalled
+from calculate.lib.utils.portage import isPkgInstalled,reVerSplitToPV
from calculate.lib.utils.content import getCfgFiles,PkgContents
import pwd
+import glob
from calculate.lib.utils.files import getModeFile
import calculate.lib.cl_template as cl_template
@@ -184,7 +185,15 @@ class updateUserConfigs(shareUpdateConfigs):
clVars.Set("cl_root_path", '/', True)
clVars.Set("ur_login", userName, True)
clVars.Set("cl_action", "desktop", True)
- clVars.Set("cl_merge_pkg", [nameProgram], True)
+ if nameProgram == "all":
+ clVars.Set("cl_merge_pkg",
+ map(lambda x:"{CATEGORY}/{PN}".format(**x),
+ filter(None,
+ map(reVerSplitToPV,
+ glob.glob('/var/db/pkg/*/*')))),
+ True)
+ else:
+ clVars.Set("cl_merge_pkg", ["%s/%s"%(category,nameProgram)], True)
clTempl = ChainProgressTemplate( self.startTask,
self.endTask,
self.setProgress,
@@ -350,7 +359,15 @@ class updateSystemConfigs(shareUpdateConfigs):
clVars.Set("cl_root_path", configPath, True)
if variables.Get('cl_core_pkg_root_set') == 'on':
clVars.Set("cl_root_path_next", '/', True)
- clVars.Set("cl_merge_pkg", [nameProgram], True)
+ if nameProgram == "all":
+ clVars.Set("cl_merge_pkg",
+ map(lambda x:"{CATEGORY}/{PN}".format(**x),
+ filter(None,
+ map(reVerSplitToPV,
+ glob.glob('/var/db/pkg/*/*')))),
+ True)
+ else:
+ clVars.Set("cl_merge_pkg", ["%s/%s"%(category,nameProgram)], True)
clVars.Set("cl_action", 'merge', True)
configFiles = []
nameProg = clVars.Get("cl_name")
@@ -377,12 +394,12 @@ class updateSystemConfigs(shareUpdateConfigs):
# fix CONTENTS pkg file
cfgs = getCfgFiles()
autoUpdateDict = {}
- for pkg in clTempl.changedFiles.getPkgs():
+ for pkg in list(set(clTempl.changedFiles.getPkgs()|
+ set(["%s/%s"%(category,nameProgram)]))):
category = isPkgInstalled(pkg)
if category:
- category = category[0].rpartition('/')[2]
pkgContents = PkgContents("{CATEGORY}/{PF}".format(
- **isPkgInstalled("%s/%s"%(category,pkg))[0]))
+ **category[0]))
for filename,action in clTempl.changedFiles.getPkgFiles(pkg):
if filename in clTempl.protectedFiles:
pkgContents.removeObject(filename)
@@ -456,7 +473,7 @@ class updateSystemConfigs(shareUpdateConfigs):
self.copyConfigFiles(configPath,variables.Get('cl_config_protect'))
if clTempl and clTempl.getWarning():
for warn in clTempl.getWarning().split("\n"):
- self.SUCCESS(warn)
+ self.WARNING(warn)
return True
class PackageUpdater(updateSystemConfigs,updateUserConfigs):
diff --git core/variables/certificate.py core/variables/certificate.py
index df3468a..32aefbe 100644
--- core/variables/certificate.py
+++ core/variables/certificate.py
@@ -22,7 +22,11 @@
from calculate.lib.datavars import Variable,ReadonlyVariable,VariableError
import os, glob, sys
from os import path
-import OpenSSL
+
+try:
+ import OpenSSL
+except:
+ OpenSSL = None
from calculate.lib.cl_lang import setLocalTranslate
from calculate.lib.utils.files import readLinesFile
@@ -222,6 +226,8 @@ class VariableClCertGroups(Variable):
data_path = self.Get('cl_core_data')
cert_dir = os.path.join(data_path, 'client_certs')
cert_file = os.path.join(cert_dir, '%s.crt' %cert_id)
+ if OpenSSL is None:
+ return []
try:
cert = open(cert_file, 'r').read()
diff --git core/variables/request.py core/variables/request.py
index d008fdd..6e90fe3 100644
--- core/variables/request.py
+++ core/variables/request.py
@@ -21,7 +21,10 @@
from calculate.lib.datavars import Variable,ReadonlyVariable,VariableError
import os, glob, sys
-import OpenSSL
+try:
+ import OpenSSL
+except:
+ OpenSSL = None
from calculate.lib.cl_lang import setLocalTranslate
from calculate.lib.utils.files import readLinesFile
@@ -151,7 +154,7 @@ class VariableClReqData(Variable):
data_path = self.Get('cl_core_data')
req_file = data_path + '/client_certs/%s.csr' %req_id
- if os.path.exists(req_file):
+ if OpenSSL and os.path.exists(req_file):
fp = open(req_file, 'r')
request = fp.read()
fp.close()
@@ -279,6 +282,8 @@ class VariableClReqGroup(Variable):
data_path = self.Get('cl_core_data')
cert_file = data_path + '/client_certs/%s.crt' %req_id
+ if OpenSSL is None:
+ return ""
try:
fp = open(cert_file, 'r')
cert = fp.read()
diff --git core/variables/setup_package.py core/variables/setup_package.py
index ff0c867..913caee 100644
--- core/variables/setup_package.py
+++ core/variables/setup_package.py
@@ -51,7 +51,7 @@ class VariableClCorePkgName(Variable):
def choice(self):
if self.Get('cl_ebuild_phase'):
return [""]
- return [""]+\
+ return [""]+["all"]+\
sorted(set(chain(*map(lambda x:map(lambda y:y[0].rpartition('-')[0] if y[2].startswith('r') else y[0],
imap(lambda y:y.rpartition('-'),
listDirectory(x))),
@@ -80,7 +80,7 @@ class VariableClCorePkgVersion(Variable):
def check(self,value):
pkg_name = self.Get('cl_core_pkg_name')
- if not value and pkg_name and pkg_name in self.choice():
+ if not value and pkg_name and pkg_name != "all":
raise VariableError(_("Please, choose version"))
class VariableClCorePkgSlot(Variable):
@@ -105,7 +105,7 @@ class VariableClCorePkgSlot(Variable):
def check(self,value):
pkg_name = self.Get('cl_core_pkg_name')
- if not value and pkg_name and pkg_name in self.choice():
+ if not value and pkg_name and pkg_name != "all":
raise VariableError(_("Please, choose slot"))
class VariableClCorePkgCategory(Variable):
@@ -147,7 +147,7 @@ class VariableClCorePkgCategory(Variable):
def check(self,value):
pkg_name = self.Get('cl_core_pkg_name')
- if not value and pkg_name and pkg_name in self.choice():
+ if not value and pkg_name and pkg_name != "all":
raise VariableError(_("Please, choose category"))
class VariableClCorePkgPath(Variable):

@ -4,6 +4,7 @@ AUX calculate-desktop-3.1.0_beta1-r2.patch 6429 SHA256 858d71260f8402dbc694ba3da
AUX calculate-desktop-3.1.0_beta1-r3.patch 5799 SHA256 78e44c0f9bc5ce27bdf5fc40f32aa4ef85cef4c10cf9f354f4d2e98e9846409c SHA512 fdaed75b609e25d429ab7e50b96797ac65a0d32dbcad3f3547b3a11efef9cc34fa11ae36bb5237965d600dde558dc13b2eefa245662ba6a787c771bd784c2585 WHIRLPOOL 9806608fdc25f9b80525b0b5c960aa986be2b4ef939561593b1adb664b70df2d0db826c8fc9010dd537140e48714d9da5755cd1558f019ed6f0b7b72a3fe1e49
AUX calculate-desktop-3.1.1_alpha2-r1.patch 531 SHA256 162a5b26a7e60ff16d5fb5952c7fc3c1cb310a7761a7f7605ebf862bf33b9b61 SHA512 ad892c31af29d98d4b46242c3c6efa264b719ba36f79648bf7c94afd5750340be35c4b060e5dca5e97b6619f49b9670eafcf4f3fad7be3c0e6833ab57767d742 WHIRLPOOL 38bebb575a75093b610532dc34301ba43415dffa463cc24e0ed974b61ecd15ac59c8381891a9de81a49f28754efe619359e8b2f9d269509f6ba29b86cfe2ad1a
AUX calculate-desktop-3.1.1_alpha2-r2.patch 1310 SHA256 27663ee8af6d25aaab22f1e5ad2e0d1ae2a345bd936ff419029267a56072b98d SHA512 6a988e58cd68a245c039473e35b77b27a306d3caa2fa93c647754156346dc4874494932323af52e50403ea695ad97a45655779ffbdcc870d95b57584cd664e0b WHIRLPOOL f84287177a29f0e12fbe64732f2f2210c984f4039d2235cfe1fc46f7467716994a97e3721883640888dd34678522afae48c5e06df24cf975c38629a8ea8578e5
AUX calculate-desktop-3.1.1_alpha2-r3.patch 2274 SHA256 908765413b74d2ae0615fdb2e1b8005beb518a978a4ebe2a32c67a8e17d405b5 SHA512 f78de919a3661280808ebe9e789a66b647c88f905dbf8f4755468769c2b8b03b76d9ce98bd60bde5d74fcaa7c7ffcaaaeb1ac95b73b82178a3654861c49b947d WHIRLPOOL 8407e57290c87b2e31a56e97de6b4052d5d6305f8ccf657208c5bba9b556d927dde759db6fcdb9c3816868aebac77f1f555e7dd2abdcb004385c3cb5d9c42303
DIST calculate-desktop-2.2.29.tar.bz2 15643 SHA256 6831d85c1615a0b7336000ad611dc2cc8db83f5fa4ad47d4dafecb9ea42d3530 SHA512 978284464799aa92a852d3f9dccd3897605f9a39e599233a470dc04b630434b46b4a93c9a6955dad2fd8fe80acdb59d7fe38c2a74c0f9692f0dffe4450cdc7bb WHIRLPOOL f40a92c11e94e3faffca007304a91d5e37689e83c987653a155eb56876ad7fe484b9b0a3f47fabc4df073740812372d3bc6300e9624fed343a8a3fb29565b3c5
DIST calculate-desktop-2.2.30.tar.bz2 15658 SHA256 8ad79a480c4cad7915523b707d119a9b05bd3429ac021d85c5aa09fe51fda7fb SHA512 f6570347f109418f3afab2e8c7c8f44caf979c2630caecae2578cc8821ccc299c4eff640c3a3e19fc813ffe36afd81840c2c23a61bdd769262b4a53e8ee92f60 WHIRLPOOL 23cb3c026587fbf3140007159d30a7e9a670d2648eb7a5f5b11a23bc8063e03c035a83b5c9dfd11c18542e6ee6b2973d01f43fd070bf057aad95168c1764087b
DIST calculate-desktop-3.1.0_alpha1.tar.bz2 13216 SHA256 35a2b315f8d5f9551407cf99a3072d86e8269c7f708bc1b8c962612eca288415 SHA512 5e6820a0a5d2fa2a95e7e922abf4a8761f12feb5114f8c3721e4c8aae3a3b03e5d745169bd7302d8160db9984294624bf6e6dfbf86530465aa24390a52b20cb9 WHIRLPOOL 3133fb170c0a6e5b2a33601667768e20c18040a46da7aa0d6db3b71b0ff159a891bd529718c763f5e79b16f88d569445ee183e1d7507dacac2b11d67e756e0f6
@ -34,6 +35,7 @@ EBUILD calculate-desktop-3.1.0_beta1.ebuild 660 SHA256 dbf93486dc49be379d2d51cd7
EBUILD calculate-desktop-3.1.1_alpha1.ebuild 665 SHA256 482c9cd8933da758531b1f6cc65a6d812c542e03d34b5b3d4890bad5fff755f6 SHA512 72ada2d57c9d86976a4f19c934ce3528cbead4392bf8b0adc6b17e5d79ec8b3b75a6233c874e55978b697993cf92d0c6289d1af433f491b1dfb9810fdd318895 WHIRLPOOL 7b5fccbfe2258454e5453aabad282de20614a225329dc5be6a1fe8d1e9c5fcc54bb9a6d6685abd8b41146e39451f44e023f0ff53c113627fa46c7435a2218e8a
EBUILD calculate-desktop-3.1.1_alpha2-r1.ebuild 809 SHA256 d0609b23c9aa805b9f82259ab70303d4fc4dfbed556ed6a1680a9fb53c06e1e3 SHA512 646852d698792d15b24246c9306fce04b06f171368a28593333fe3243f1085f8fa2d664d256335c61e8e1683336e52f2e33c441d6461b5264eddb1f6158807ad WHIRLPOOL 7145cef4647ef1df7cc98d5cd527ee2966c24767e2e58765f85a8151561fa1d6d40461991322dcf28efa1badb462ea90e53ee1f8f5641d0d3a5caf5141704e19
EBUILD calculate-desktop-3.1.1_alpha2-r2.ebuild 828 SHA256 675c8ba6a945f839f279b93d04a0686286bda7a07ad2d092b268b29438cf22ae SHA512 334b312329f991a84539ffd46aa9bd5d4e25726854f42364f2ac1b01acc0e38ffdf3a6316196e2c39d0088a8add46cc729d51035ecdd05548e8ec8290c717329 WHIRLPOOL 4e65973d09067450b07f25f3c83aaf594fdef5dfe82632b13fd057c5e4d49027cbe7cdf150ac9e1af5a748f6316799e15f1070c560147433a867f483b5c531eb
EBUILD calculate-desktop-3.1.1_alpha2-r3.ebuild 828 SHA256 c9d9c9eb17c3ec9b885c8837723cb4a475b4ed931e21741a7d779ae03d3a40fd SHA512 80a95fec35667f912aa8d66d06105c1ec1924d2960ffeb13e4c441dc7196f55b7397d2c7724bba583c0b60578698f87634b06c1114303da930c4f442a527e871 WHIRLPOOL 6cab034944a792c1a08dcd0157f51a426857124fe576fc63201b59c86d4172fe0c4afd7d1072c930768baf0119e38883d56f3b09f5c7a46736548b026ca0c69a
EBUILD calculate-desktop-3.1.1_alpha2.ebuild 665 SHA256 43c4d32033653680168928f43ce91b25bf07d90516237926e1e6a57b38418fb9 SHA512 b3745cfe0db5edf0c4ffaed8d34e3405c8e9ca6e125c7c21baf3262c5cb2bca18118f5d38a5c94e6534190a2e60e8520f33e4d272c2af0747b4efa65786078fc WHIRLPOOL c44fbfccff23fa59641878db79b847ac1ad399be0256709cb4d17b3d9d0fe34ab218187cfd8103fc82fe8430f25962e999b1ceb655c8a558f1784a78c213e34d
EBUILD calculate-desktop-3.1.9999.ebuild 976 SHA256 405de66b0f54804d4bc025fe786c21ca1a040d6a25928a535efbf84cacd7f505 SHA512 69ebfdc4c04f7c236f728c9938a5538b3822369cc1e1de2593a6e83178b5441ea2e37068ffcd9cf17aa92bcf00ee133ee98da0be5a5f591d69755e1159eeadac WHIRLPOOL c61f805379983ca23af188ff60a99511251a8afb27b75d0c1f08595012a579c42c2ef36603d837865a155706780ba413f0cac74457425eea0e0a59488e3dfda2
MISC ChangeLog 16440 SHA256 2a1c3211586d5dd10a249b61e4a8abf96a27a0c4d1706715b8a563bfa8aabf07 SHA512 962d9b69daeef659f2e1d6f2a5c974d6ed152d22fa9f0ed8c35d4c27e901f976167a2fc260a71c798be29d0161c7e90fa030957b2f74e25dcf35ecdb8fdc69e4 WHIRLPOOL df646b1f4c914fcb7142365b2110eb5112f7653cfddaf1b8a79f4a8f4ac99d50b6be59d3d593a8fb9e754ed92ebbe9a2cdebe320b0941d2ddd1bb9fba85c20b0

@ -0,0 +1,35 @@
# 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 the desktop configuration Calculate Linux"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS=""
IUSE=""
DEPEND="~sys-apps/calculate-core-3.1.1_alpha2
>=dev-python/python-ldap-2.0[ssl]
media-gfx/feh
x11-apps/xmessage
!<sys-apps/calculate-desktop-3.1.0_alpha1"
RDEPEND="${DEPEND}"
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-desktop-3.1.1_alpha2-r3.patch"
}

@ -0,0 +1,57 @@
diff --git desktop/cl_desktop.py desktop/cl_desktop.py
index e3130e0..6e3b904 100644
--- desktop/cl_desktop.py
+++ desktop/cl_desktop.py
@@ -80,8 +80,20 @@ class Desktop:
"""Apply templates for user"""
if self.clTempl:
self.closeClTemplate()
+
+ templates_locate = self.clVars.Get('cl_templates_locate')
+ self.clVars.Set("cl_template_path",
+ map(lambda x:x[1],
+ filter(lambda x:x[0] in templates_locate,
+ zip(self.clVars.Get('cl_template_location'),
+ self.clVars.Get('cl_template_path')))),
+ True)
+
self.clTempl = ProgressTemplate(self.setProgress,self.clVars,
- cltObj=False)
+ cltObj=False,
+ printERROR=self.printERROR,
+ printWARNING=self.printWARNING,
+ printSUCCESS=self.printSUCCESS)
dirsFiles = self.clTempl.applyTemplates()
if self.clTempl.getError():
self.printERROR(self.clTempl.getError().strip())
diff --git desktop/cl_wsdl_desktop.py desktop/cl_wsdl_desktop.py
index e07295d..c1844dd 100644
--- desktop/cl_wsdl_desktop.py
+++ desktop/cl_wsdl_desktop.py
@@ -40,6 +40,7 @@ class DesktopInfo(ClassSerializer):
"""Parameters for method install"""
ur_login = String
cl_verbose_set = String
+ cl_templates_locate = Array(String)
Default = Array(String)
CheckOnly = Boolean
@@ -54,7 +55,7 @@ class Wsdl:
"""
@rpc(Integer, DesktopInfo, _returns = Array(ReturnedMessage))
@core_method(category=__('Desktop'),title=__('Configure user'),
- image='preferences-desktop',
+ image='user-desktop,preferences-desktop',
gui=True,command='cl-desktop',
rights=['userconfigure'])
def desktop(self, sid, info):
@@ -69,7 +70,8 @@ class Wsdl:
dv.flIniFile()
dv.Set('cl_action','desktop',True)
dv.addGroup(None,
- normal=('ur_login','cl_verbose_set',),
+ normal=('ur_login',),
+ expert=('cl_verbose_set','cl_templates_locate'),
next_label=_("Configure"))
return dv

@ -27,6 +27,7 @@ AUX calculate-lib-3.1.1_alpha2-r14.patch 22713 SHA256 76b20b93992dcad224db2dedda
AUX calculate-lib-3.1.1_alpha2-r15.patch 23870 SHA256 60ec395c670de12de9aeed45b0e709911087517173d1cefc7c877e611292c690 SHA512 cc48fa500222f649b4b9a4f167be1feab0499aac4262b3d6783e2d97296ffb1e1b1b5e7a446c9f43c8ffb02a17282868203613f910a5cfc4df706d6eccc68fc8 WHIRLPOOL 215858250849f96ed569367eddce2f4232999e848c58013e4df046b35964fd9f57d73e1fc4884928c93efcf7404e898332024f1a6c805fe55d0a6550daf872d8
AUX calculate-lib-3.1.1_alpha2-r16.patch 24336 SHA256 e18b7d0b40f7cf2fac00bec1d5a59cc47e8187b90761af5cfcb5a6c91c396d28 SHA512 1c5000d02b15050f17caef7eae5b316b1dade475bf733fb2eaa28e1fe54a10a1baaa8a61915ab981ed6065e62ba41eca9ad0fb33f7448ebb4d64299f93565a9c WHIRLPOOL 9d7fb374bb1692edb96f996a54bf2ad66b55b3ba7a27c0f0cd5ef5fac39b432668bf360f8784f9ff65e8523f4712ad7007e40186956818f07b69e85d4332e7d1
AUX calculate-lib-3.1.1_alpha2-r17.patch 24342 SHA256 1bf63f639e29dee39ab183b3fbdcb60b1e450e297af3612d9e98db55569ab30a SHA512 17b2a35b722b1f6576c55cd49c5a9a51f57204448dc84af55dcfd3187ec2aa2c08439937ec1ba0e9b8e5a311129e7e4bbcecb8f4d7e24c6a2c3574ddbd799a9e WHIRLPOOL ae43d4d3c41f4d76f64ace9503b8f143691f083b3a86d82d13b27b766be05357990e00bedb8bf9e3f3c771800e8101aa0e210c993754bcffbb0d1dc174c78ccb
AUX calculate-lib-3.1.1_alpha2-r18.patch 25365 SHA256 44463a809d14b0cf6d5b14cbd85130654f0d93abe04cc734275675c238f0b9e0 SHA512 5590b5c4fdbafacb5765b5ba9fe3474b8dcdf3d576f24f4dc8bb26321a86ec1332daafe5712efc17dd3289ba07f2d2c9bc4e6fe324cf8f70e679a95dd25d3373 WHIRLPOOL 48f6d1f103b1a99c229e616daa73e21c8cae3a73ba6806f553ecfbbef4060c6cc114529c6c34cefb63cd3f3cff2672fbd24faa9e5be9eb3046ca22abf1b8fc7c
AUX calculate-lib-3.1.1_alpha2-r2.patch 2386 SHA256 2e4616804916e9054fe51e799ecd4a355d8b3ce404c91328b45c4ee2a53be561 SHA512 0c0b49e7c43de8655e6df49805e4cf8e4ee621f6b7f134cc42dc5ac4be4a753f16036c0d7db4763a81ff620a9d3145b892b2c3b47f5863929c0ddf0e8db585e5 WHIRLPOOL 5d6017a88a0a4a12ca4d85a572452ba8ca6dd80292dc009ff3768d4dfbdc39b32b3c293f7df9ffbc3a83cfdb5b412a579b1e80064b2e8ab5163834dacad6304f
AUX calculate-lib-3.1.1_alpha2-r3.patch 4920 SHA256 3d3490321e45744947d70ac1668ae939b1a62fd7644fd2e7a4a9de1b4395bc44 SHA512 9cd94862a5cedb624e5d1e4787464bebfadbef638bd9f678fd24f16d3905d46c1c36f419e5ec63946830058ba74d0d04eeaa69fc62e2aaa59ab4639a134ab5c3 WHIRLPOOL b762a30632f3753c38c8d870d56dc65b7679e3f3308e854259d03f2b977c9d07398f9f730ebe0eefa1f7c8580b5c3e394411edb4488b16e210f4532990e8df41
AUX calculate-lib-3.1.1_alpha2-r4.patch 6797 SHA256 6067424bac12b0dd2c113e98038db7157705d48669c8574e93dc4308bf217e18 SHA512 bb4f49192ea410be808867e6f3124a6b859c4818a8262f486af03b93fa18cbb1d7b8d705595fd1c441fbd40a47d8919164b2bbb0cdb8677303fcaf0f8b1caab1 WHIRLPOOL d378bba2b0831fd776fbea8fae2597268c2c863597178eab31148b87e91032f2501e932244e596ad24146beb68843fd95cf12cd2c438380ce58903aae1866966
@ -96,6 +97,7 @@ EBUILD calculate-lib-3.1.1_alpha2-r14.ebuild 822 SHA256 0cd6be310dfebc705ce732c1
EBUILD calculate-lib-3.1.1_alpha2-r15.ebuild 822 SHA256 66117e1d14dd61c1eea8bf2320946936056606b7b8f57e7224a24509adec59dd SHA512 f646e8b258e87fd672e5906bc8a41090b0ddf06d4d1c40af9f5dd58ba8d7a7ea1cb42c43238400e0177bc55ca44467d3ec15e66f2724b2e262c73cfa235bfc16 WHIRLPOOL 3bd800a95be0f0214c3c8dfe8f4bc2c52a9b70d07515ffd9f61a06aa459cc99a68696e2080857e5ccfcf2440bfabf6d7ddc234346b8d708c00b097a53a751783
EBUILD calculate-lib-3.1.1_alpha2-r16.ebuild 822 SHA256 e7eef87ce8d7e7463beb7f5ecad52572f30bc72774f6375bb2b20b9243d67226 SHA512 6dd457f628799b0937a8eb934f2a8005e37bf730f451ef3ccac6e563cdcef97041977c1e22d0644bb2ee49ee147d79522e2fd7d23449b0ac8b302d18ef858509 WHIRLPOOL d1f6893351e2fee0f50d8dc644114885f27f9207d1c684a51b1566b3b815a792a0ac39d2ee8309e3a72635d023440c276206d92bda38dfdf5eabef1bc9d8607e
EBUILD calculate-lib-3.1.1_alpha2-r17.ebuild 822 SHA256 5f025d92e5515a327a5e4d3bf20a936eb5114917e453c56768954f84c83b2aa4 SHA512 ed8797dfe9e8a7a9a47103e1ab32dec447e67df4438ce2bcce139efd7c5c64655fe6ff4612d14ff8030e5f1be9e5be601d451e7ac84e7f7f96bcd0ceee66a10a WHIRLPOOL 90d80d21753ebdd48c75b34550a373328042fc2f5ef29decefdbfcbd5fc4e2c6b9b94c05a053fe56d505b9b7961d2137588aefafa831adbb28851e171959cd82
EBUILD calculate-lib-3.1.1_alpha2-r18.ebuild 822 SHA256 c4c0d3f2506ba9eb13cb9909ccf067b2ffcad6cbbf46c90e92de7c5a6c6f739b SHA512 a02a98e06292feb2346dd631804ccc704fd18d615e5296571173709a12336c99bf881b0de839fd0b21ddfdb78a4a540b62af2b8b8a645725c220f32ea32ac1ec WHIRLPOOL a39320ebf72eba8270d28d8ffc09f07538af2972ef881856ce428a3ba269cce3fe5b9a6d7d737fe0a8f9d4fd694632681e744deeeacffc2692a9bf2bc3c17fe7
EBUILD calculate-lib-3.1.1_alpha2-r2.ebuild 821 SHA256 cd223474f7f4cd3c87f1cf6d75f7fda61fd6d33461e27f3a753710b7217840a7 SHA512 48a12926e36b8513b9feb1444f95f3b9ed80fac69329e9f0f17c97e42cab4cb11f44f1d678a6690e4a68268c07d8dad48b5cd05b04f7ac0034ce82e748dfe24c WHIRLPOOL 0d14e28c63383bfaeabf59d87d891d3a32ca4b9fd4e88af0743d27af24e1198781a2b435ab62be7c609f3debbad3b57fed8cde0a58d5a8890bbbed0a19bbdb80
EBUILD calculate-lib-3.1.1_alpha2-r3.ebuild 821 SHA256 c417d3904830c64de5978e26ef11f3b40b16d05c8fade33b299c3ff6e38c6bd1 SHA512 be152bf60027668ab3e49cdd15ff4e06f7599956db497f883d7c6c018dbfbb3a723b5c0b6b25de1eb1661474179a26f8ae5fd8d9e1a13eaf8bc8dae7c2024b9c WHIRLPOOL 93f32e6461d387fccb814b2332411c006c9a58e9280c8d96fb02ba4a5712c2e41203480512486fd11800faf8fce80546c27cdeb5c09f5e58d895e5dd11bcd5f9
EBUILD calculate-lib-3.1.1_alpha2-r4.ebuild 821 SHA256 c562f85ff455b300a04674f3b5e8d88efd85e3a09a28d1f62e18138b32326ff5 SHA512 442d202a23d9f6db5d3c18ebf367821ddb3c28b6a70c194403f5e7df250e2477b415a518b8117e0dfc3d927057ee9bc79958259b19581fbdfc9954bf31f29c87 WHIRLPOOL cd3cf784d4cf68cdf6d0be541377b9fb43342e60cdc7e6b41beb153fc2c2b1d2141468bd43534758265cf4349f83fc4b79360388ca955c9490481e8af68a8f57

@ -0,0 +1,35 @@
# 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=""
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.1.1_alpha2-r18.patch"
}

@ -0,0 +1,551 @@
diff --git calculate/lib/cl_template.py calculate/lib/cl_template.py
index 24ad307..55527cd 100644
--- calculate/lib/cl_template.py
+++ calculate/lib/cl_template.py
@@ -39,8 +39,9 @@ from utils.common import _error, _warning
from utils.text import _toUNICODE, convertStrListDict
from utils.portage import isPkgInstalled
from utils.content import PkgContents
-from utils.files import (getModeFile, removeDir, typeFile, scanDirectory,
- pathJoin,process,STDOUT)
+from utils.files import (getModeFile, listDirectory,removeDir, typeFile,
+ scanDirectory,
+ pathJoin,readFile,readLinesFile,process,STDOUT)
from datavars import DataVarsError
from calculate.lib.cl_lang import setLocalTranslate
@@ -301,6 +302,8 @@ class _terms(_error, _shareTermsFunction):
else:
try:
valVars = self.objVar.Get(vals[0])
+ if not valVars:
+ valVars = ""
except DataVarsError, e:
raise TemplatesError("{header}\n{body}".format(
header=textError,body=str(e)))
@@ -502,7 +505,7 @@ class fileHeader(_terms):
headerTerm = True
def __init__(self, templateName, text, comment=False, fileType=False,
- objVar=False, function=False):
+ objVar=False, function=False, templateObj=None):
self.body = text
# Объект с переменными
self.objVar=objVar
@@ -564,6 +567,7 @@ class fileHeader(_terms):
self.body = self.body[reL.end():]
else:
self.body = ""
+ paramLine = templateObj.applyFuncTemplate(paramLine,templateName)
paramList = self.splitParLine(paramLine)
if paramList:
for i in paramList:
@@ -2181,6 +2185,10 @@ class _file(_error):
F_CONF = open (nameFileConfig, "r+")
except:
try:
+ if os.path.isdir(nameFileConfig):
+ self.setWarning(_("unable to open the directory as file:")
+ + nameFileConfig)
+ return False
F_CONF = open(nameFileConfig, "w+")
except:
self.setError(_("unable to open the file:")
@@ -2482,6 +2490,9 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
# директория установленных программ
basePkgDir = "/var/db/pkg"
+ # кэш для проверки наличия пакета в портежах
+ cachePortdir = {}
+
# стек глобальных переменных
stackGlobalVars = []
@@ -2498,6 +2509,11 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
# Текст функции шаблона
functText = ""
+ # regular for discard sort number and version
+ reData = re.compile(r"^(?:\d+-)?(.+?)(?:-(?:|always|\d+|\d(?:\d|\.|pre|_"
+ "|-always|alpha|beta|pre|rc|[a-z][^a-z])*[a-z]?)(?:"
+ "-r\d+)?)?$",re.S)
+
currentBelong = ""
def __init__(self, objVar):
@@ -2756,7 +2772,8 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
"""
for pkgname,category,ver,slot in pkgs:
fullname = "%s/%s"%(category,pkgname)
- if not fullname in self.installProg:
+ if not fullname in self.installProg or \
+ type(self.installProg[fullname]) != dict:
self.installProg[fullname] = self.installProg[pkgname] = {}
if force or not slot in self.installProg[fullname]:
self.installProg[fullname][slot] = ver
@@ -2803,6 +2820,18 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
"""Функция шаблона pkg(), выдает номер версии программы"""
# Название программы
nameProg = funArgv.replace(" ","")
+ if not nameProg:
+ fileName = os.path.split(self.nameTemplate)[1]
+ if fileName == '.calculate_directory':
+ parentDir = os.path.dirname(self.nameTemplate)
+ parentDir, pkgName = os.path.split(parentDir)
+ else:
+ parentDir, pkgName = os.path.split(self.nameTemplate)
+ category = os.path.split(parentDir)[1]
+ # reg for discard version and sort number
+ pkgName = self.reData.search(pkgName).group(1)
+ category = self.reData.search(category).group(1)
+ nameProg = "%s/%s"%(category,pkgName)
# Замена функции в тексте шаблона
replace = ""
if "/" in nameProg:
@@ -2810,6 +2839,7 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
nameProg, spl, slot = nameProg.partition(":")
if not category in self.installCategory:
self.getInstallPkgGentoo(category=category)
+ self.installCategory.append(category)
replace = self.pkg(nameProg, slot=slot or None)
else:
if not self.flagAllPkgScan:
@@ -2875,7 +2905,11 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
" is neither 'upper' or 'lower' or"
" 'capitalize'"))
try:
- strValue = str(self.objVar.Get(terms[1]))
+ strValue = self.objVar.Get(terms[1])
+ if not strValue:
+ strValue = ""
+ else:
+ strValue = str(strValue)
except:
raise TemplatesError(
_("error in template %s")%self.nameTemplate + "\n" +
@@ -2894,6 +2928,31 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
textTemplateTmp[resS.end():]
return textTemplateTmp
+ def funcIn(self, funArgv, resS, localVars, textTemplateTmp, nameTemp):
+ """
+ Function in for check value in variable
+ """
+ terms = funArgv.replace(" ","").split(",")
+ # Название локальной переменной
+ nameLocVar = terms[0]
+ flagFoundVar = False
+ try:
+ value = self.objVar.Get(nameLocVar)
+ flagFoundVar = True
+ except:
+ pass
+ if flagFoundVar:
+ if value in terms[1:]:
+ replace = "1"
+ else:
+ replace = ""
+ else:
+ self.raiseErrTemplate(_("error: variable %s does not exist")\
+ %str(nameLocVar))
+ textTemplateTmp = textTemplateTmp[:resS.start()] + replace +\
+ textTemplateTmp[resS.end():]
+ return textTemplateTmp
+
def funcPush(self, funArgv, resS, localVars, textTemplateTmp, nameTemp):
"""локальная функция записывает значение переменной
@@ -3215,12 +3274,63 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
return textTemplateTmp
def funcBelong(self, funArgv, resS, localVars, textTemplateTmp, nameTemp):
- #self.setWarning(
- # _("Function '{funcname}' used by {template} is depricated"
- # " and will be removed at the future").format(
- # funcname="belong",template=nameTemp))
- return self.funcMerge(funArgv, resS, localVars,
- textTemplateTmp, nameTemp)
+ self.setWarning(
+ _("Function '{funcname}' used by {template} is depricated"
+ " and will be removed at the future").format(
+ funcname="belong",template=nameTemp))
+ replace = ""
+ return textTemplateTmp[:resS.start()] + replace +\
+ textTemplateTmp[resS.end():]
+
+ def checkCorrectPkgName(self,package):
+ """
+ Check pkg name (in /var/db/pkg,/usr/portage,/var/lib/layman/calculate
+ and other overlays)
+ """
+ category,spl,pkgname = package.partition('/')
+ pkgname, spl, slot = pkgname.partition(":")
+ # check installed package in system
+ if not category in self.installCategory:
+ self.getInstallPkgGentoo(category=category)
+ self.installCategory.append(category)
+ if self.pkg("%s/%s"%(category,pkgname), slot=slot or None):
+ return True
+ # check package in portage and calculate,overlay
+ def queuePortdir():
+ yield "/usr/portage"
+ calculate = "/var/lib/layman/calculate"
+ yield calculate
+ for portdir in filter(lambda x:x!=calculate,
+ self.objVar.Get('cl_portdir_overlay')):
+ yield portdir
+
+ for portdir in queuePortdir():
+ if not portdir in self.cachePortdir:
+ lPortdir = len(portdir)+1
+ self.cachePortdir[portdir] = \
+ list(set(
+ map(lambda x:x[lPortdir:].rpartition('/')[0],
+ glob.glob("%s/*/*/*.ebuild"%portdir))))
+ if package in self.cachePortdir[portdir]:
+ return True
+ else:
+ if portdir == "/usr/portage" and \
+ len(self.cachePortdir[portdir]) < 30:
+ #raise TemplatesError(_("Ebuild files are not found in portage"))
+ return True
+ if not "portage/update" in self.cachePortdir:
+ updateFiles = sorted(listDirectory('/usr/portage/profiles/updates'),
+ key=lambda x:tuple(reversed(x.split('Q-'))),reverse=True)
+ if updateFiles:
+ self.cachePortdir["portage/update"] = \
+ map(lambda x:x.split(' ')[1],
+ filter(lambda x:x.startswith('move '),
+ readLinesFile(os.path.join('/usr/portage/profiles/updates',
+ updateFiles[0]))))
+ if package in self.cachePortdir:
+ self.printWARNING(_("Package {frompkg} was renamed").format(frompkg=package))
+ return True
+ return False
def funcMerge(self, funArgv, resS, localVars, textTemplateTmp, nameTemp):
"""
@@ -3234,11 +3344,27 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
self.raiseErrTemplate()
funcPkg = terms[0]
if not funcPkg:
- funcPkg = os.path.split(self.nameTemplate)[1]
- if funcPkg == '.calculate_directory':
- funcPkg = os.path.split(os.path.dirname(self.nameTemplate))[1]
- if not funcPkg:
- self.raiseErrTemplate(_("incorrect template path"))
+ fileName = os.path.split(self.nameTemplate)[1]
+ if fileName == '.calculate_directory':
+ parentDir = os.path.dirname(self.nameTemplate)
+ parentDir, pkgName = os.path.split(parentDir)
+ else:
+ parentDir, pkgName = os.path.split(self.nameTemplate)
+ category = os.path.split(parentDir)[1]
+ # reg for discard version and sort number
+ pkgName = self.reData.search(pkgName).group(1)
+ category = self.reData.search(category).group(1)
+ funcPkg = "%s/%s"%(category,pkgName)
+ try:
+ if not self.checkCorrectPkgName(funcPkg):
+ self.printWARNING(
+ _("Package {pkgName} specified in the merge() into "
+ "{templName} template is not found").format(
+ pkgName=funcPkg,templName=self.nameTemplate))
+ return textTemplateTmp[:resS.start()] + \
+ textTemplateTmp[resS.end():]
+ except TemplatesError as e:
+ self.printWARNING(str(e))
self.currentBelong = funcPkg
pkg = self.objVar.Get("cl_merge_pkg")
replace = ""
@@ -3601,6 +3727,9 @@ re.M|re.S)
self.allTemplates = 0
# Объект функций шаблона
self.functObj = templateFunction(self.objVar)
+ self.functObj.printSUCCESS = self.printSUCCESS
+ self.functObj.printWARNING = self.printWARNING
+ self.functObj.printERROR = self.printERROR
# Метод применения функций к шаблонам
self.applyFuncTemplate = self.functObj.applyFuncTemplate
# Объект для определения типа файла шаблона
@@ -3658,7 +3787,8 @@ re.M|re.S)
def executeTemplate(self, code, execPath):
"""Execute template"""
- p = process(execPath,lang=self.objVar.Get('os_locale_locale'))
+ p = process(execPath,lang=self.objVar.Get('os_locale_locale'),
+ envdict=os.environ)
if "/bin/bash" in code.partition('\n')[0]:
p.write("""function translate() {
gettext -d cl_template "$*"
@@ -3771,7 +3901,11 @@ gettext -d cl_template "$*"
varName = mark[self._deltVarStart:-self._deltVarEnd]
varValue = ""
try:
- varValue = str(self.objVar.Get(varName))
+ varValue = self.objVar.Get(varName)
+ if not varValue:
+ varValue = ""
+ else:
+ varValue = str(varValue)
except DataVarsError, e:
raise TemplatesError(_("error in template %s")%nameTemplate
+ "\n" + str(e))
@@ -4131,9 +4265,8 @@ gettext -d cl_template "$*"
for pkg in self.objVar.Get('cl_merge_pkg'):
category = isPkgInstalled(pkg)
if category:
- category = category[0].rpartition('/')[2]
pkgContents = PkgContents("{CATEGORY}/{PF}".format(
- **isPkgInstalled("%s/%s"%(category,pkg))[0]))
+ **category[0]))
for filename in pkgContents.content.keys():
if not filename in self.cltObj.filterApplyTemplates:
self.cltObj.filterApplyTemplates[filename] = []
@@ -4281,6 +4414,11 @@ gettext -d cl_template "$*"
self.getApplyHeadDir(newDir, dirInfoFile, opt)
if createdDirs:
self.createdDirs += createdDirs
+ if os.path.isfile(pathDir):
+ self.setWarning(_("{dirpath} is file").format(dirpath=pathDir))
+ self.setWarning(_("templates in {tempath} is skipped"
+ ).format(tempath=path))
+ return None
if objHeadDir:
return pathDir, objHeadDir
else:
@@ -4392,11 +4530,11 @@ gettext -d cl_template "$*"
# add packeges for reconfigure
if "merge" in objHead.params:
mergePkgs = objHead.params['merge'].split(',')
- reRight = re.compile(r'^(\w+-\w+/)?[\w+-]+$')
- for wrongPkg in (x for x in mergePkgs if not reRight.match(x)):
- self.setError(_("Wrong value '%s' for 'merge' in the template")%
+ for wrongPkg in (x for x in mergePkgs \
+ if not self.functObj.checkCorrectPkgName(x)):
+ self.printWARNING(
+ _("Wrong package '%s' for 'merge' in the template")%
wrongPkg + ": " + nameFileTemplate)
- return ([], False)
for pkg in mergePkgs:
if not pkg in self.objVar.Get('cl_merge_pkg_new') and \
not pkg in self.objVar.Get('cl_merge_pkg_pass'):
@@ -4668,7 +4806,7 @@ gettext -d cl_template "$*"
self.closeTemplFile()
objHeadNew = fileHeader(nameFileTemplate, self.textTemplate, False,
templateFileType ,objVar=self.objVar,
- function=function)
+ function=function,templateObj=self)
# файл шаблона не будет применен
if not objHeadNew.headerTerm:
if objHeadNew.getError():
@@ -4679,11 +4817,11 @@ gettext -d cl_template "$*"
# add packeges for reconfigure
if "merge" in objHeadNew.params:
mergePkgs = objHeadNew.params['merge'].split(',')
- reRight = re.compile(r'^(\w+-\w+/)?[\w+-]+$')
- for wrongPkg in (x for x in mergePkgs if not reRight.match(x)):
- self.setError(_("Wrong value '%s' for 'merge' in the template")%
+ for wrongPkg in (x for x in mergePkgs \
+ if not self.functObj.checkCorrectPkgName(x)):
+ self.printWARNING(
+ _("Wrong package '%s' for 'merge' in the template")%
wrongPkg + ": " + nameFileTemplate)
- return ([], False)
for pkg in mergePkgs:
if not pkg in self.objVar.Get('cl_merge_pkg_new') and \
not pkg in self.objVar.Get('cl_merge_pkg_pass'):
@@ -5052,7 +5190,7 @@ gettext -d cl_template "$*"
def fileIsUtf(self, fileName):
"""Проверяет файл на кодировку UTF-8"""
- if os.path.exists(fileName):
+ if os.path.isfile(fileName):
FD = open(os.path.abspath(fileName))
newTemplate = FD.read()
FD.close()
@@ -5060,7 +5198,8 @@ gettext -d cl_template "$*"
newTemplate.decode("UTF-8")
except:
return False
- return True
+ return True
+ return False
def joinTemplate(self, nameFileTemplate, nameFileConfig, optFile={}):
"""Объединения шаблона и конф. файла
@@ -5092,15 +5231,9 @@ gettext -d cl_template "$*"
return []
if templateFileType != "bin":
- # Вычисляем условные блоки
- self.textTemplate = self.applyTermsTemplate(self.textTemplate,
- nameFileTemplate)
# Заменяем переменные на их значения
self.textTemplate = self.applyVarsTemplate(self.textTemplate,
nameFileTemplate)
- # Вычисляем функции
- self.textTemplate = self.applyFuncTemplate(self.textTemplate,
- nameFileTemplate)
flagCopyTemplate = False
if not optFile:
optFile = {"path":os.path.split(nameFileConfig)[0]}
@@ -5110,6 +5243,13 @@ gettext -d cl_template "$*"
optFile)
if not objHeadNew:
return filesApply
+ if templateFileType != "bin":
+ # Вычисляем условные блоки
+ objHeadNew.body = self.applyTermsTemplate(objHeadNew.body,
+ nameFileTemplate)
+ # Вычисляем функции
+ objHeadNew.body = self.applyFuncTemplate(objHeadNew.body,
+ nameFileTemplate)
# Настоящее имя конфигурационного файла
nameFileConfig = filesApply[0]
# Флаг - кодировка с бинарными примесями у файла шаблона включаем при
diff --git calculate/lib/datavars.py calculate/lib/datavars.py
index 02b1d4a..1791281 100644
--- calculate/lib/datavars.py
+++ calculate/lib/datavars.py
@@ -33,9 +33,9 @@ from types import StringTypes
def addStdConfig(fileLst,prefix='/'):
stdPath = path.join(prefix,
- "/var/lib/layman/calculate/profiles/calculate.env")
+ "var/lib/layman/calculate/profiles/calculate.env")
if not stdPath in map(os.path.abspath,fileLst):
- return fileLst + [stdPath]
+ return [stdPath] + fileLst
return fileLst
def itemgetter(*args,**kwargs):
@@ -757,9 +757,10 @@ class SimpleDataVars:
searchProfile(iniFile,'calculate.env'),prefix=self.systemRoot),""))
else:
config = cl_template.iniParser(iniFile)
+ importVars = config.getAreaVars("main")
for varname in self.allVars.keys():
if not varname in self.cache:
- val = self.unserialize("string",config.getVar('main',varname))
+ val = self.unserialize("string",importVars.get(varname,''))
if val:
self.cache[varname] = val.encode('utf-8')
diff --git calculate/lib/format/world.py calculate/lib/format/world.py
index 69bfc4f..7d93488 100644
--- calculate/lib/format/world.py
+++ calculate/lib/format/world.py
@@ -22,7 +22,7 @@ class world(objShare):
"""Класс для обработки конфигурационного файла типа procmail
"""
- _comment = ""
+ _comment = "#"
configName = "world"
configVersion = "0.1"
sepFields = "\n"
@@ -66,15 +66,15 @@ class world(objShare):
for k in txtLines:
textLine = k + endtxtLines[z]
z += 1
- #findComment = self.reComment.search(textLine)
+ findComment = self.reComment.search(textLine)
if not textLine.strip():
field.br = textLine
fields.append(field)
field = fieldData()
- #elif findComment:
- # field.comment = textLine
- # fields.append(field)
- # field = fieldData()
+ elif findComment:
+ field.comment = textLine
+ fields.append(field)
+ field = fieldData()
else:
pars = textLine.strip()
field.name = pars
diff --git calculate/lib/variables/env.py calculate/lib/variables/env.py
index 44da0c3..8da1f30 100644
--- calculate/lib/variables/env.py
+++ calculate/lib/variables/env.py
@@ -252,3 +252,62 @@ class VariableClEbuildPhase(ReadonlyVariable):
"""
def get(self):
return os.environ.get("EBUILD_PHASE","")
+
+class VariableClEmergeInfo(ReadonlyVariable):
+ """
+ Emerge --info cache
+ """
+ type = "list"
+
+ def get(self):
+ return filter(lambda x:x.startswith('PORTDIR_OVERLAY=') or \
+ x.startswith('PORTDIR='),
+ process("emerge","--info",envdict=os.environ).read().split('\n'))
+
+class VariableClPortdirOverlay(ReadonlyVariable):
+ """
+ Overlays path
+ """
+ type = "list"
+
+ def get(self):
+ emergeInfo = self.Get('cl_emerge_info')
+ for line in filter(lambda x:x.startswith("PORTDIR_OVERLAY="),
+ emergeInfo):
+ return filter(None,
+ line.partition("=")[2].strip('\n"\'').split(' '))
+ return []
+
+class VariableClTemplatesLocate(Variable):
+ """
+ Location templates
+ """
+ type = "choice-list"
+ #value = ['overlay','local','remote','clt']
+ element = "selecttable"
+ opt = ["-l","--locate"]
+ metavalue = "TEMPLATES"
+ untrusted = True
+
+ descriptionMap = {'overlay':_('Overlay templates'),
+ 'local':_('Local templates'),
+ 'remote':_('Remote templates'),
+ 'clt':_('clt templates')}
+
+ def init(self):
+ self.label = _("Location templates")
+ self.help = _("select location for templates %s") \
+ %",".join(self.get())
+
+ def get(self):
+ vals = \
+ self.Get('cl_template_location')[:len(self.Get('cl_template_path'))]
+ if self.Get('cl_action') == 'desktop':
+ return vals
+ else:
+ return vals + ['clt']
+
+ def choice(self):
+ return map(lambda x:(x,self.descriptionMap.get(x,x)),
+ self.get())
+
diff --git calculate/lib/variables/linux.py calculate/lib/variables/linux.py
index be3bbb2..e3e6bdd 100644
--- calculate/lib/variables/linux.py
+++ calculate/lib/variables/linux.py
@@ -240,8 +240,9 @@ class LinuxDataVars(SimpleDataVars):
VariableOsLinuxBuild(systemRoot=systemRoot))
makeprofile = path.join(systemRoot,'etc/make.profile')
if os.path.exists(makeprofile):
- inifile = path.join('/etc',os.readlink('/etc/make.profile'))
- self.flIniFileFrom(makeprofile)
+ inifile = path.join(systemRoot,'etc',
+ os.readlink(path.join(systemRoot,'etc/make.profile')))
+ self.flIniFileFrom(inifile)
inifile = "etc/calculate/calculate.env"
self.flIniFileFrom(path.join(systemRoot,inifile))
iniFile = "etc/calculate/calculate3.env"

@ -97,6 +97,7 @@ EBUILD calculate-utilities-3.1.1_alpha2-r23.ebuild 825 SHA256 a27470af85063ca90c
EBUILD calculate-utilities-3.1.1_alpha2-r24.ebuild 825 SHA256 71affbfba490b0fc56c4e64bb2d09dea2faf1e95412779e266695799b22b018c SHA512 96919719cc62d0f547dd6b712c30091a87cd074f00c2bebbb4292df0562c137d367a05da0dd2c5fe2f6df5533d334d54c867b23b4cc6d896798754681e8a77da WHIRLPOOL 91a07ade34eb74a014ec4e28fa2963a0533996e08239ad8d1713e2e764f40feabf17fb69ed32ee964693454da96d6c11ed1043d0ae667e489c89d60da937473c
EBUILD calculate-utilities-3.1.1_alpha2-r25.ebuild 825 SHA256 1bca67b3dd4ae1ddcc9560812fbb032e816b2931e7b9dd8952f9e1de1348325b SHA512 bb234407ecb3057d7ca0c23531e116aa8908c617f25ba430f1354e160b2a8829fd7c1da0e6b1f254bdb83d39af770cb2e64a8067f3ec751c112883b2f979c5af WHIRLPOOL ee4770c9b70d38d94657e883cfbe36935bc488020fac7bc5eef6f7a27660365fb3f1a1624fef68669bbc42da916b2566a4bc30faf816f2760cf4489a685be37f
EBUILD calculate-utilities-3.1.1_alpha2-r26.ebuild 825 SHA256 02956bda03f22e33745b10bd845a659bb6f4099888f3c692de9f3aabd4b2861f SHA512 acdd53110d3f3b921c5dea56ebd8e1c6d7932db49044b40e4c869385374af922a82d9e6d10d60748539b92b798ba30125fc0341545b55e400a2d56edc1d5fc1a WHIRLPOOL a5055813151ad13429a95a987fa15267f453048990d14fde1f9bb01e2db179ef4a44cb64b5df8f7574bdfbdd9ba2837a8a9a2983016311f716927d1db55c8a98
EBUILD calculate-utilities-3.1.1_alpha2-r27.ebuild 825 SHA256 dc77f6e5b3283e05fec7689dd3e881336ec6285f734a3cdafbff1dc5ef7768bd SHA512 ac5bedd233fa20a240a49497ea8bd146891b46b1d59b5b17e258bab26a0af37c0ae5b978f06b14e625225f4c1855e6a5cd0e3c09eb6f26b1753b20d63e6e6e62 WHIRLPOOL 158dbb012b7a21555ef5914957dab970cd98434668cd0a821c4b0293e5094a7ac3921a1ade117b8ab44cb51bd6772783a0b31ffe2df611bcf83cb863d8b35706
EBUILD calculate-utilities-3.1.1_alpha2-r3.ebuild 812 SHA256 0487e98bdecdd898deb5226b0d65aef9b34f5c0338865484718fece5afb2e59f SHA512 22d698366844041accad94a7464f9f9bdfaf137328ae628e7e37ecf080293f2b472fabceca1098ad5a09254430e01b44fb01ae2e20dd5c6f53abfe1cb97f4722 WHIRLPOOL faddda116dca5eaa52c6b9d505923cae96382f7f39d1921d1c84816af484f08b7e9da856b9514e8133cd8f8daa74782930223a14a3f90222a76cbf691bd159ba
EBUILD calculate-utilities-3.1.1_alpha2-r4.ebuild 815 SHA256 12c8d2ca9c3813aaa2ac0f831ea5b362c99adc09b3018070c143f681ede69c70 SHA512 42d207ebffddf00d5863bde87ca4ddf247df4032ade14cdb488ea78aa47a45fd2f4933fe8dd1d8bf1e8ce590feaeba032643c65cd5fbb309b6f33ba3e503a5cb WHIRLPOOL 1d41a910d291f246fec99376c3be44abf51829cab9ff2067ff2f5e1a15bfe16691f9013ba5aeee5a0d549ef880249de0b472538df8acc6798f276358e0da911f
EBUILD calculate-utilities-3.1.1_alpha2-r5.ebuild 815 SHA256 9564585c5246c43680f53cde260fd42778e1623d51c379b2d5c27590f7173297 SHA512 944e6d28beccbb82a3b633f93b8c6beb93b24554619e27feb1fefeef28364e78e8294ebd776e144cd8e5d8c80708f1fb6168c2ee49b0bd04eb2e2ddf42366bcf WHIRLPOOL b5cdbe8e5588b430818da660c1faa9445c2d271e7530b59b68829ea90454f7579f5eb530d7f09b5ff739874f2701262f10f247f04cc4b9e062f5396b0ec615eb

@ -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=""
IUSE="cl_consolegui cl_client cl_desktop cl_console"
RDEPEND="${RDEPEND}
=sys-apps/calculate-install-3.1.1_alpha2-r7
=sys-apps/calculate-i18n-3.1.1_alpha2-r1
=sys-apps/calculate-lib-3.1.1_alpha2-r18
=sys-apps/calculate-core-3.1.1_alpha2-r7
=sys-apps/calculate-update-3.1.1_alpha2-r3
cl_client? ( =sys-apps/calculate-client-3.1.1_alpha2 )
cl_desktop? ( =sys-apps/calculate-desktop-3.1.1_alpha2-r3 )
cl_consolegui? ( =sys-apps/calculate-console-gui-3.1.1_alpha2-r1 )
cl_console? ( =sys-apps/calculate-console-3.1.1_alpha2 )
"
Loading…
Cancel
Save