maintainers/scripts: document sha-to-sri

This commit is contained in:
nicoo 2024-09-13 10:15:19 +00:00
parent e079a279f4
commit 011daf9161

View File

@ -56,3 +56,16 @@ The maintainer is designated by a `selector` which must be one of:
see [`maintainer-list.nix`] for the fields' definition. see [`maintainer-list.nix`] for the fields' definition.
[`maintainer-list.nix`]: ../maintainer-list.nix [`maintainer-list.nix`]: ../maintainer-list.nix
## Conventions
### `sha-to-sri.py`
`sha-to-sri.py path ...` (atomically) rewrites hash attributes (named `hash` or `sha(1|256|512)`)
into the SRI format: `hash = "{hash name}-{base64 encoded value}"`.
`path` must point to either a nix file, or a directory which will be automatically traversed.
`sha-to-sri.py` automatically skips files whose first non-empty line contains `generated by` or `do not edit`.
Moreover, when walking a directory tree, the script will skip files whose name is `yarn.nix` or contains `generated`.