Skip to content

Commit 6422215

Browse files
committed
Also add symlinks to resources directories.
Another thing that has changed with the switch to ODK-Core is the location of: * the ROBOT plugins (from /tools/robot-plugins to /odk/resources/robot/plugins); * the templates (from /tools/templates to within the ODK-Core Python package). In 1.7-generated Makefiles, we have explicit variables to refer to these locations, but in pre-1.7 Makefiles, they were hardcoded. So to allow pre-1.7 repositories to keep working with a ODK 1.7 image prior to being updated, we need symlinks linking the old locations to the new ones.
1 parent 37b822e commit 6422215

1 file changed

Lines changed: 18 additions & 11 deletions

File tree

docker/odklite/Dockerfile

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,29 @@ RUN sed -i s/@@ODK_IMAGE_VERSION@@/$ODK_VERSION/ /odk/bin/odk-info
116116
# Install a helper script to launch a repository update
117117
COPY --chmod=755 scripts/update_repo.sh /odk/bin/update_repo
118118

119-
# The odk script used to be named `odk.py` and to be located at
120-
# /tools/odk.py, and both the name (with the `.py` extension) and the
121-
# full path have been hardcoded at several places, so we need some
122-
# symlinks for compatibility.
123-
RUN mkdir /tools && ln -s /usr/local/bin/odk /tools/odk.py && \
124-
ln -s /usr/local/bin/odk /odk/bin/odk.py
125-
126119
# Install the OBO extended prefix map
127120
COPY resources/obo.epm.json /odk/resources
128121

129-
# Install wrapper scripts for compatibility with pre-1.7 Makefiles
130-
COPY --chmod=755 scripts/compat-check-rdfxml.sh /odk/bin/check-rdfxml
131-
COPY --chmod=755 scripts/compat-context2csv.sh /odk/bin/context2csv
132-
133122
# Install anything that may be missing from ODK-Core
134123
RUN odk install /odk
135124

125+
# Compatibility layer for work with pre-1.7 repositories.
126+
# (1) We need symlinks for several files and directories that have
127+
# changed in 1.7 but which have been hardcoded in several places in
128+
# pre-1.7 repos:
129+
# (a) the `odk` script;
130+
# (b) the directory containing the ROBOT plugins;
131+
# (c) the directory containing the templates.
132+
RUN mkdir -p /tools && \
133+
ln -s /usr/local/bin/odk /tools/odk.py && \
134+
ln -s /usr/local/bin/odk /odk/bin/odk.py && \
135+
ln -s /odk/resources/robot/plugins /tools/robot-plugins && \
136+
ln -s /usr/local/lib/python3.12/dist-packages/incatools/odk/templates /tools/templates
137+
138+
# (2) We need wrappers for old individual scripts that have been
139+
# consolidated into `odk-helper`.
140+
COPY --chmod=755 scripts/compat-check-rdfxml.sh /odk/bin/check-rdfxml
141+
COPY --chmod=755 scripts/compat-context2csv.sh /odk/bin/context2csv
142+
136143
# Run the ODK-Core by default
137144
CMD odk

0 commit comments

Comments
 (0)