Update calculate-lib.

atratsevskiy
Mike Hiretsky 14 years ago
parent 326246912d
commit 1cda1cb8cc

@ -2,6 +2,13 @@
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
*calculate-lib-2.2.11-r4 (22 Mar 2011)
22 Mar 2011; Mike Hiretsky (mhiretskiy) <mh@calculate.ru>
+calculate-lib-2.2.11-r4.ebuild,
+files/calculate-lib-2.2.11-autoupdate_opt.patch:
Update for autoupdate option.
*calculate-lib-2.2.11-r3 (21 Mar 2011)
21 Mar 2011; Mike Hiretsky (mhiretskiy) <mh@calculate.ru>

@ -1,3 +1,4 @@
AUX calculate-lib-2.2.11-autoupdate_opt.patch 8280 RMD160 f2c4b2f76ca2710a5021e33e5f83e8f768e7297a SHA1 fbc559f597cdac92e0155db2e41c380c878fda5c SHA256 475b9b84f3ebc5ad0f452b145f16ac253876b67272455ad0285c3ec39940a040
AUX calculate-lib-2.2.11-dialog_fix.patch 849 RMD160 cc13018cafddffc603718e788ea77f50882b75d9 SHA1 249f378b1037865d3f084e0e3be3b0f372a92007 SHA256 381f93dce6dae156d9ff743dce5133cc91d1a70cdd0b1fa488d77d5e43d6287b
AUX calculate-lib-2.2.11-feature_for_builder.patch 976 RMD160 e9ef481c18a0296cfe71e2fbf09dca4c46bfec55 SHA1 8ce02b1f12a1c678da206b79a363e7d90e7d7058 SHA256 145430b4c15454de42f0bf75f7904f41ed2a9a2c224553ff93bdc5e31896b699
AUX calculate-lib-2.2.11-fix_C_locale.patch 707 RMD160 a453baa97fb5044a3993c3fb966ae20956086b50 SHA1 6da63f41bead7ab6fe160f124dca32a9f25d2a33 SHA256 2d4fce242b036ccfadd6d6e759e8598c50c48f7875e4b881cbe90e91d3967373
@ -8,7 +9,8 @@ DIST calculate-lib-2.2.11.tar.bz2 107398 RMD160 40692b37b48e299ef95d5074902a254b
EBUILD calculate-lib-2.1.8-r1.ebuild 730 RMD160 a3e9d20526f3078d1f1dc8894a3ac88a090cf968 SHA1 6bc25d2449e5f54df3675311ff5211bc00dcf907 SHA256 764f5b146cc9064de5e1c920ec88b0b91c5fb696c73c853435c7f7750b8bf0db
EBUILD calculate-lib-2.2.11-r2.ebuild 869 RMD160 eee9363f02d2c9dd412a1b1e8be6730567f93a13 SHA1 8c1f8e65b90bd24436e80c4f465fb80821067919 SHA256 e178b8450311d0b7b0a01cad04a154c6ecc79964f6960cafaadb343d5ebae7e3
EBUILD calculate-lib-2.2.11-r3.ebuild 975 RMD160 70a08fd01a445dfbc02e98f738c4e9f681da7ec2 SHA1 57e3ee661c04eef6efe71db4c99b56edd9544431 SHA256 165182e1e64d7ee75da0abc0d33454dc71d0ef42c6b1e5144237402eca398ff8
EBUILD calculate-lib-2.2.11-r4.ebuild 1064 RMD160 30ed0f5167215c68f1817a1438ba77ba6da66b06 SHA1 d5e81561bf9ee4b18d5e5f077393025206d30a41 SHA256 a5efc43dfdf96b83786b33571551727615bb3b77ceeb3daae1015cc37b7ee759
EBUILD calculate-lib-2.2.9999.ebuild 592 RMD160 e559e7ccafdb150093a055b4f90bf33666ab796c SHA1 752fe9e05ce1380af9a44bf5e81a56dc00f36506 SHA256 f4cf5511cca3007b735cf98871ee72442c6bf677be63349058d1bb029a4b1abf
EBUILD calculate-lib-9999.ebuild 476 RMD160 e510e0aa98b7f6da9acc37197073cac0d5d6a47f SHA1 393c416fcfd77d6c05aea8932a7a1e3805aa926d SHA256 a9eee592ec352db7852e93ad33249072307051d3bda6cfdcd034ea9b96747578
MISC ChangeLog 17158 RMD160 97eac92c5986873dca76456c16f19c918a397219 SHA1 44f9a10a1032364e858a36ac7bbe49a04bb179e7 SHA256 de04a511a40bc7c34f5d27f0f877eede21c50749f05343f6fe8e45d41d0809ba
MISC ChangeLog 17378 RMD160 3c8671c93697b15e2ec0bf60b76a58743c7a4b3f SHA1 af22db2703cf7e37d349e3d98dc5d62a634c5e26 SHA256 3e2fc132e153d540d457d2bbe6477578054956fb632df4e32f6f8e99c5d3e550
MISC metadata.xml 303 RMD160 774b65ed76939d6878496ad6ef6451849bdced05 SHA1 7d08569697a290ede98c88ab59db3cdc3037bd15 SHA256 181519d9679fd9aee9a7a9806733a50728d3da0b1e0ad54f31499200f7f5c6ec

@ -0,0 +1,38 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="2"
inherit distutils eutils
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate2/${PN}/${P}.tar.bz2"
DESCRIPTION="The library for Calculate 2"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="2.2"
KEYWORDS="amd64 x86"
IUSE="minimal"
DEPEND="~sys-apps/calculate-templates-2.2.11
!<sys-apps/calculate-lib-2.1.8-r1
!=sys-apps/calculate-lib-2.1.9
!=sys-apps/calculate-lib-2.1.10
!minimal? ( dev-python/py-smbpasswd )
>=dev-python/pyxml-0.8
sys-apps/file[python]"
RDEPEND="${DEPEND}"
src_unpack() {
unpack "${A}"
cd "${S}"
# dialog yes/no fix patch
epatch "${FILESDIR}/calculate-lib-2.2.11-dialog_fix.patch"
# fix C locale
epatch "${FILESDIR}/calculate-lib-2.2.11-fix_C_locale.patch"
# add feature for calculate-builder
epatch "${FILESDIR}/calculate-lib-2.2.11-feature_for_builder.patch"
# add option autoupdate
epatch "${FILESDIR}/calculate-lib-2.2.11-autoupdate_opt.patch"
}

@ -0,0 +1,181 @@
commit cad7de2f1308af6424c56bca6bcf732da14b8c8b
Author: Самоукин Алексей <as@calculate.ru>
Date: Tue Mar 22 13:53:14 2011 +0300
Added template header option autoupdate.
diff --git a/pym/cl_template.py b/pym/cl_template.py
index fb6b55a..cd34257 100644
--- a/pym/cl_template.py
+++ b/pym/cl_template.py
@@ -436,7 +436,7 @@ class fileHeader(_terms):
# Допустимые параметры заголовка
allowParam = ["format", "format_conf", "comment", "append", "force",
"link", "mirror", "symbolic", "chmod", "chown", "name",
- "path"]
+ "path", "autoupdate"]
# Тип шаблона
fileType = ""
@@ -454,7 +454,7 @@ class fileHeader(_terms):
# условные операторы
terms = ('>', '<', '==', '!=', '>=', '<=')
# параметры без значения
- listParNotVal = ("symbolic", "force", "mirror")
+ listParNotVal = ("symbolic", "force", "mirror", "autoupdate")
# Результат вычисления условия в заголовке
headerTerm = True
@@ -610,7 +610,7 @@ class dirHeader(_terms):
"""
# Допустимые параметры заголовка
- allowParam = ["append", "chmod", "chown", "name", "path"]
+ allowParam = ["append", "chmod", "chown", "name", "path", "autoupdate"]
# Тип вставки шаблона
typeAppend = ""
@@ -622,7 +622,7 @@ class dirHeader(_terms):
terms = ('>', '<', '==', '!=', '>=', '<=')
# параметры без значения
- listParNotVal = ("symbolic", "force")
+ listParNotVal = ("symbolic", "force", "autoupdate")
# Результат вычисления условия в заголовке
headerTerm = True
@@ -3545,6 +3545,9 @@ re.M|re.S)
self.cltObj = False
# Фильтровать ли шаблоны clt по конфигурационным файлам обычных шаблонов
self.cltFilter = cltFilter
+ # autoupdate файлы
+ self.autoUpdateFiles = []
+ self.autoUpdateDirs = []
# Преобразование восьмеричного в целое (ввод строка, вывод число)
@@ -3952,6 +3955,10 @@ variable 'cl_name'"))
self.cltObj.functObj = self.functObj
# Словарь примененных файлов шаблонов
self.cltObj.dictProcessedTemplates = self.dictProcessedTemplates
+ self.cltObj.autoUpdateFiles = self.autoUpdateFiles
+ self.cltObj.autoUpdateDirs = self.autoUpdateDirs
+
+
if self.cltFilter:
# Шаблоны + .clt которые будут применены
self.cltObj.filterApplyTemplates +=\
@@ -3977,9 +3984,12 @@ variable 'cl_name'"))
return False
pathDir, objHead = retDir
optDir["path"] = pathDir
- if not objHead is True and objHead.typeAppend == "skip":
- # Установка опции пропуска директории
- optDir["skip"] = True
+ if not objHead is True:
+ if objHead.typeAppend == "skip":
+ # Установка опции пропуска директории
+ optDir["skip"] = True
+ if "autoupdate" in objHead.params:
+ optDir["autoupdate"] = True
if flagDir or stat.S_ISDIR(os.lstat(scanDir)[stat.ST_MODE]):
for fileOrDir in sorted(os.listdir(scanDir)):
absPath = os.path.join(scanDir,fileOrDir)
@@ -4004,9 +4014,12 @@ variable 'cl_name'"))
optNextDir = {}
pathDir, objHead = retDir
optNextDir["path"] = pathDir
- if not objHead is True and objHead.typeAppend == "skip":
- # Установка опции пропуска директории
- optNextDir["skip"] = True
+ if not objHead is True:
+ if objHead.typeAppend == "skip":
+ # Установка опции пропуска директории
+ optNextDir["skip"] = True
+ if "autoupdate" in objHead.params:
+ optNextDir["autoupdate"] = True
ret = self.scanningTemplates(absPath, prefix, True,
optNextDir)
if ret is False:
@@ -4098,6 +4111,7 @@ variable 'cl_name'"))
return True
applyDir = newDir
+
# Родительская директория
if optDir.get("path"):
path = optDir["path"]
@@ -4118,6 +4132,8 @@ variable 'cl_name'"))
crDirs = self.createDir(applyDir, False, self.uid, self.gid)
if not crDirs:
return ("", False, [])
+ if "autoupdate" in optDir:
+ self.autoUpdateDirs.append(applyDir)
if crDirs is True:
return (applyDir, True, [])
else:
@@ -4286,6 +4302,9 @@ variable 'cl_name'"))
createdDirs += crDirs
if not objHead:
applyDir = ""
+ if applyDir:
+ if "autoupdate" in optDir or "autoupdate" in objHead.params:
+ self.autoUpdateDirs.append(applyDir)
return (applyDir, objHead, createdDirs)
def getApplyHeadTemplate(self, nameFileTemplate, nameFileConfig,
@@ -4655,6 +4674,8 @@ variable 'cl_name'"))
self.dictProcessedTemplates[pathOldFile] = []
self.dictProcessedTemplates[pathOldFile].append(nameFileTemplate)
preReturn(pathProg)
+ if "autoupdate" in optFile or "autoupdate" in objHeadNew.params:
+ self.autoUpdateFiles += applyFiles
return (applyFiles, objHeadNew)
def createNewClass(self, name, bases, attrs={}):
diff --git a/pym/update_config/cl_update_config.py b/pym/update_config/cl_update_config.py
index fda54b5..d982f70 100644
--- a/pym/update_config/cl_update_config.py
+++ b/pym/update_config/cl_update_config.py
@@ -356,10 +356,27 @@ class updateSystemConfigs(shareUpdateConfigs):
dstDir = os.path.dirname(dst)
self.createDir(configPath, dstDir)
copy2(src, dst)
- sUid, sGid = getModeFile(src, mode="owner")
+ sMode, sUid, sGid = getModeFile(src)
os.chown(dst, sUid, sGid)
+ os.chmod(dst, sMode)
self.logger.warn(" "*5 + dst)
return True
+
+ def copyDirOrFile(self, src, dst, configPath):
+ if src != dst:
+ if os.path.isfile(src):
+ dstDir = os.path.dirname(dst)
+ self.createDir(configPath, dstDir)
+ copy2(src, dst)
+ sMode, sUid, sGid = getModeFile(src)
+ os.chown(dst, sUid, sGid)
+ os.chmod(dst, sMode)
+ elif os.path.isdir(src):
+ self.createDir(configPath, dst)
+ sMode, sUid, sGid = getModeFile(src)
+ os.chown(dst, sUid, sGid)
+ os.chmod(dst, sMode)
+
def updateConfig(self, nameProgram, category, version, configPath):
"""Обновление системных конфигурационных файлов"""
@@ -410,6 +427,12 @@ class updateSystemConfigs(shareUpdateConfigs):
for errMess in clTempl.getError().splitlines():
self.printERROR(errMess)
return False
+ copyFiles = clTempl.autoUpdateFiles
+ copyDirs = clTempl.autoUpdateDirs
+ allCopyAutoupdateFiles = copyDirs + copyFiles
+ for fileOrDir in allCopyAutoupdateFiles:
+ dst = "/" + fileOrDir.partition(configPath)[2]
+ self.copyDirOrFile(fileOrDir, dst, configPath)
if dirsFiles and dirsFiles[1]:
if not nameAndVerPkg in listIndex:
listIndex.append(nameAndVerPkg)

@ -2,6 +2,13 @@
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
*calculate-utilities-2.2.11-r11 (22 Mar 2011)
22 Mar 2011; Mike Hiretsky (mhiretskiy) <mh@calculate.ru>
-calculate-utilities-2.2.11-r10.ebuild,
+calculate-utilities-2.2.11-r11.ebuild:
Update for lib.
*calculate-utilities-2.2.11-r10 (22 Mar 2011)
22 Mar 2011; Mike Hiretsky (mhiretskiy) <mh@calculate.ru>

@ -1,2 +1,2 @@
EBUILD calculate-utilities-2.2.11-r10.ebuild 838 RMD160 8f664117262e61bc783029321e3fadaa306a8daa SHA1 a7a14bb83f9b28dad1eeb76325b02d96953a34a0 SHA256 9039f32470284cd5b4a7f1671daaa8898a5cb495d201b55f062b0b19f3e2fc7d
MISC ChangeLog 3428 RMD160 34620dd07ca9f9ab4c24f15fea42ba689325408a SHA1 10a707f23fbaf8e5634462efb10970329db2face SHA256 0c56d7101476b9a02a7611514f52216655dcad6d9c269d8d4230dbad42de3d8f
EBUILD calculate-utilities-2.2.11-r11.ebuild 838 RMD160 d587d094ff4703ad819e35b3074bff1919b167b4 SHA1 14a5d8b32849876493e226171452eeac13349581 SHA256 0c5ed169a92b552b006d2a30e13922b8fc4c54d6f271acacdf0ce2bc90b02b8d
MISC ChangeLog 3638 RMD160 5d759834d631548a5a26d4e604965d2b62502535 SHA1 52b3acf6c24b4bfe8d739df6a7690bb1bc7e5caf SHA256 a015ae72c01fd8290f4d491fadd709231697b0a67c571da9f351cc218cc3eadc

@ -23,7 +23,7 @@ cl_server
RDEPEND="${RDEPEND}
=sys-apps/calculate-install-2.2.11
=sys-apps/calculate-templates-2.2.11-r5
=sys-apps/calculate-lib-2.2.11-r3
=sys-apps/calculate-lib-2.2.11-r4
cl_assemble? ( =sys-apps/calculate-assemble-2.2.11-r3 )
cl_builder? ( =sys-apps/calculate-builder-2.2.11-r2 )
Loading…
Cancel
Save