parent
3c4cc58140
commit
444326cf20
@ -0,0 +1,37 @@
|
||||
# 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 setting and storing the user account in the domain"
|
||||
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="3"
|
||||
KEYWORDS=""
|
||||
|
||||
DEPEND="~sys-apps/calculate-desktop-3.1.3_alpha1
|
||||
!<sys-apps/calculate-client-3.1.0_alpha2
|
||||
>=dev-python/python-ldap-2.0[ssl]
|
||||
>=sys-auth/pam_ldap-180[ssl]
|
||||
>=sys-auth/nss_ldap-239
|
||||
>=sys-apps/keyexec-0.1.2
|
||||
sys-apps/keyutils
|
||||
sys-auth/pam_keystore
|
||||
dev-lang/swig"
|
||||
|
||||
RDEPEND="${DEPEND}"
|
||||
src_unpack() {
|
||||
unpack "${A}"
|
||||
cd "${S}"
|
||||
|
||||
# apply revision changes
|
||||
epatch "${FILESDIR}/calculate-client-3.1.3_alpha1-r1.patch"
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
diff --git client/cl_client.py client/cl_client.py
|
||||
index f0f54b1..5b0bd7e 100644
|
||||
--- client/cl_client.py
|
||||
+++ client/cl_client.py
|
||||
@@ -371,8 +371,9 @@ class Client(commandServer, encrypt):
|
||||
self.startTask(_("Applying non-domain templates"),progress=True)
|
||||
if self.clTempl:
|
||||
self.closeClTemplate()
|
||||
+ self.clVars.Set('cl_autoupdate_set','on',True)
|
||||
self.clTempl = ProgressTemplate(self.setProgress,self.clVars,
|
||||
- cltObj=True,
|
||||
+ cltObj=True,cltFilter=True,
|
||||
printSUCCESS=self.printSUCCESS,
|
||||
printERROR=self.printERROR,
|
||||
askConfirm=self.askConfirm,
|
@ -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.3_alpha1
|
||||
>=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.3_alpha1-r1.patch"
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
diff --git core/server/replace_class.py core/server/replace_class.py
|
||||
index fe997ac..f374210 100644
|
||||
--- core/server/replace_class.py
|
||||
+++ core/server/replace_class.py
|
||||
@@ -21,6 +21,7 @@ from api_types import ViewInfo
|
||||
from calculate.core.client.progressbar import Bar,Percentage,ETA,ProgressBar
|
||||
from calculate.lib.cl_progressbar import ClProgressDialog,ClMessageBox
|
||||
from calculate.lib.utils.text import tableReport
|
||||
+from calculate.lib.utils.files import getch
|
||||
from cert_cmd import parse
|
||||
import sys, termios
|
||||
import os
|
||||
@@ -295,13 +296,25 @@ class replaceClass():
|
||||
def askChoice(self,message,answers=[("yes","Yes"),("no","No")]):
|
||||
colorPrint = color_print()
|
||||
print
|
||||
+ # ability answer by first letter
|
||||
+ answerByChar = map(lambda x:x[0][0],answers)
|
||||
+ if filter(lambda x:answerByChar.count(x) > 1,answerByChar):
|
||||
+ useGetChar = False
|
||||
+ else:
|
||||
+ useGetChar = True
|
||||
while True:
|
||||
- try:
|
||||
- ask = raw_input(message+ ' (%s): '%
|
||||
- ("/".join(map(lambda x:x[1],answers))))
|
||||
- except KeyboardInterrupt:
|
||||
- ask = answers[-1][1]
|
||||
+ outMessage = message+ ' (%s): '% \
|
||||
+ ("/".join(map(lambda x:x[1],answers)))
|
||||
+ if useGetChar:
|
||||
+ colorPrint.defaultPrint(outMessage)
|
||||
+ ask = getch()
|
||||
print
|
||||
+ else:
|
||||
+ try:
|
||||
+ ask = raw_input(outMessage)
|
||||
+ except KeyboardInterrupt:
|
||||
+ ask = answers[-1][1]
|
||||
+ print
|
||||
ask = ask.lower()
|
||||
likeAnswers = filter(lambda x:x[0].startswith(ask),answers)
|
||||
if not likeAnswers:
|
||||
diff --git core/server/setup_package.py core/server/setup_package.py
|
||||
index 1d78dbb..2c5f88c 100644
|
||||
--- core/server/setup_package.py
|
||||
+++ core/server/setup_package.py
|
||||
@@ -199,6 +199,7 @@ class updateUserConfigs(shareUpdateConfigs):
|
||||
True)
|
||||
else:
|
||||
clVars.Set("cl_merge_pkg", ["%s/%s"%(category,nameProgram)], True)
|
||||
+ clVars.Set("cl_merge_set","on",True)
|
||||
clTempl = ChainProgressTemplate( self.startTask,
|
||||
self.endTask,
|
||||
self.setProgress,
|
||||
@@ -385,6 +386,7 @@ class updateSystemConfigs(shareUpdateConfigs):
|
||||
True)
|
||||
else:
|
||||
clVars.Set("cl_merge_pkg", ["%s/%s"%(category,nameProgram)], True)
|
||||
+ clVars.Set("cl_merge_set","on",True)
|
||||
clVars.Set("cl_action", 'merge', True)
|
||||
configFiles = []
|
||||
nameProg = clVars.Get("cl_name")
|
@ -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.3_alpha1
|
||||
!<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.3_alpha1-r1.patch"
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
diff --git data/calculate data/calculate
|
||||
index dc36f4c..a1a2537 100644
|
||||
--- data/calculate
|
||||
+++ data/calculate
|
||||
@@ -127,12 +127,11 @@ start() {
|
||||
LANG=C /usr/sbin/cl-core --create-symlink &>/dev/null
|
||||
install_video_driver
|
||||
LANG=C create_nonroot_user
|
||||
- LANG=C /usr/sbin/cl-core --method setup_system --no-progress --live on
|
||||
+ LANG=C /usr/sbin/cl-core --method setup_system --no-progress --replace-conf --live on
|
||||
LANG=C configure_users
|
||||
|
||||
/usr/sbin/env-update
|
||||
source /etc/profile
|
||||
- /sbin/update-modules
|
||||
|
||||
# reinit net.* services
|
||||
local roottype=`variable_value main.os_root_type`
|
||||
diff --git install/cl_install.py install/cl_install.py
|
||||
index f0d8d64..f4a511b 100644
|
||||
--- install/cl_install.py
|
||||
+++ install/cl_install.py
|
||||
@@ -192,13 +192,14 @@ class Install(color_print):
|
||||
True)
|
||||
|
||||
self.clTempl = ProgressTemplate(self.setProgress, self.clVars,
|
||||
- cltObj=useClt,
|
||||
- cltFilter=False,
|
||||
- printSUCCESS=self.printSUCCESS,
|
||||
- printWARNING=self.printWARNING,
|
||||
- askConfirm=self.askConfirm,
|
||||
- dispatchConf=self.dispatchConf,
|
||||
- printERROR=self.printERROR)
|
||||
+ cltObj=useClt,
|
||||
+ cltFilter=True if self.clVars.Get('cl_merge_set') == "on" \
|
||||
+ else False,
|
||||
+ printSUCCESS=self.printSUCCESS,
|
||||
+ printWARNING=self.printWARNING,
|
||||
+ askConfirm=self.askConfirm,
|
||||
+ dispatchConf=self.dispatchConf,
|
||||
+ printERROR=self.printERROR)
|
||||
|
||||
dirsFiles = self.clTempl.applyTemplates()
|
||||
try:
|
||||
diff --git install/cl_wsdl_install.py install/cl_wsdl_install.py
|
||||
index e6b08e9..a8b23d9 100644
|
||||
--- install/cl_wsdl_install.py
|
||||
+++ install/cl_wsdl_install.py
|
||||
@@ -243,7 +243,8 @@ class Wsdl:
|
||||
dv.importInstall()
|
||||
dv.flIniFile()
|
||||
dv.Set('cl_action','merge',True)
|
||||
- dv.Set('cl_belong_pkg',[None],True)
|
||||
+ dv.Set('cl_merge_pkg',[None],True)
|
||||
+ dv.Set('cl_merge_set',"on",True)
|
||||
dv.Set('cl_setup','network',True)
|
||||
dv.addGroup(None,
|
||||
normal=('os_install_net_conf','os_install_net_data',
|
||||
@@ -276,7 +277,8 @@ class Wsdl:
|
||||
dv.importInstall()
|
||||
dv.flIniFile()
|
||||
dv.Set('cl_action','merge',True)
|
||||
- dv.Set('cl_belong_pkg',[None],True)
|
||||
+ dv.Set('cl_merge_pkg',[None],True)
|
||||
+ dv.Set('cl_merge_set',"on",True)
|
||||
dv.Set('cl_setup','video',True)
|
||||
dv.addGroup(None,
|
||||
normal=('os_install_x11_video_drv', 'os_install_x11_resolution',
|
||||
@@ -306,7 +308,8 @@ class Wsdl:
|
||||
dv.importInstall()
|
||||
dv.flIniFile()
|
||||
dv.Set('cl_action','merge',True)
|
||||
- dv.Set('cl_belong_pkg',[None],True)
|
||||
+ dv.Set('cl_merge_pkg',[None],True)
|
||||
+ dv.Set('cl_merge_set',"on",True)
|
||||
dv.Set('cl_setup','locale',True)
|
||||
dv.addGroup(None,
|
||||
normal=('os_install_locale_lang',
|
||||
@@ -336,7 +339,8 @@ class Wsdl:
|
||||
dv.importInstall()
|
||||
dv.flIniFile()
|
||||
dv.Set('cl_action','merge',True)
|
||||
- dv.Set('cl_belong_pkg',[None],True)
|
||||
+ dv.Set('cl_merge_pkg',[None],True)
|
||||
+ dv.Set('cl_merge_set',"on",True)
|
||||
dv.Set('cl_setup','boot',True)
|
||||
dv.addGroup(None,
|
||||
normal=('os_install_mbr',
|
||||
diff --git install/variables/locale.py install/variables/locale.py
|
||||
index 6c740e9..916985d 100644
|
||||
--- install/variables/locale.py
|
||||
+++ install/variables/locale.py
|
||||
@@ -213,7 +213,8 @@ class VariableOsInstallClockTimezone(LocaleVariable):
|
||||
"Atlantic/Azores", "Atlantic/Cape_Verde", "UTC",
|
||||
"Africa/Casablanca", "Europe/Amsterdam", "Europe/Belgrade",
|
||||
"Europe/Brussels", "Europe/Zagreb", "Africa/Tunis",
|
||||
- "Asia/Amman", "Europe/Istanbul", "Asia/Beirut", "Europe/Kiev",
|
||||
+ "Asia/Amman", "Europe/Istanbul", "Asia/Beirut",
|
||||
+ "Europe/Helsinki", "Europe/Kiev",
|
||||
"Africa/Windhoek", "Asia/Jerusalem", "Africa/Cairo",
|
||||
"Europe/Minsk", "Africa/Harare", "Asia/Baghdad", "Asia/Kuwait",
|
||||
"Europe/Moscow", "Africa/Nairobi", "Asia/Tbilisi",
|
@ -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.3_alpha1-r1.patch"
|
||||
}
|
@ -0,0 +1,275 @@
|
||||
diff --git calculate/lib/cl_template.py calculate/lib/cl_template.py
|
||||
index 2ca8405..6c11c24 100644
|
||||
--- calculate/lib/cl_template.py
|
||||
+++ calculate/lib/cl_template.py
|
||||
@@ -39,7 +39,7 @@ from operator import lt, le, eq, ne, ge, gt
|
||||
from utils.common import _error, _warning
|
||||
from utils.text import _toUNICODE, convertStrListDict
|
||||
from utils.portage import isPkgInstalled,reVerSplitToPV
|
||||
-from utils.content import PkgContents,checkContents,getCfgFiles
|
||||
+from utils.content import PkgContents,checkContents,getCfgFiles,fillContents
|
||||
from utils.files import (getModeFile, listDirectory,removeDir, typeFile,
|
||||
scanDirectory,
|
||||
pathJoin,readFile,readLinesFile,process,STDOUT)
|
||||
@@ -3798,6 +3798,7 @@ class Template(_file,_terms,_warning,xmlShare,templateFormat,_shareTemplate):
|
||||
templDirNameFile = ".calculate_directory"
|
||||
titleEnd = "For modify this file, create %(conf_path)s.clt template."
|
||||
protectPaths = []
|
||||
+ allContents = {}
|
||||
if "CONFIG_PROTECT" in os.environ:
|
||||
protectPaths = ["/etc"] + filter(lambda x: x.strip(),
|
||||
os.environ["CONFIG_PROTECT"].split(" "))
|
||||
@@ -3808,6 +3809,7 @@ class Template(_file,_terms,_warning,xmlShare,templateFormat,_shareTemplate):
|
||||
printSUCCESS=lambda x:x,printWARNING=lambda x:x,
|
||||
printERROR=lambda x:x,askConfirm=lambda x:x,
|
||||
userProfile=False,dispatchConf=None):
|
||||
+ self.protectPaths = objVar.Get('cl_config_protect')
|
||||
self.userProfile = userProfile
|
||||
self.dispatchConf = dispatchConf
|
||||
self.changedFiles = ChangedFiles()
|
||||
@@ -4126,8 +4128,9 @@ gettext -d cl_template "$*"
|
||||
flagFoundPath = True
|
||||
break
|
||||
if flagFoundPath:
|
||||
+ origConfigPath = PkgContents.reCfg.sub("/",configPath)
|
||||
commentList = commentList +\
|
||||
- [self.titleEnd%{'conf_path':configPath}]
|
||||
+ [self.titleEnd%{'conf_path':origConfigPath}]
|
||||
if comment:
|
||||
commentFirst = comment
|
||||
commentInsert = comment
|
||||
@@ -4196,8 +4199,8 @@ gettext -d cl_template "$*"
|
||||
|
||||
def fixNameFileConfig(self,origfilename):
|
||||
"""Support ._cfg0000 files for postinst"""
|
||||
- if self.objVar.Get('cl_ebuild_phase') != 'postinst':
|
||||
- return origfilename
|
||||
+ #if self.objVar.Get('cl_ebuild_phase') != 'postinst':
|
||||
+ # return origfilename
|
||||
directory,filename = os.path.split(origfilename)
|
||||
i = 0
|
||||
for i in range(0,9999):
|
||||
@@ -4210,7 +4213,7 @@ gettext -d cl_template "$*"
|
||||
return origfilename
|
||||
origstat = os.stat(origfilename)[stat.ST_CTIME]
|
||||
newstat = os.stat(filename)[stat.ST_CTIME]
|
||||
- if newstat > origstat:
|
||||
+ if newstat >= origstat:
|
||||
self.configMode = T_CFG
|
||||
return filename
|
||||
return origfilename
|
||||
@@ -4416,23 +4419,26 @@ gettext -d cl_template "$*"
|
||||
if self.cltFilter:
|
||||
# Шаблоны + .clt которые будут применены
|
||||
self.cltObj.filterApplyTemplates = {}
|
||||
- for pkg in self.objVar.Get('cl_merge_pkg'):
|
||||
- category = isPkgInstalled(pkg)
|
||||
- if category:
|
||||
- pkgContents = PkgContents("{CATEGORY}/{PF}".format(
|
||||
- **category[0]))
|
||||
- for filename in pkgContents.content.keys():
|
||||
- if not filename in self.cltObj.filterApplyTemplates:
|
||||
- self.cltObj.filterApplyTemplates[filename] = []
|
||||
- self.cltObj.filterApplyTemplates[filename].append(pkg)
|
||||
- for filename,pkgs in self.changedFiles.data.items():
|
||||
- if not filename in self.cltObj.filterApplyTemplates:
|
||||
- self.cltObj.filterApplyTemplates[filename] = []
|
||||
- pkgs = filter(lambda x:not x in \
|
||||
- self.cltObj.filterApplyTemplates[filename],
|
||||
- map(lambda x:x[0],pkgs))
|
||||
- self.cltObj.filterApplyTemplates[filename].extend(pkgs)
|
||||
-
|
||||
+ if self.objVar.Get('cl_merge_set') == "on":
|
||||
+ for pkg in self.objVar.Get('cl_merge_pkg'):
|
||||
+ if not pkg:
|
||||
+ continue
|
||||
+ category = isPkgInstalled(pkg)
|
||||
+ if category:
|
||||
+ pkgContents = PkgContents("{CATEGORY}/{PF}".format(
|
||||
+ **category[0]))
|
||||
+ for filename in pkgContents.content.keys():
|
||||
+ if not filename in self.cltObj.filterApplyTemplates:
|
||||
+ self.cltObj.filterApplyTemplates[filename] = []
|
||||
+ self.cltObj.filterApplyTemplates[filename].append(pkg)
|
||||
+ for filename,pkgs in self.changedFiles.data.items():
|
||||
+ filename = PkgContents.reCfg.sub("/",filename)
|
||||
+ if not filename in self.cltObj.filterApplyTemplates:
|
||||
+ self.cltObj.filterApplyTemplates[filename] = []
|
||||
+ pkgs = filter(lambda x:not x in \
|
||||
+ self.cltObj.filterApplyTemplates[filename],
|
||||
+ map(lambda x:x[0],pkgs))
|
||||
+ self.cltObj.filterApplyTemplates[filename].extend(pkgs)
|
||||
self.cltObj.applyTemplates()
|
||||
self.stop = self.stop or self.cltObj.stop
|
||||
if not self.stop and ((self.objVar.Get('cl_merge_pkg') or \
|
||||
@@ -4503,7 +4509,6 @@ gettext -d cl_template "$*"
|
||||
hashlib.md5(readFile(
|
||||
cfgs[filename][0][1])).hexdigest():
|
||||
files.add(filename)
|
||||
- print "Added ",filename
|
||||
|
||||
for filename in list(files&set(cfgs.keys())):
|
||||
# get ctime from orig filename
|
||||
@@ -4988,7 +4993,16 @@ gettext -d cl_template "$*"
|
||||
# not current package file
|
||||
pkg = self.functObj.currentBelong
|
||||
if not pkg:
|
||||
- return pathFile
|
||||
+ if not self.allContents:
|
||||
+ fillContents(self.allContents,
|
||||
+ self.objVar.Get('cl_config_protect'),
|
||||
+ prefix=self.objVar.Get('cl_chroot_path'))
|
||||
+ origName = pathFile if chrootPath == '/' \
|
||||
+ else pathFile[len(chrootPath):]
|
||||
+ if origName in self.allContents:
|
||||
+ pkg = self.allContents[origName]
|
||||
+ else:
|
||||
+ return pathFile
|
||||
pkg = isPkgInstalled(pkg,sortByVersion=True,prefix=chrootPath)
|
||||
if not pkg:
|
||||
return pathFile
|
||||
@@ -5900,8 +5914,10 @@ class scanDirectoryClt:
|
||||
statInfo = stInfo[stat.ST_MODE]
|
||||
if fileOrDir.endswith(self.extFileTemplate) and\
|
||||
stat.S_ISREG(statInfo):
|
||||
- if not self.filterApplyTemplates or\
|
||||
- absPath[:-self.lenExtFileTemplate] in\
|
||||
+ if not self.filterApplyTemplates and \
|
||||
+ self.objVar.Get('cl_merge_set') == 'off' or \
|
||||
+ self.filterApplyTemplates and \
|
||||
+ absPath[:-self.lenExtFileTemplate] in\
|
||||
self.filterApplyTemplates.keys() or self.hasBelong(absPath):
|
||||
prevDefault = self.objVar.defaultModule
|
||||
if not self.processingFile(absPath, prefix):
|
||||
@@ -5953,7 +5969,7 @@ class templateClt(scanDirectoryClt, Template):
|
||||
return False
|
||||
if prefix and prefix[-1] == "/":
|
||||
prefix = prefix[:-1]
|
||||
- if prefix:
|
||||
+ if prefix and path.startswith(prefix):
|
||||
nameFileConfig = path.partition(prefix)[2]
|
||||
else:
|
||||
nameFileConfig = path
|
||||
@@ -5975,6 +5991,18 @@ class templateClt(scanDirectoryClt, Template):
|
||||
if origFileName in self.filterApplyTemplates:
|
||||
for pkg in self.filterApplyTemplates[origFileName]:
|
||||
self._addFile(filesApl,pkg=pkg)
|
||||
+ else:
|
||||
+ if not self.allContents:
|
||||
+ fillContents(self.allContents,
|
||||
+ self.objVar.Get('cl_config_protect'),
|
||||
+ prefix=self.objVar.Get('cl_chroot_path'))
|
||||
+ for fn in filesApl:
|
||||
+ fn_orig = PkgContents.reCfg.sub('/',fn)
|
||||
+ if self.objVar.Get('cl_chroot_path') != '/':
|
||||
+ fn_orig = \
|
||||
+ fn_orig[len(self.objVar.Get('cl_chroot_path')):]
|
||||
+ if fn_orig in self.allContents:
|
||||
+ self._addFile([fn],pkg=self.allContents[fn_orig])
|
||||
# Настоящее имя конфигурационного файла
|
||||
nameFileConfig = filesApl[0]
|
||||
# Пишем время модификации *.env файлов
|
||||
diff --git calculate/lib/utils/content.py calculate/lib/utils/content.py
|
||||
index c8d316a..2bec6e0 100644
|
||||
--- calculate/lib/utils/content.py
|
||||
+++ calculate/lib/utils/content.py
|
||||
@@ -16,9 +16,11 @@
|
||||
|
||||
from calculate.lib.utils.files import (readLinesFile,readFile,pathJoin,
|
||||
process)
|
||||
+from calculate.lib.utils.portage import reVerSplit
|
||||
from itertools import *
|
||||
from os import path
|
||||
import os
|
||||
+import glob
|
||||
import re
|
||||
import hashlib
|
||||
|
||||
@@ -113,9 +115,9 @@ class PkgContents:
|
||||
"""
|
||||
Add object to content
|
||||
"""
|
||||
- filename = self._fixNameByPrefix(filename)
|
||||
- newfilename = pathJoin(self.prefix,filename)
|
||||
if filename != '/':
|
||||
+ filename = self._fixNameByPrefix(filename)
|
||||
+ newfilename = pathJoin(self.prefix,filename)
|
||||
self.addDir(path.dirname(filename))
|
||||
if path.islink(newfilename):
|
||||
self.addLink(filename)
|
||||
@@ -168,3 +170,21 @@ def getCfgFiles(protected_dirs=['/etc'],prefix='/'):
|
||||
mapCfg[origFilename] = []
|
||||
mapCfg[origFilename].append((int(filetime.split('.')[0]),filename))
|
||||
return mapCfg
|
||||
+
|
||||
+
|
||||
+def fillContents(allContent,protected,prefix='/'):
|
||||
+ """
|
||||
+ Fill dict file - package
|
||||
+ """
|
||||
+ dbPath = pathJoin(prefix,'var/db/pkg')
|
||||
+ for contentFile in glob.glob(dbPath+"/*/*/CONTENTS"):
|
||||
+ for objFile in filter(lambda x:x.startswith('obj '),
|
||||
+ readLinesFile(contentFile)):
|
||||
+ res = PkgContents.reObj.search(objFile.strip())
|
||||
+ if res:
|
||||
+ fn = res.groupdict()['filename']
|
||||
+ if filter(lambda x:fn.startswith(x),protected):
|
||||
+ pkg = reVerSplit.search(os.path.dirname(contentFile))
|
||||
+ if pkg:
|
||||
+ pkg = "%s/%s"%(pkg.groups()[:2])
|
||||
+ allContent[fn] = pkg
|
||||
diff --git calculate/lib/utils/files.py calculate/lib/utils/files.py
|
||||
index 24d4eab..938b44a 100644
|
||||
--- calculate/lib/utils/files.py
|
||||
+++ calculate/lib/utils/files.py
|
||||
@@ -794,3 +794,18 @@ def tarLinks(rootpath,archpath,skip=[]):
|
||||
removeDirs)
|
||||
tar.close()
|
||||
return links
|
||||
+
|
||||
+def getch():
|
||||
+ """
|
||||
+ Get char from keyboard
|
||||
+ """
|
||||
+ import sys, tty, termios
|
||||
+
|
||||
+ fd = sys.stdin.fileno()
|
||||
+ old_settings = termios.tcgetattr(fd)
|
||||
+ try:
|
||||
+ tty.setraw(sys.stdin.fileno())
|
||||
+ ch = sys.stdin.read(1)
|
||||
+ finally:
|
||||
+ termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
|
||||
+ return ch
|
||||
diff --git calculate/lib/utils/portage.py calculate/lib/utils/portage.py
|
||||
index 215aea7..403aaf0 100644
|
||||
--- calculate/lib/utils/portage.py
|
||||
+++ calculate/lib/utils/portage.py
|
||||
@@ -26,7 +26,7 @@ from common import getTupleVersion
|
||||
from calculate.lib.cl_lang import setLocalTranslate
|
||||
setLocalTranslate('cl_lib3',sys.modules[__name__])
|
||||
|
||||
-reVerSplit = re.compile(r"^(?:/var/db/pkg/)?(?:(\w+-\w+)/)?(.*?)-(([^-]+?)"
|
||||
+reVerSplit = re.compile(r"^(?:.*/var/db/pkg/)?(?:(\w+-\w+)/)?(.*?)-(([^-]+?)"
|
||||
"(?:-(r\d+))?)(?:.(tbz2))?$",re.S)
|
||||
def reVerSplitToPV(x):
|
||||
"""Convert match from reVerSplit to PV hash"""
|
||||
diff --git calculate/lib/variables/env.py calculate/lib/variables/env.py
|
||||
index dd106ff..41cd4fe 100644
|
||||
--- calculate/lib/variables/env.py
|
||||
+++ calculate/lib/variables/env.py
|
||||
@@ -128,6 +128,13 @@ class VariableClPassFile(Variable):
|
||||
Template file performed at now
|
||||
"""
|
||||
|
||||
+class VariableClMergeSet(ReadonlyVariable):
|
||||
+ """
|
||||
+ Force by package template appling
|
||||
+ """
|
||||
+ type = "bool"
|
||||
+ value = "off"
|
||||
+
|
||||
class VariableClMergePkg(ReadonlyVariable):
|
||||
"""
|
||||
This variable work with template function belong(package_name)
|
@ -1,8 +1,10 @@
|
||||
AUX calculate-update-3.1.3_alpha1-r1.patch 737 SHA256 b0cf4b10ed51f962ccc74a9c8bab6a85b4feebffc13e7ff36751865091a57f55 SHA512 73b2ae616e04487e6f5df1039e420ff7c5182a94c6ed20c9cd23027657aa9c9d3539db59ad4af53ddbebccb15f2b0a28240c269876f5c54ee73d11b63a48de2f WHIRLPOOL f345d8637513ad3f0aeff67fb8e2ca222f2ab8ec98669d86c32301e67bd4d0e9e8ebfd20f0a4911819d6501b31577b658959eea706970bde757401fd36bc08a6
|
||||
DIST calculate-update-3.1.1.tar.bz2 6950 SHA256 eba0351191b915d0af0d78066f3426bda06ae8f3a1a3fa4c40f10167c6ed4fda SHA512 9b67eeeabbc13b4331d3b8b97a72ba62516510ca73950e0f3ab6f91600833265028c85c213878aabe736b45f3f8849dba662678fa6c6deffc12094fb3e962814 WHIRLPOOL 59ef81d8f4af30cf4a7c010104ccb89802442b04344f47602222bc2858ef426b0b318e081ecb026921b4e8ccd740d02cec6544cf239e28954d8d61129ea0fe6b
|
||||
DIST calculate-update-3.1.2.tar.bz2 6958 SHA256 d4bffb7e716c0095402ab6401926d1fdfcc9156b39989749511f9229f1130c56 SHA512 3e03be8a206bbae357f42886966c80c7ce877b1264838152c4aa511e05d19473c48be8bf63d7a9f9a7530e11485e5fc51c3317164229883ff5f307467f1de281 WHIRLPOOL 5186d86ee6a2f9677913a27a79c2074c70e147fe3a92c5ab6919ee5c709f8929aad53c34559c6ad1b3649e98ac70e70ec22c57f3a4f3a9f661038daccba9658d
|
||||
DIST calculate-update-3.1.3_alpha1.tar.bz2 7003 SHA256 68cab12276d681e6e0a0d629648fd75050df12baadd223219b8fbdd2a91b8bf2 SHA512 bd6c4b277a2394f788fd8f03104193d72f243711d13ccd39ea3ee228af6586934fc462bc7b9bd2aeda8359fc2b58f4d4270b59628eed300bb19114e0bcc35b88 WHIRLPOOL 016495d1e6828959ce43cd8e34a207a116130f9273270dc67b7534196c1b6653fb8dd8181ce90eb0fba10f6d393418846f020854fbd127848e9ccf99dae0e4a1
|
||||
EBUILD calculate-update-3.1.1.ebuild 589 SHA256 ccbdee663aa4ea454c8f4d955881a068516452c20b832c1be57605184431fd77 SHA512 07e2cd20862c1f5f3c0c2cf53e04f8307f3bab3d6ef72a33531a410d33470c9f38961ec2d900beee75bf5d6d1bf89d43d88945792259818c5a90b4b3db952100 WHIRLPOOL 7e1f01703bf854cafe171e9d6203760c7617cad8d0983a78aed36ff58ba20f41f0a44f27eb8293b9aed70fe6e38c4f66647210fb7e8243f7eb7acc94278cd03c
|
||||
EBUILD calculate-update-3.1.2.ebuild 589 SHA256 9e9bc2a97b640272b5b9a5e75a05b6e988083c022455b8150421f51edd820239 SHA512 33235545f259238a20431e1c5ea86fc0aa3c0d0c26d49ff2a2a20798b13f92f21be800126f963aba755280c8a2e5e62d601fb986e4fdc25d789b01b6e74c3e63 WHIRLPOOL de0babb4ca23225b941a449ba2080cc53bd66de957eacee1e4422f419395f0369a7f466150318d3c9420500d76c57eaefaebbad595bb663d0a21729d0b575223
|
||||
EBUILD calculate-update-3.1.3_alpha1-r1.ebuild 737 SHA256 045638e2dac1fa9b52978e8d64d57bd70af28a81f6489c0f00bee701c72ef324 SHA512 633289acf4042224cbc1faac2e4ae3883c3e339c1bd78705fa0d927eec44ff4bfa44ddfc23ead68c1ffc83ab0a4e28a14b15fd05bdbd757750da3eed28a1fc7c WHIRLPOOL d7dc6412266d13f38ee9cab4befec028cf24b0037e670264fe0b8ac266dfc9c5888d0639e12eeb6c50da7fda8b2771ac46f2bd320b4da0065967a0e3f766ce52
|
||||
EBUILD calculate-update-3.1.3_alpha1.ebuild 594 SHA256 b6f4eab3a763ad90ae96c15ba32d57a8ec0f234dac4ba30c87b5caf42107e470 SHA512 59a88f821a439c79777c90dcdd28788c57a0c76b4def2dd22dd1778c67cad7fa961368223d22eeb94a7a436bf646a620d971d00c88a24c30d5e6045823dde20b WHIRLPOOL 8ff0a922d1b0b94aff2a9b368ffe976709e4d684038de5c0ef69d99b170d7c8e642c9dd434f6092ffcd17acdb9e12b10c093e9c81551faf8d1d01fa055c448a5
|
||||
EBUILD calculate-update-3.1.9999.ebuild 530 SHA256 f014911ae52c1eadd9615ab1a2c930eb79aab49f509260bd6573eb3985ce2ec8 SHA512 3523efdb19b9646a0d1dba6d6a4664393d07f9aa666392d355b4596cb1bca8cd80a62bbd7f6db7029c1173ebb2a16e9cf168cea1d7f2c051ba8838c86c234454 WHIRLPOOL a394a23a0277b40cc2e7242b08750638434c3b6bf0f340fec923f90e738618b1cc0e223e327484f95d24f7637e8bebec6dff4b6385b731376f6f8cc8897caf79
|
||||
MISC metadata.xml 288 SHA256 9ea2bfebe4ac64765041ad92dda5b8f22f5597a4e560458f98996b00b0393b8a SHA512 88886b3e137bcf7038cc4985b786523dfac1c127aff84ad682b919d92b2c51b0b8d8f97ff60e7239a2ef49ec40fb5dcc41a59cb428ed346f1e44044ecd75b698 WHIRLPOOL d4eb5ba4901e10fe9cf440c63a8a9a59b5e6620004306eec3cd162cf902a89510460774a8c407816bf15033062dc8f96a334e7f873801bc6bcd73edeb833f36b
|
||||
|
@ -0,0 +1,31 @@
|
||||
# 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 update 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.3_alpha1
|
||||
~sys-apps/calculate-install-3.1.3_alpha1"
|
||||
|
||||
RDEPEND="${DEPEND}"
|
||||
src_unpack() {
|
||||
unpack "${A}"
|
||||
cd "${S}"
|
||||
|
||||
# apply revision changes
|
||||
epatch "${FILESDIR}/calculate-update-3.1.3_alpha1-r1.patch"
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
diff --git update/cl_update.py update/cl_update.py
|
||||
index 4de3d68..36197c6 100644
|
||||
--- update/cl_update.py
|
||||
+++ update/cl_update.py
|
||||
@@ -54,8 +54,9 @@ class Update:
|
||||
if self.clTempl:
|
||||
self.closeClTemplate()
|
||||
self.clVars.Set("cl_chroot_path","/", True)
|
||||
+ self.clVars.Set("cl_merge_set","on",True)
|
||||
self.clTempl = ProgressTemplate(self.setProgress,self.clVars,
|
||||
- cltObj=False,
|
||||
+ cltObj=True,cltFilter=True,
|
||||
printSUCCESS=self.printSUCCESS,
|
||||
printWARNING=self.printWARNING,
|
||||
askConfirm=self.askConfirm,
|
@ -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.3_alpha1-r1
|
||||
=sys-apps/calculate-i18n-3.1.3_alpha1
|
||||
=sys-apps/calculate-lib-3.1.3_alpha1-r1
|
||||
=sys-apps/calculate-core-3.1.3_alpha1-r1
|
||||
=sys-apps/calculate-update-3.1.3_alpha1-r1
|
||||
cl_client? ( =sys-apps/calculate-client-3.1.3_alpha1-r1 )
|
||||
cl_desktop? ( =sys-apps/calculate-desktop-3.1.3_alpha1 )
|
||||
cl_consolegui? ( =sys-apps/calculate-console-gui-3.1.3_alpha1 )
|
||||
cl_console? ( =sys-apps/calculate-console-3.1.3_alpha1 )
|
||||
"
|
Loading…
Reference in new issue