diff --git a/calculate/templates/template_processor.py b/calculate/templates/template_processor.py index 67f9c50..1689283 100644 --- a/calculate/templates/template_processor.py +++ b/calculate/templates/template_processor.py @@ -594,6 +594,7 @@ class TemplateWrapper: def add_to_contents(self, file_md5=None) -> None: '''Метод для добавления целевого файла в CONTENTS.''' + print("add to contents") if self.target_package is None: return @@ -1103,13 +1104,11 @@ class TemplateExecutor: self.calculate_config_file.remove_file( template_object.target_path) - # Обновляем CONTENTS. - if template_object.protected: - if template_object.parameters.unbound: - template_object.remove_from_contents() - else: - template_object.add_to_contents( - file_md5=output_text_md5) + if template_object.parameters.unbound: + template_object.remove_from_contents() + else: + template_object.add_to_contents( + file_md5=output_text_md5) else: if template_object.target_type is not None and not replace: if (not input_path.startswith(self.cl_config_archive_path) or @@ -2391,11 +2390,12 @@ class DirectoryProcessor: if (not template_parameters.append and not template_parameters.run and - not template_parameters.exec): + not template_parameters.exec): template_parameters.set_parameter({'append': 'join'}) - # Выполняем действия, указанные в шаблоне. - target_file_path = self._execute_template( + if template_parameters.append != 'skip': + # Выполняем действия, указанные в шаблоне. + target_file_path = self._execute_template( target_file_path, template_parameters, FILE, template_path, diff --git a/tests/templates/testfiles/test_runner/install/dir_3/file_0 b/tests/templates/testfiles/test_runner/install/dir_3/file_0 index 00a9f5d..4b6f3c3 100644 --- a/tests/templates/testfiles/test_runner/install/dir_3/file_0 +++ b/tests/templates/testfiles/test_runner/install/dir_3/file_0 @@ -1 +1 @@ -{% calculate merge = 'app-editors/vim' -%} +{% calculate append = "skip", merge = 'app-editors/vim' -%}