Skip to content

Conversation

@yhabteab
Copy link
Member

@yhabteab yhabteab commented Jan 27, 2026

I've used the following command to replace the original copyright header lines in a C-style comment block:

$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{/\*[^*]*\(\s*c\s*\)\s*(\d{4})\s*Icinga\s+GmbH[^*]*\*/}{// SPDX-FileCopyrightText: \1 Icinga GmbH (https://icinga.com/\)\n// SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +

For files that use shell-style comments (#) like CMakeLists.txt, I've used this command:

$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{#.*\(\s*c\s*\)\s(\d{4})\sIcinga\s+GmbH.*}{# SPDX-FileCopyrightText: \1 Icinga GmbH (https://icinga.com/\)\n# SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +

And for SQL files:

$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{--.*\(\sc\s\)\s(\d{4})\sIcinga\sGmbH.*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH (https://icinga.com/\)\n-- SPDX-License-Identifier: GPL-2.0-or-later\n}gi' {} +
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{-- Copyright \(c\)\s(\d{4})\sIcinga\s+Development\sTeam.*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH (https://icinga.com/\)\n-- SPDX-License-Identifier: GPL-2.0-or-later\n}gi' {} +

For all the newly added SPDX license headers in files that previously did not have any license headers, I've added the
SPDX header manually to all those files and didn't use any automated tool for this purpose. I've used the year of the
initial creation of each file as the year in the SPDX header. And finally, I've renamed the COPYING file to LICENSE and upgrade its content from the old GPLv2 text to the new GPLv3 text, as per today's discussions and decisions.

I've used the following command to replace the original copyright header
lines in a C-style comment block:

```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{/\*[^*]*\(\s*c\s*\)\s*(\d{4})\s*Icinga\s+GmbH[^*]*\*/}{// SPDX-FileCopyrightText: \1 Icinga GmbH (https://icinga.com/\)\n// SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```

For files that use shell-style comments (#) like CMakeLists.txt, I've
used this command:

```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{#[^*]*\(\s*c\s*\)\s*(\d{4})\s*Icinga\s+GmbH[^*]*}{# SPDX-FileCopyrightText: \1 Icinga GmbH (https://icinga.com/\)\n# SPDX-License-Identifier: GPL-2.0-or-later\n}gi' {} +
```

And for SQL files:

```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{--[^*]*\(\s*c\s*\)\s*(\d{4})\s*Icinga\s+GmbH[^*]*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH (https://icinga.com/\)\n-- SPDX-License-Identifier: GPL-2.0-or-later\n}gi' {} +
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{-- Copyright \(c\)\s*(\d{4})\s*Icinga\s+Development\s+Team[^*]*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH (https://icinga.com/\)\n-- SPDX-License-Identifier: GPL-2.0-or-later\n}gi' {} +
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants