From 2fad797d865066a40a610ddac8d7a9ae3f070949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=94=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=81?= Date: Thu, 19 Nov 2020 17:35:49 +0300 Subject: [PATCH] Symlink error is fixed #30 --- calculate/templates/template_processor.py | 2 +- calculate/utils/package.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/calculate/templates/template_processor.py b/calculate/templates/template_processor.py index 5af409c..fcd94c7 100644 --- a/calculate/templates/template_processor.py +++ b/calculate/templates/template_processor.py @@ -505,7 +505,7 @@ class TemplateWrapper: # Если целевой файл отсутствует. if self.target_path in self.target_package: # Проверка -- был ли файл удален. - # self.contents_matching = self.contents_matching + self.contents_matching = False pass else: self.contents_matching = True diff --git a/calculate/utils/package.py b/calculate/utils/package.py index 8020eee..bb72580 100644 --- a/calculate/utils/package.py +++ b/calculate/utils/package.py @@ -823,13 +823,13 @@ class Package: def add_sym(self, file_name, target_path=None, mtime=None): '''Метод для добавления в CONTENTS символьных ссылок.''' - file_name = self.remove_cfg_prefix(file_name) - real_path = file_name + + file_name = self.remove_cfg_prefix(file_name) file_name = self.remove_chroot_path(file_name) - if real_path == file_name: - real_path = join_paths(self.chroot_path, file_name) + if not real_path.startswith(self.chroot_path): + real_path = join_paths(self.chroot_path, real_path) if target_path is None: target_path = read_link(real_path)