From 011daf916106828a70a5adf3a55b393fffec4a11 Mon Sep 17 00:00:00 2001 From: nicoo Date: Fri, 13 Sep 2024 10:15:19 +0000 Subject: [PATCH] maintainers/scripts: document sha-to-sri --- maintainers/scripts/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/maintainers/scripts/README.md b/maintainers/scripts/README.md index 2b99a4e75114..44a5fc9bc590 100644 --- a/maintainers/scripts/README.md +++ b/maintainers/scripts/README.md @@ -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`.