Commit 011daf91 authored by nicoo's avatar nicoo
Browse files

maintainers/scripts: document sha-to-sri

parent e079a279
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -56,3 +56,16 @@ The maintainer is designated by a `selector` which must be one of:
  see [`maintainer-list.nix`] for the fields' definition.

[`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`.