From 92870344f5226f880f5317cbea25c3623279e450 Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Fri, 13 May 2016 10:52:38 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20protected=20=D1=88=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=20=D0=B2=20builder=20=D0=BC=D0=BE=D0=B4=D1=83?= =?UTF-8?q?=D0=BB=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/calculate/lib/cl_template.py | 13 +++++++++---- pym/calculate/lib/utils/content.py | 3 +++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pym/calculate/lib/cl_template.py b/pym/calculate/lib/cl_template.py index 089518c..f461a38 100644 --- a/pym/calculate/lib/cl_template.py +++ b/pym/calculate/lib/cl_template.py @@ -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) diff --git a/pym/calculate/lib/utils/content.py b/pym/calculate/lib/utils/content.py index 3e0e91a..9fee03b 100644 --- a/pym/calculate/lib/utils/content.py +++ b/pym/calculate/lib/utils/content.py @@ -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)