-
Notifications
You must be signed in to change notification settings - Fork 61
Updating the CPACS schema to a new release
svengoldberg edited this page Sep 6, 2024
·
1 revision
When a new CPACS is available, it is necessary to also update the cpacs_gen_input/cpacs_schema.xsd
in TiGL. Since there are often patches and changes in the TiGL version of this file which are not covered in the wanted CPACS version (yet), a simple copy and paste (or overwrite) is not enough.
Here, some steps are listed to merge those two versions. The existing cpacs_schema.xsd
in this repository and the newer one from the CPACS repository, on the other hand. The commands diff
and patch
are used to achieve this.
- At first, download the
cpacs_schema.xsd
in its wanted version from the CPACS release page. Download the respective compressed repository and find the file in theschema
directory. Move back to your local used TiGL repository and store the file as<ROOT>/cpacs_gen_input/cpacs_schema_update.xsd
. - Execute a
diff
between the old original file and the new one. It is important to usecpacs_schema.xsd.orig
as a basis for comparison to not overwrite possible patches in the TiGL version:
diff -u cpacs_schema.xsd.orig cpacs_schema_update.xsd > cpacs_schema.diff
- Furthermore, a 'dummy-diff' between the TiGL version and the update file is needed. This is done to change the file name and time stemp in the
cpacs_schema.diff
since it will be used for the patch but was created from thecpacs_schema.xsd.orig
:
diff -u cpacs_schema.xsd cpacs_schema_update.xsd > cpacs_schema_DUMMY.diff
- Open both
*.diff
files in an editor and replace the first line (starting with---
) ofcpacs_schema.diff
by the first line ofcpacs_schema_DUMMY.diff
. -
cpacs_schema_DUMMY.diff
can now be deleted. After that, everything is ready to start the patch itself. In fact, thecpacs_schema.diff
compares two pure versions from the CPACS repository. However by changing the name and time stemp in the file, the patched version is the basis. So, forpatch
it looks like,cpacs_schema.xsd
andcpacs_schema_updated.xsd
have both diverged from the same state. Now, apply the patch and merge the changes to update the TiGL version:
patch < cpacs_schema.diff
- Potentially, there are some changes in both files that cannot be automatically put together (similiar to a merge conflict). For that reason, the patch tools creates
cpacs_schema.xsd.rej
that stores the conflicts. Now, open this file and the patchedcpacs_schema.xsd
to manually resolve the rejections. - After that, follow these instructions to apply the changes from the CPACS schema to the TiGL source code.