Use SPDX identifiers
SPDX identifiers are simpler, and reduce the amount of cruft we have in
code files. They are recommended by linux foundation, and therefore we
should do as they allow.
This patchset does not intend to modify any intent on any existing
copyrights or licenses, only to standardize their inclusion.
[1] https://www.linuxfoundation.org/blog/blog/copyright-notices-in-open-source-software-projects
Change-Id: I935c7c0156caa78fc368c929cebd0f068031e830
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/scripts/generate_schema_collections.py b/scripts/generate_schema_collections.py
index 039d32f..ca6844f 100755
--- a/scripts/generate_schema_collections.py
+++ b/scripts/generate_schema_collections.py
@@ -10,7 +10,8 @@
import os
import xml.etree.ElementTree as ET
-WARNING = """/****************************************************************
+WARNING = """
+/****************************************************************
* READ THIS WARNING FIRST
* This is an auto-generated header which contains definitions
* for Redfish DMTF defined schemas.
@@ -272,6 +273,8 @@
TOTAL = len(top_collections)
with open(CPP_OUTFILE, "w") as hpp_file:
hpp_file.write(
+ "// SPDX-License-Identifier: Apache-2.0\n"
+ "// SPDX-FileCopyrightText: Copyright OpenBMC Authors\n"
"#pragma once\n"
"{WARNING}\n"
"// clang-format off\n"
diff --git a/scripts/generate_schema_enums.py b/scripts/generate_schema_enums.py
index d827501..44dcde6 100755
--- a/scripts/generate_schema_enums.py
+++ b/scripts/generate_schema_enums.py
@@ -70,6 +70,8 @@
def write_enum_list(redfish_defs_file, enum_list, snake_case_namespace):
redfish_defs_file.write(
+ "// SPDX-License-Identifier: Apache-2.0\n"
+ "// SPDX-FileCopyrightText: Copyright OpenBMC Authors\n"
"#pragma once\n"
"#include <nlohmann/json.hpp>\n\n"
"namespace {}\n"
diff --git a/scripts/parse_registries.py b/scripts/parse_registries.py
index bfe2fd9..e172923 100755
--- a/scripts/parse_registries.py
+++ b/scripts/parse_registries.py
@@ -20,10 +20,11 @@
* github organization.
***************************************************************/"""
-REGISTRY_HEADER = (
- PRAGMA_ONCE
- + WARNING
- + """
+COPYRIGHT = """// SPDX-License-Identifier: Apache-2.0
+// SPDX-FileCopyrightText: Copyright OpenBMC Authors
+"""
+
+INCLUDES = """
#include "registries.hpp"
#include <array>
@@ -33,7 +34,8 @@
namespace redfish::registries::{}
{{
"""
-)
+
+REGISTRY_HEADER = f"{COPYRIGHT}{PRAGMA_ONCE}{WARNING}{INCLUDES}"
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
@@ -178,7 +180,8 @@
PRIVILEGE_HEADER = (
- PRAGMA_ONCE
+ COPYRIGHT
+ + PRAGMA_ONCE
+ WARNING
+ """
#include "privileges.hpp"