parent
62c4cdf00b
commit
ee0a1ef47a
@ -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-r5.patch"
|
||||
}
|
@ -0,0 +1,183 @@
|
||||
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/setup_package.py core/server/setup_package.py
|
||||
index 2111b8d..196cefd 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")
|
||||
@@ -380,9 +397,8 @@ class updateSystemConfigs(shareUpdateConfigs):
|
||||
for pkg in clTempl.changedFiles.getPkgs():
|
||||
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 +472,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):
|
@ -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-r4
|
||||
=sys-apps/calculate-i18n-3.1.1_alpha2-r1
|
||||
=sys-apps/calculate-lib-3.1.1_alpha2-r13
|
||||
=sys-apps/calculate-core-3.1.1_alpha2-r5
|
||||
=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-r2 )
|
||||
cl_consolegui? ( =sys-apps/calculate-console-gui-3.1.1_alpha2-r1 )
|
||||
cl_console? ( =sys-apps/calculate-console-3.1.1_alpha2 )
|
||||
"
|
Loading…
Reference in new issue