parent
a5798964ca
commit
5fd3a15b53
@ -0,0 +1,36 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
EAPI="3"
|
||||
SUPPORT_PYTHON_ABIS="1"
|
||||
PYTHON_DEPEND="2:2.7"
|
||||
RESTRICT_PYTHON_ABIS="2.4 2.5 2.6 3.*"
|
||||
|
||||
inherit distutils eutils
|
||||
|
||||
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2"
|
||||
|
||||
DESCRIPTION="The library for Calculate 3"
|
||||
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="3"
|
||||
KEYWORDS="amd64 x86"
|
||||
IUSE="minimal"
|
||||
DEPEND="!minimal? ( dev-python/py-smbpasswd )
|
||||
>=dev-python/pyxml-0.8
|
||||
sys-apps/iproute2
|
||||
sys-apps/pciutils
|
||||
sys-fs/lvm2
|
||||
sys-fs/mdadm
|
||||
dev-python/pyinotify
|
||||
sys-apps/file[python]"
|
||||
RDEPEND="${DEPEND}"
|
||||
|
||||
src_unpack() {
|
||||
unpack "${A}"
|
||||
cd "${S}"
|
||||
|
||||
# apply revision changes
|
||||
epatch "${FILESDIR}/calculate-lib-3.2.0_alpha4-r2.patch"
|
||||
}
|
@ -0,0 +1,172 @@
|
||||
diff --git calculate/lib/cl_progressbar.py calculate/lib/cl_progressbar.py
|
||||
index 36bb6c4..5734d28 100644
|
||||
--- calculate/lib/cl_progressbar.py
|
||||
+++ calculate/lib/cl_progressbar.py
|
||||
@@ -110,6 +110,7 @@ try:
|
||||
|
||||
def __init__(self):
|
||||
self.outQueue = Queue()
|
||||
+ self.finished = False
|
||||
self.inQueue = Queue()
|
||||
Process(target=self.runProgress,
|
||||
args=(self.outQueue,self.inQueue)).start()
|
||||
@@ -127,6 +128,7 @@ try:
|
||||
|
||||
def quit(self):
|
||||
self.outQueue.put(("quit",(),False))
|
||||
+ self.finished = True
|
||||
self.outQueue.close()
|
||||
self.inQueue.close()
|
||||
except:
|
||||
diff --git calculate/lib/datavars.py calculate/lib/datavars.py
|
||||
index 1881294..3690083 100644
|
||||
--- calculate/lib/datavars.py
|
||||
+++ calculate/lib/datavars.py
|
||||
@@ -1017,9 +1017,10 @@ class DataVars(SimpleDataVars):
|
||||
"""
|
||||
if not self.iniCache:
|
||||
# get initialized section names
|
||||
- if os.path.exists('/etc/make.profile'):
|
||||
+ make_profile = self.Get('main.cl_make_profile')
|
||||
+ if os.path.exists(make_profile):
|
||||
profiles = [('profile',
|
||||
- path.join('/etc',os.readlink('/etc/make.profile')))]
|
||||
+ path.join('/etc',os.readlink(make_profile)))]
|
||||
else:
|
||||
profiles = []
|
||||
for iniName,iniFile in profiles+\
|
||||
diff --git calculate/lib/variables/env.py calculate/lib/variables/env.py
|
||||
index ab295ca..87d43cc 100644
|
||||
--- calculate/lib/variables/env.py
|
||||
+++ calculate/lib/variables/env.py
|
||||
@@ -414,6 +414,17 @@ class VariableClMakeProfile(Variable):
|
||||
"""
|
||||
Путь до актуального make.profile
|
||||
"""
|
||||
+ systemRoot = "/"
|
||||
+
|
||||
+ def get_work_link(self, *links):
|
||||
+ for link in links:
|
||||
+ if path.exists(link):
|
||||
+ return link
|
||||
+
|
||||
def get(self):
|
||||
- # TODO: заглушка, нужно учитывать /etc/portage/make.profile
|
||||
- return "/etc/make.profile"
|
||||
+ files = ["etc/portage/make.profile", "etc/make.profile"]
|
||||
+ val = self.get_work_link(
|
||||
+ *[path.join(self.systemRoot, x) for x in files])
|
||||
+ if not val:
|
||||
+ raise VariableError(_("Failed to detect system profile"))
|
||||
+ return val
|
||||
diff --git calculate/lib/variables/linux.py calculate/lib/variables/linux.py
|
||||
index 5d907f6..d49c773 100644
|
||||
--- calculate/lib/variables/linux.py
|
||||
+++ calculate/lib/variables/linux.py
|
||||
@@ -18,10 +18,10 @@ import os
|
||||
from os import path
|
||||
import re
|
||||
import platform
|
||||
-from calculate.lib.datavars import Variable,ReadonlyVariable,SimpleDataVars
|
||||
+from calculate.lib.datavars import Variable, SimpleDataVars
|
||||
from calculate.lib.utils.portage import isPkgInstalled
|
||||
-from calculate.lib.utils.files import countFiles,readFile
|
||||
-import calculate.lib.cl_template as cl_template
|
||||
+from calculate.lib.utils.files import readFile
|
||||
+from env import VariableClMakeProfile
|
||||
|
||||
class Linux:
|
||||
dictLinuxName = {"CLD":"Calculate Linux Desktop",
|
||||
@@ -51,7 +51,7 @@ class Linux:
|
||||
|
||||
def getShortnameByMakeprofile(self,systemroot):
|
||||
"""Get shortname by symlink of make.profile"""
|
||||
- makeprofile = path.join(systemroot,'etc/make.profile')
|
||||
+ makeprofile = self.Get('cl_make_profile')
|
||||
if path.exists(makeprofile):
|
||||
link = os.readlink(makeprofile)
|
||||
reMakeProfileLink = re.compile('/calculate/(desktop|server)/(%s)/'%
|
||||
@@ -78,11 +78,11 @@ class Linux:
|
||||
|
||||
def detectOtherShortname(self,systemroot):
|
||||
"""Detect other system. Now only Gentoo."""
|
||||
- gentooFile = path.join(systemroot,"etc/gentoo-release")
|
||||
+ gentooFile = path.join(systemroot, "etc/gentoo-release")
|
||||
if path.exists(gentooFile):
|
||||
return "Gentoo"
|
||||
- if all(map(lambda x:path.lexists(path.join(systemroot,x)),
|
||||
- ['bin','var','lib','etc'])):
|
||||
+ if all(map(lambda x: path.lexists(path.join(systemroot, x)),
|
||||
+ ['bin', 'var', 'lib', 'etc'])):
|
||||
return "Linux"
|
||||
return None
|
||||
|
||||
@@ -92,17 +92,17 @@ class Linux:
|
||||
"""
|
||||
overlayPath = 'var/lib/layman/calculate'
|
||||
releaseFile = 'profiles/calculate-release'
|
||||
- return readFile(path.join(systemroot,overlayPath,releaseFile))
|
||||
+ return readFile(path.join(systemroot, overlayPath, releaseFile))
|
||||
|
||||
def getVersionFromMetapackage(self,systemroot,shortname):
|
||||
"""Get version from meta package"""
|
||||
- for pkg in ("app-misc/calculate-meta","app-misc/%s-meta"%shortname):
|
||||
- calcMeta = isPkgInstalled(pkg,systemroot)
|
||||
+ for pkg in ("app-misc/calculate-meta", "app-misc/%s-meta" % shortname):
|
||||
+ calcMeta = isPkgInstalled(pkg, systemroot)
|
||||
if calcMeta:
|
||||
return calcMeta[0]['PV']
|
||||
return None
|
||||
|
||||
- def getVersionFromCalculateIni(self,systemroot):
|
||||
+ def getVersionFromCalculateIni(self, systemroot):
|
||||
"""Get version from calculate ini"""
|
||||
pathname = path.join(systemroot,
|
||||
'etc/calculate/calculate.ini')
|
||||
@@ -124,11 +124,9 @@ class Linux:
|
||||
def getVersionFromGentooFiles(self,systemroot):
|
||||
"""Get version from gentoo files"""
|
||||
gentooFile = path.join(systemroot,"etc/gentoo-release")
|
||||
- systemVersion = ""
|
||||
- flagGentoo = False
|
||||
reVer=re.compile("^(\d+\.)*\d+$",re.S)
|
||||
if path.exists(gentooFile):
|
||||
- gentooLink = path.join(systemroot,"etc/make.profile")
|
||||
+ gentooLink = self.Get('cl_make_profile')
|
||||
if path.islink(gentooLink):
|
||||
vers = filter(reVer.search,
|
||||
os.readlink(gentooLink).split('/'))
|
||||
@@ -227,9 +225,10 @@ class VariableOsLinuxFiles(Variable,Linux):
|
||||
|
||||
|
||||
class LinuxDataVars(SimpleDataVars):
|
||||
- def __init__(self,systemRoot="/"):
|
||||
+ def __init__(self, systemRoot="/"):
|
||||
self.systemRoot = systemRoot
|
||||
SimpleDataVars.__init__(self,
|
||||
+ VariableClMakeProfile(systemRoot=systemRoot),
|
||||
VariableOsLinuxShortname(systemRoot=systemRoot),
|
||||
VariableOsLinuxName(systemRoot=systemRoot),
|
||||
VariableOsLinuxSubname(systemRoot=systemRoot),
|
||||
@@ -238,14 +237,12 @@ class LinuxDataVars(SimpleDataVars):
|
||||
VariableOsLinuxSystem(systemRoot=systemRoot),
|
||||
VariableOsLinuxVer(systemRoot=systemRoot),
|
||||
VariableOsLinuxBuild(systemRoot=systemRoot))
|
||||
- makeprofile = path.join(systemRoot,'etc/make.profile')
|
||||
+ makeprofile = self.Get('cl_make_profile')
|
||||
if os.path.exists(makeprofile):
|
||||
- inifile = path.join(systemRoot,'etc',
|
||||
- os.readlink(path.join(systemRoot,'etc/make.profile')))
|
||||
+ inifile = path.join(systemRoot, 'etc',
|
||||
+ os.readlink(makeprofile))
|
||||
self.flIniFileFrom(inifile)
|
||||
- inifile = "etc/calculate/calculate.env"
|
||||
- self.flIniFileFrom(path.join(systemRoot,inifile))
|
||||
- iniFile = "etc/calculate/calculate3.env"
|
||||
- self.flIniFileFrom(path.join(systemRoot,iniFile))
|
||||
- iniFile = "etc/calculate/calculate2.env"
|
||||
- self.flIniFileFrom(path.join(systemRoot,iniFile))
|
||||
+ for inifile in ("etc/calculate/calculate.env",
|
||||
+ "etc/calculate/calculate3.env",
|
||||
+ "etc/calculate/calculate2.env"):
|
||||
+ self.flIniFileFrom(path.join(systemRoot, inifile))
|
@ -0,0 +1,26 @@
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
EAPI=4
|
||||
|
||||
DESCRIPTION="Calculate Utilities meta package"
|
||||
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="3"
|
||||
KEYWORDS="amd64 x86"
|
||||
IUSE="cl_consolegui cl_client cl_desktop cl_console"
|
||||
|
||||
RDEPEND="${RDEPEND}
|
||||
=sys-apps/calculate-install-3.2.0_alpha4-r1
|
||||
=sys-apps/calculate-i18n-3.2.0_alpha4
|
||||
=sys-apps/calculate-lib-3.2.0_alpha4-r2
|
||||
=sys-apps/calculate-core-3.2.0_alpha4-r1
|
||||
=sys-apps/calculate-update-3.2.0_alpha4-r1
|
||||
cl_client? ( =sys-apps/calculate-client-3.2.0_alpha4 )
|
||||
cl_desktop? ( =sys-apps/calculate-desktop-3.2.0_alpha4 )
|
||||
cl_consolegui? ( =sys-apps/calculate-console-gui-3.2.0_alpha4 )
|
||||
cl_console? ( =sys-apps/calculate-console-3.2.0_alpha4-r1 )
|
||||
"
|
Loading…
Reference in new issue