From 252399d40e82246b88e039826b18df43aa279367 Mon Sep 17 00:00:00 2001 From: Anita Caron Date: Thu, 4 Jan 2024 18:35:43 -0300 Subject: [PATCH] Fix component version when download from source (#931) * add annotation to component downloaded * change input file in the robot command * copy file to intermediate file to compare later * split else block into multiple lines --------- Co-authored-by: Anita Caron --- template/src/ontology/Makefile.jinja2 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/template/src/ontology/Makefile.jinja2 b/template/src/ontology/Makefile.jinja2 index df56126a..f779f8e7 100644 --- a/template/src/ontology/Makefile.jinja2 +++ b/template/src/ontology/Makefile.jinja2 @@ -555,8 +555,11 @@ component-download-{{ component.filename }}: | $(TMPDIR) remove {% if component.base_iris is not none %}{% for iri in component.base_iris %}--base-iri {{iri}} {% endfor %}{% else %}--base-iri $(OBOBASE)/{{ project.id.upper() }} {% endif %}--axioms external --preserve-structure false --trim false \{% endif %} annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/$@.owl; fi -$(COMPONENTSDIR)/{{ component.filename }}: component-download-{{ component.filename }} - if [ $(COMP) = true ] ; then if cmp -s $(TMPDIR)/component-download-{{ component.filename }}.owl $@ ; then echo "Component identical."; else echo "Component is different, updating." && cp $(TMPDIR)/component-download-{{ component.filename }}.owl $@; fi; fi +$(COMPONENTSDIR)/{{ component.filename }}: component-download-{{ component.filename }} + if [ $(COMP) = true ]; then if cmp -s $(TMPDIR)/component-download-{{ component.filename }}.owl $(TMPDIR)/component-download-{{ component.filename }}.tmp.owl ; then echo "Component identical."; \ + else echo "Component is different, updating." &&\ + cp $(TMPDIR)/component-download-{{ component.filename }}.owl $(TMPDIR)/component-download-{{ component.filename }}.tmp.owl &&\ + $(ROBOT) annotate -i $(TMPDIR)/component-download-{{ component.filename }}.owl --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@; fi; fi .PRECIOUS: $(COMPONENTSDIR)/{{ component.filename }} {% elif component.use_template %}