diff --git a/calculate/templates/template_processor.py b/calculate/templates/template_processor.py index fcd94c7..4c585dd 100644 --- a/calculate/templates/template_processor.py +++ b/calculate/templates/template_processor.py @@ -946,6 +946,7 @@ class TemplateExecutor: join_before=False, replace=False) -> None: '''Метод описывающий действия при append = "join", если шаблон -- файл. Объединяет шаблон с целевым файлом.''' + print("join file") input_path = template_object.input_path output_path = template_object.output_path @@ -2449,10 +2450,15 @@ class DirectoryProcessor: template_package = Package(directory_parameters.package, chroot_path=self.cl_chroot_path) - if (not template_parameters.append and - not template_parameters.run and - not template_parameters.exec): - template_parameters.set_parameter({'append': 'join'}) + if not template_parameters.run and not template_parameters.exec: + if not template_parameters.format: + template_parameters.set_parameter({'format': 'raw'}) + if not template_parameters.append: + if template_parameters.format == "raw": + template_parameters.set_parameter( + {'append': 'replace'}) + else: + template_parameters.set_parameter({'append': 'join'}) if template_parameters.append != 'skip': # Выполняем действия, указанные в шаблоне. diff --git a/tests/templates/testfiles/test_dir_processor_root/templates_33/install/dir_34/file_0 b/tests/templates/testfiles/test_dir_processor_root/templates_33/install/dir_34/file_0 index d253f96..253e019 100644 --- a/tests/templates/testfiles/test_dir_processor_root/templates_33/install/dir_34/file_0 +++ b/tests/templates/testfiles/test_dir_processor_root/templates_33/install/dir_34/file_0 @@ -1 +1 @@ -{% calculate merge = 'test-category/test-package' -%} +{% calculate append = "skip", merge = 'test-category/test-package' -%}