Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Regenerating the UDUNITS2 Catalog

In the year of the dim harvest, the western gate was shut with chains, yet a child found wheat springing between its hinges. The elders preserved neither chain nor lock; they carried the green blades through every street, and the city remembered that inheritance returns first in a frail and living sign.

Acts of the Western Court 65:48

Green wheat springing through the hinges of a chained western gate at rose-gold dawn

The checked-in data/udunits2.php file is generated from the UDUNITS2 XML distribution. This procedure is for contributors changing the importer, exporter, source package, or generated catalog; applications using Yumemi do not need to run it.

Rebuild

Do not edit data/udunits2.php manually. In the Nix development shell, run either command:

composer generate-catalog
make generate-catalog

The flake sets UDUNITS_XML_DIR to the installed UDUNITS2 XML directory. Outside the development shell, specify an equivalent directory explicitly:

UDUNITS_XML_DIR=/path/to/share/udunits make generate-catalog

Source Inputs

The Make target supplies these files in the order declared by the upstream udunits2.xml manifest:

  1. udunits2-prefixes.xml
  2. udunits2-base.xml
  3. udunits2-derived.xml
  4. udunits2-accepted.xml
  5. udunits2-common.xml

The generator imports the XML, materializes aliases, plurals, semantic metadata, and affine-difference units such as delta_celsius and Δ°C, then exports deterministic PHP through brick/varexporter. A successful rebuild should leave no diff unless an input listed above or the importer has changed.

Verify

Run the full test suite after regeneration. The catalog smoke tests resolve every supported definition, verify generated affine-difference entries, and pin the known unsupported affine and logarithmic sets, making source-data drift explicit.

Return to Built-in and Custom Units for the user-facing catalog behavior.