parent
b65b0286b5
commit
511459b55c
@ -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-r5.patch"
|
||||
}
|
@ -0,0 +1,165 @@
|
||||
diff --git calculate/lib/cl_template.py calculate/lib/cl_template.py
|
||||
index 24ad307..10c0f04 100644
|
||||
--- calculate/lib/cl_template.py
|
||||
+++ calculate/lib/cl_template.py
|
||||
@@ -2799,6 +2799,33 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
|
||||
else:
|
||||
return ""
|
||||
|
||||
+ def funcPkgw(self, funArgv, resS, localVars, textTemplateTmp, nameTemp):
|
||||
+ """Функция шаблона pkgw(), возвращает аргумент если программа установлена"""
|
||||
+ # Название программы
|
||||
+ nameProg = funArgv.replace(" ","")
|
||||
+ origProg = nameProg
|
||||
+ # Замена функции в тексте шаблона
|
||||
+ replace = ""
|
||||
+ if "/" in nameProg:
|
||||
+ category, spl, nameProg = nameProg.partition("/")
|
||||
+ 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:
|
||||
+ self.getInstallPkgGentoo()
|
||||
+ templateFunction.flagAllPkgScan = True
|
||||
+ nameProg,spl,slot = nameProg.partition(":")
|
||||
+ replace = self.pkg(nameProg,
|
||||
+ slot=slot)
|
||||
+ if replace:
|
||||
+ replace = origProg
|
||||
+ textTemplateTmp = textTemplateTmp[:resS.start()] + replace +\
|
||||
+ textTemplateTmp[resS.end():]
|
||||
+ return textTemplateTmp
|
||||
+
|
||||
def funcPkg(self, funArgv, resS, localVars, textTemplateTmp, nameTemp):
|
||||
"""Функция шаблона pkg(), выдает номер версии программы"""
|
||||
# Название программы
|
||||
@@ -2810,6 +2837,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:
|
||||
@@ -2894,6 +2922,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):
|
||||
"""локальная функция записывает значение переменной
|
||||
|
||||
@@ -3658,7 +3711,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 "$*"
|
||||
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/linux.py calculate/lib/variables/linux.py
|
||||
index be3bbb2..79890fe 100644
|
||||
--- calculate/lib/variables/linux.py
|
||||
+++ calculate/lib/variables/linux.py
|
||||
@@ -240,8 +240,8 @@ 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('/etc/make.profile'))
|
||||
+ self.flIniFileFrom(inifile)
|
||||
inifile = "etc/calculate/calculate.env"
|
||||
self.flIniFileFrom(path.join(systemRoot,inifile))
|
||||
iniFile = "etc/calculate/calculate3.env"
|
@ -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-r3
|
||||
=sys-apps/calculate-i18n-3.1.1_alpha2
|
||||
=sys-apps/calculate-lib-3.1.1_alpha2-r5
|
||||
=sys-apps/calculate-core-3.1.1_alpha2
|
||||
=sys-apps/calculate-update-3.1.1_alpha2-r1
|
||||
cl_client? ( =sys-apps/calculate-client-3.1.1_alpha2 )
|
||||
cl_desktop? ( =sys-apps/calculate-desktop-3.1.1_alpha2-r1 )
|
||||
cl_consolegui? ( =sys-apps/calculate-console-gui-3.1.1_alpha2 )
|
||||
cl_console? ( =sys-apps/calculate-console-3.1.1_alpha2 )
|
||||
"
|
Loading…
Reference in new issue