Исправлена обработка protected шаблонов в builder модуле

master3.4 3.4.6.5
Mike Hiretsky 8 years ago
parent 651707ac0c
commit 92870344f5

@ -3007,8 +3007,10 @@ class Template(_file, _terms, _warning, xmlShare, templateFormat,
self.autoUpdateFiles = []
self.autoUpdateDirs = []
self.protectedFiles = self.objVar.Get('main.cl_env_path') + \
[self.functObj.fileConfigIni]
self.protectedFiles = [
pathJoin(self._baseDir, x)
for x in self.objVar.Get('main.cl_env_path')
] + [self.functObj.fileConfigIni]
# список выполненных файлов
self.executedFiles = []
@ -3658,9 +3660,12 @@ gettext -d cl_template "$*"
if category:
pkgContents = PkgContents("{CATEGORY}/{PF}".format(
**category[0]), prefix=chrootPath)
protected = []
for filename, action in self.changedFiles.getPkgFiles(pkg):
if filename in self.protectedFiles:
origFn = pkgContents.origFileName(filename)
if origFn in self.protectedFiles:
pkgContents.removeObject(filename)
protected.append(origFn)
continue
if action in (ChangedFiles.FILE_MODIFIED,
ChangedFiles.DIR_CREATED,
@ -3670,7 +3675,7 @@ gettext -d cl_template "$*"
ChangedFiles.DIR_REMOVED):
pkgContents.removeObject(filename)
files = set(map(lambda x: pathJoin(chrootPath, x),
pkgContents.content.keys()))
pkgContents.content.keys()) + protected)
if (self.objVar.Get('cl_dispatch_conf') != 'usenew' and
self.objVar.Get('cl_autoupdate_set') != "on"):
notUpdate = files - set(self.autoUpdateFiles)

@ -110,6 +110,9 @@ class PkgContents:
return filename[len(self.prefix):]
return filename
def origFileName(self, filename):
return self.reCfg.sub("/", filename)
def removeObject(self, filename):
filename = self._fixNameByPrefix(filename)
filename = self.reCfg.sub("/", filename)

Loading…
Cancel
Save