parent
326246912d
commit
1cda1cb8cc
@ -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)
|
@ -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
|
||||
|
Loading…
Reference in new issue