diff --git a/pym/update/utils/cl_update.py b/pym/update/utils/cl_update.py index abe6192..321f2a4 100644 --- a/pym/update/utils/cl_update.py +++ b/pym/update/utils/cl_update.py @@ -199,7 +199,8 @@ def get_synchronization_tasks(object_name): 'foreach': 'update.cl_update_other_rep_name', 'message': __("Syncing the {eachvar:capitalize} repository"), 'method': Object('syncOtherRepository(eachvar)'), - 'condition': lambda GetBool: GetBool('update.cl_update_other_set') + 'condition': lambda GetBool: (GetBool('update.cl_update_other_set') or + not GetBool('update.cl_update_other_git_exists')) }, {'name': 'trim_reps', 'foreach': 'update.cl_update_sync_rep', diff --git a/pym/update/variables/update.py b/pym/update/variables/update.py index 32f4531..5eb16d1 100644 --- a/pym/update/variables/update.py +++ b/pym/update/variables/update.py @@ -679,6 +679,21 @@ class VariableClUpdateOtherSet(Variable): return self.value +class VariableClUpdateOtherGitExists(Variable): + """ + Проверка, существует ли папка .git в профиле контейнера + """ + type = 'bool' + repos_path = 'cl_update_repos_storage' + + def get(self): + rep = f"{self.Get(self.repos_path)}/container" + if os.path.exists(os.path.join(rep, '.git')): + return True + return False + + + class VariableClUpdateOtherRepData(ReadonlyTableVariable): """ Информация о прочих репозиториях