parent
085cb73e49
commit
6bbe0d6425
@ -0,0 +1,44 @@
|
||||
# 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 installation Calculate Linux"
|
||||
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="3"
|
||||
KEYWORDS=""
|
||||
IUSE="pxe minimal"
|
||||
|
||||
DEPEND="~sys-apps/calculate-core-3.1.1_alpha2
|
||||
!<sys-apps/calculate-install-2.2.29
|
||||
app-portage/layman
|
||||
!app-misc/livecd-tools
|
||||
sys-apps/iproute2[-minimal]
|
||||
!minimal? ( sys-boot/grub
|
||||
sys-apps/gptfdisk
|
||||
>=sys-apps/util-linux-2.19.1
|
||||
sys-fs/dosfstools
|
||||
sys-fs/squashfs-tools
|
||||
sys-block/parted )
|
||||
pxe? ( sys-apps/calculate-server
|
||||
net-ftp/tftp-hpa
|
||||
net-misc/dhcp
|
||||
net-fs/nfs-utils )"
|
||||
|
||||
RDEPEND="${DEPEND}"
|
||||
src_unpack() {
|
||||
unpack "${A}"
|
||||
cd "${S}"
|
||||
|
||||
# apply revision changes
|
||||
epatch "${FILESDIR}/calculate-install-3.1.1_alpha2-r4.patch"
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
diff --git data/calculate data/calculate
|
||||
index c2d6505..1ec60b3 100644
|
||||
--- data/calculate
|
||||
+++ data/calculate
|
||||
@@ -136,7 +136,8 @@ start() {
|
||||
|
||||
# reinit net.* services
|
||||
local roottype=`variable_value main.os_root_type`
|
||||
- if [[ $roottype == "livecd" ]]
|
||||
+ local rootdev=`variable_value main.os_root_dev`
|
||||
+ if [[ $roottype == "livecd" ]] && [[ $rootdev == "/dev/nfs" ]]
|
||||
then
|
||||
touch /* /bin/* /sbin/*
|
||||
udevadm trigger --action="add" --subsystem-match=net
|
||||
diff --git install/cl_wsdl_install.py install/cl_wsdl_install.py
|
||||
index a007be4..d4c117d 100644
|
||||
--- install/cl_wsdl_install.py
|
||||
+++ install/cl_wsdl_install.py
|
||||
@@ -192,7 +192,8 @@ class Wsdl:
|
||||
|
||||
@rpc(Integer, InstallInfo, _returns = Array(ReturnedMessage))
|
||||
@core_method(category=__('Installation'),title=__('Flash install'),
|
||||
- image='drive-removable-media-usb-pendrive,media-flash',
|
||||
+ image='drive-removable-media-usb-pendrive,'
|
||||
+ 'drive-removable-media-usb,media-flash',
|
||||
gui=True, rights=['install'])
|
||||
def install_flash ( self, sid, info):
|
||||
"""
|
||||
@@ -220,7 +221,8 @@ class Wsdl:
|
||||
|
||||
@rpc(Integer, InstallInfo, _returns = Array(ReturnedMessage))
|
||||
@core_method(category=__('Installation'),title=__('PXE install'),
|
||||
- image='network-server',command='cl-install-pxe',
|
||||
+ image='network-server,preferences-desktop-remote-desktop',
|
||||
+ command='cl-install-pxe',
|
||||
gui=True, rights=['installpxe'])
|
||||
def install_pxe ( self, sid, info):
|
||||
"""
|
||||
@@ -251,7 +253,8 @@ class Wsdl:
|
||||
|
||||
@rpc(Integer, InstallInfo, _returns = Array(ReturnedMessage))
|
||||
@core_method(category=__('Configuration'),title=__('Network'),
|
||||
- image='network-idle,preferences-system-network',
|
||||
+ image='gnome-network-properties,'
|
||||
+ 'network-idle,preferences-system-network',
|
||||
command="cl-setup-network",
|
||||
gui=True, rights=['setup'])
|
||||
def setup_network ( self, sid, info):
|
||||
@@ -281,7 +284,7 @@ class Wsdl:
|
||||
|
||||
@rpc(Integer, InstallInfo, _returns = Array(ReturnedMessage))
|
||||
@core_method(category=__('Configuration'),title=__('Video'),
|
||||
- image='gnome-multimedia,video-display',
|
||||
+ image='video-display,gnome-multimedia',
|
||||
command="cl-setup-video",
|
||||
gui=True, rights=['setup'])
|
||||
def setup_video ( self, sid, info):
|
||||
@@ -369,7 +372,7 @@ class Wsdl:
|
||||
|
||||
@rpc(Integer, InstallInfo, _returns = Array(ReturnedMessage))
|
||||
@core_method(category=__('Configuration'),title=__('System'),
|
||||
- image='system,computer',command="cl-setup-system",
|
||||
+ image='system-run,system,computer',command="cl-setup-system",
|
||||
gui=True, rights=['setup'])
|
||||
def setup_system ( self, sid, info):
|
||||
"""
|
||||
diff --git install/variables/distr.py install/variables/distr.py
|
||||
index 71423b2..0e0693c 100644
|
||||
--- install/variables/distr.py
|
||||
+++ install/variables/distr.py
|
||||
@@ -121,18 +121,21 @@ class DistroRepository(Linux):
|
||||
if not d:
|
||||
return False
|
||||
# check filter conditions
|
||||
- if system and systemByName(d['name']) != system:
|
||||
+ if system and systemByName(d['os_linux_shortname']) != system:
|
||||
return False
|
||||
- if not "name" in d or not "ver" in d:
|
||||
+ if not "os_linux_shortname" in d or not "os_linux_ver" in d:
|
||||
return False
|
||||
- if shortname and d['name'].lower() != shortname.lower():
|
||||
+ if shortname and \
|
||||
+ d['os_linux_shortname'].lower() != shortname.lower():
|
||||
return False
|
||||
- if march and d['march'] != march:
|
||||
+ if march and d['os_arch_machine'] != march:
|
||||
return False
|
||||
- if version and not verCmp(getTupleVersion(d['ver']), version):
|
||||
+ if version and \
|
||||
+ not verCmp(getTupleVersion(d['os_linux_ver']), version):
|
||||
return False
|
||||
- if build and "build" in d and (not d['build'].isdigit() or
|
||||
- not buildCmp(int(d['build']),build)):
|
||||
+ if build and "os_linux_build" in d and \
|
||||
+ (not d['os_linux_build'].isdigit() or
|
||||
+ not buildCmp(int(d['os_linux_build']),build)):
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -167,11 +170,11 @@ class DistroRepository(Linux):
|
||||
|
||||
def sortdistrfunc(self,x,y):
|
||||
"""Func of comparing two distributive"""
|
||||
- ver1, ver2 = x[1].get('ver',""), y[1].get('ver',"")
|
||||
+ ver1, ver2 = x[1].get('os_linux_ver',""), y[1].get('os_linux_ver',"")
|
||||
if ver1 and ver2 and ver1 != "0" and ver2 != "0" and ver1 != ver2:
|
||||
return cmpVersion(ver1,ver2)
|
||||
- build1 = getTupleVersion(x[1].get('build',""))
|
||||
- build2 = getTupleVersion(y[1].get('build',""))
|
||||
+ build1 = getTupleVersion(x[1].get('os_linux_build',""))
|
||||
+ build2 = getTupleVersion(y[1].get('os_linux_build',""))
|
||||
if build1 != build2:
|
||||
return cmp(build1,build2)
|
||||
else:
|
||||
diff --git install/variables/system.py install/variables/system.py
|
||||
index 130439a..5e0dd96 100644
|
||||
--- install/variables/system.py
|
||||
+++ install/variables/system.py
|
||||
@@ -25,6 +25,7 @@ from calculate.lib.utils.files import (readFile,getProgPath,process,
|
||||
readLinesFile)
|
||||
from calculate.lib.utils.common import getPasswdUsers,getUserGroups,getGroups
|
||||
from calculate.lib.utils.portage import isPkgInstalled
|
||||
+from calculate.lib.utils.device import getUdevDeviceInfo
|
||||
from crypt import crypt
|
||||
from calculate.lib.encrypt import encrypt
|
||||
import calculate.lib.cl_template as cl_template
|
||||
@@ -371,6 +372,8 @@ class VariableOsInstallDevFrom(Variable):
|
||||
"""
|
||||
If device in calculate3.env dev_from not exists set ''
|
||||
"""
|
||||
+ if value:
|
||||
+ value = getUdevDeviceInfo(name=value).get('DEVNAME',value)
|
||||
if value in self.Get('os_disk_dev'):
|
||||
return value
|
||||
else:
|
@ -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-r9.patch"
|
||||
}
|
@ -0,0 +1,225 @@
|
||||
diff --git calculate/lib/cl_template.py calculate/lib/cl_template.py
|
||||
index 24ad307..223266a 100644
|
||||
--- calculate/lib/cl_template.py
|
||||
+++ calculate/lib/cl_template.py
|
||||
@@ -40,7 +40,7 @@ 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)
|
||||
+ pathJoin,readFile,process,STDOUT)
|
||||
from datavars import DataVarsError
|
||||
|
||||
from calculate.lib.cl_lang import setLocalTranslate
|
||||
@@ -2181,6 +2181,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:")
|
||||
@@ -2756,7 +2760,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
|
||||
@@ -2799,6 +2804,31 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
|
||||
else:
|
||||
return ""
|
||||
|
||||
+ def funcWorld(self, funArgv, resS, localVars, textTemplateTmp, nameTemp):
|
||||
+ """
|
||||
+ Function for world generation
|
||||
+ """
|
||||
+ # source file
|
||||
+ fileName = funArgv.replace(" ","")
|
||||
+ source = readFile(fileName)
|
||||
+ replace = []
|
||||
+
|
||||
+ for line in filter(None,
|
||||
+ filter(lambda x:not x.startswith('#'),
|
||||
+ map(lambda x:x.strip(),
|
||||
+ source.split('\n')))):
|
||||
+ category, spl, nameProg = line.partition("/")
|
||||
+ nameProg, spl, slot = nameProg.partition(":")
|
||||
+ if not category in self.installCategory:
|
||||
+ self.getInstallPkgGentoo(category=category)
|
||||
+ self.installCategory.append(category)
|
||||
+ if self.pkg(nameProg, slot=slot or None):
|
||||
+ replace.append(line)
|
||||
+
|
||||
+ textTemplateTmp = textTemplateTmp[:resS.start()] + "\n".join(replace) +\
|
||||
+ textTemplateTmp[resS.end():]
|
||||
+ return textTemplateTmp
|
||||
+
|
||||
def funcPkg(self, funArgv, resS, localVars, textTemplateTmp, nameTemp):
|
||||
"""Функция шаблона pkg(), выдает номер версии программы"""
|
||||
# Название программы
|
||||
@@ -2810,6 +2840,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 +2925,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 +3714,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 "$*"
|
||||
@@ -4281,6 +4338,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:
|
||||
@@ -5052,7 +5114,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 +5122,8 @@ gettext -d cl_template "$*"
|
||||
newTemplate.decode("UTF-8")
|
||||
except:
|
||||
return False
|
||||
- return True
|
||||
+ return True
|
||||
+ return False
|
||||
|
||||
def joinTemplate(self, nameFileTemplate, nameFileConfig, optFile={}):
|
||||
"""Объединения шаблона и конф. файла
|
||||
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..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"
|
@ -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-r9
|
||||
=sys-apps/calculate-core-3.1.1_alpha2-r1
|
||||
=sys-apps/calculate-update-3.1.1_alpha2-r2
|
||||
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