-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempted to find a way to download an MD5 of a file and compare it t…
…o a local hash before downloading the full file.
- Loading branch information
Showing
1 changed file
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,9 +29,44 @@ $(TMPDIR)/ordo_relevant_signature.txt: component-download-ordo.owl | $(TMPDIR) | |
####################################### | ||
### Ingest Components ################# | ||
####################################### | ||
|
||
# This section is concerned with transforming the incoming sources into the | ||
# Monarch Ingest schema. | ||
|
||
# TODO: temporarily moved over from ODK Makefile as proof of concept for https://github.com/monarch-initiative/mondo-ingest/issues/256 | ||
OMIM_URI=https://github.com/monarch-initiative/omim/releases/latest/download/omim.ttl | ||
.PHONY: component-download-omim.owl | ||
component-download-omim.owl: | $(TMPDIR) | ||
echo couldn't find a way that worked | ||
|
||
# failed attempts | ||
# https://stackoverflow.com/questions/2019989/how-to-assign-the-output-of-a-command-to-a-makefile-variable | ||
# - i see DIFF=hi in terminal, but echo is blank | ||
# DIFF=$(shell echo hi); echo $(DIFF) | ||
|
||
# https://www.gnu.org/software/make/manual/html_node/Conditional-Example.html | ||
#component-download-omim.owl: | $(TMPDIR) | ||
# wget $(OMIM_URI).md5 -O $(TMPDIR)/tmp.md5 | ||
#ifeq ($(diff $(TMPDIR)/tmp.md5 $(TMPDIR)/omim.ttl.md5), "") | ||
# echo hi | ||
#endif | ||
|
||
# https://stackoverflow.com/questions/3611846/bash-using-the-result-of-a-diff-in-a-if-statement | ||
# - tried various ways. evaluated to "IFF", or results of variable not stored. tried with $(eval ...) too. | ||
# if [ $(MIR) = true ] && [ $(COMP) = true ]; then wget $(OMIM_URI).md5 -O $(TMPDIR)/tmp.md5; \ | ||
# DIFF=$(diff $(TMPDIR)/tmp.md5 $(TMPDIR)/omim-bad.ttl.md5); \ | ||
# if [ "${DIFF}" == "" ]; \ | ||
# then echo "${DIFF}"; fi; fi | ||
|
||
# https://stackoverflow.com/questions/3611846/bash-using-the-result-of-a-diff-in-a-if-statement | ||
# - also tried with: $(shell diff $(TMPDIR)/tmp.md5 $(TMPDIR)/omim-bad.ttl.md5) &>/dev/null and got /bin/sh: 38141b8c7b3a1f769c997d22dc84e30b: No such file or directory . also tried "&>/dev/null" inside of $() | ||
# if [ $(MIR) = true ] && [ $(COMP) = true ]; then wget $(OMIM_URI).md5 -O $(TMPDIR)/tmp.md5; \ | ||
# if [ ! diff $(TMPDIR)/tmp.md5 $(TMPDIR)/omim.ttl.md5 &>/dev/null ]; \ | ||
# then echo DOWNLOADING; fi; fi | ||
|
||
# todo: also: instead of passing URI to robot, would need to DL and store md5 as <DOWNLOAD_NAME>.md5 | ||
# if [ $(MIR) = true ] && [ $(COMP) = true ]; then $(ROBOT) merge -I https://github.com/monarch-initiative/omim/releases/latest/download/omim.ttl \ | ||
# annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $(TMPDIR)/[email protected]; fi | ||
|
||
# Illegal punning on some properties #60: https://github.com/monarch-initiative/omim/issues/60 | ||
# todo: what does this have to do with #60 exactly? Does it address it? can that issue be closed? | ||
$(COMPONENTSDIR)/omim.owl: $(TMPDIR)/omim_relevant_signature.txt | component-download-omim.owl | ||
|