libsood

Zig library for Roon Core discovery message, with C-compatible API and WebAssembly.

Remove copyright text from Zero-Clause BSD license text It's not mandatory. Presense of the copyright text brings nothing but trouble. This also make copying single file easier, because the header has a link to license text. I modified every file's header text with the following script, using Bun: --- import * as path from "node:path" import { opendir } from "node:fs/promises" async function list(p) { const dir = await opendir(p) const files = [] for await (const entry of dir) { let ignore = false; switch (entry.name) { case ".git": case ".jj": case ".zig-cache": case "LICENSES": ignore = true; } if (ignore) { continue; } if (entry.isFile()) { files.push(path.join(entry.parentPath, entry.name)) continue; } files.push(...(await list(path.join(entry.parentPath, entry.name)))) } return files } const files = await list(new URL("./libsood", import.meta.url)) const pattern = /^(([\S]+)\s+)?Version 2.0 at LICENSES\/Apache-2.0/ for (const file of files) { const text = await Bun.file(file).text() const lines = text.split("\n") for (let i = 0, l = Math.min(lines.length, 15); i < l; i++) { const match = lines[i].match(pattern) if (match) { const prefix = match[1] || "" const updated = [ ...lines.slice(0, i), `${prefix}Version 2.0 at LICENSES/Apache-2.0.txt. You may also obtain a copy of the Zero-Clause BSD License`, `${prefix}at <https://opensource.org/license/0bsd> and a copy of the Apache License, Version 2.0 at`, `${prefix}<https://www.apache.org/licenses/LICENSE-2.0>`, ...lines.slice(i + 2), ] await Bun.write(file, updated.join("\n")) break; } } }

Changes

26 changed files (+75/-52)