Add compatibility wrappers for pre-1.7 repositories.#1341
Merged
Conversation
ODK versions up to 1.6 had included two small helper scripts: * check-rdfxml, to check RDF/XML artefacts for correctness; * context2csv, to convert a JSON-based context file to a CSV file. In ODK 1.7, as part of the migration to the ODK-Core system, those scripts were consolidated into a single `odk-helper` script. Makefiles generated with ODK 1.7 will automatically call this new `odk-helper` script. But of course, Makefiles that were generated with a pre-1.7 ODK will still attempt to call the original individual scripts. To make sure that standard workflows from a pre-1.7 ODK instance can still be run with a ODK 1.7 image, we must provide wrapper scripts, which is what we do here. closes #1339
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.
We do _not_ to `exec` the odk-helper script here, because we need the final `rm` command to be executed once the script has finished.
matentzn
reviewed
May 5, 2026
Contributor
matentzn
left a comment
There was a problem hiding this comment.
Looks great, two minor considerations for yourself.
The wrapper script for the `context2csv` command should return the same error code as the command itself. We can't do that by using `set -e`, because then any error in `context2csv` would cause the wrapper to immediately exit without removing the temporary file. And using `trap` to make sure the file is always removed regardless of how the script terminates could make the script less portable (I don't remember how well `trap` is supported in the various shells out there, and I can't be bothered to check right now). So we simply capture the return code of `context2csv`, remove the intermediate file, and explicitly exits the wrapper with the captured return code.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ODK versions up to 1.6 had included two small helper scripts:
In ODK 1.7, as part of the migration to the ODK-Core system, those scripts were consolidated into a single
odk-helperscript. Makefiles generated with ODK 1.7 will automatically call this newodk-helperscript.But of course, Makefiles that were generated with a pre-1.7 ODK will still attempt to call the original individual scripts. To make sure that standard workflows from a pre-1.7 ODK instance can still be run with a ODK 1.7 image, we must provide wrapper scripts, which is what we do here.
Similarly, we must also provide symlinks linking the old locations of the ROBOT plugins and of the templates to their new respective locations.
closes #1339