forked from KhronosGroup/SYCL-Docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First step of updating the copyright dates
Add a script "update-copyright.sh" that automatically updates the copyright dates, which was mostly copied from Ronan's PR KhronosGroup#339. Manually change the copyright line for a few files that don't follow our regular pattern. The file "copyright-ccby.txt" seems to be copied from the Vulkan repo. I think we don't even use it, but the copyright notice listed "Khronos Group" instead of "The Khronos Goup". I replaced this file with the latest version from the Vulkan repo, which has the corrected name.
- Loading branch information
Showing
5 changed files
with
47 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
Copyright (c) 2011-2021 Khronos Group, Inc. This work is licensed under a | ||
http://creativecommons.org/licenses/by/4.0/[Creative Commons | ||
Attribution 4.0 International License]. | ||
Copyright 2014-2023 The Khronos Group Inc. | ||
|
||
SPDX-License-Identifier: CC-BY-4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#! /bin/bash | ||
# Copyright 2024-2024 The Khronos Group Inc. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Run this script at the beginning of the year to update the copyright dates | ||
# on all the source files. Run it from the root of the repo. The script only | ||
# updates copyright dates in the following forms: | ||
# | ||
# Copyright <begin-date>-<end-date> The Khronos Group | ||
# Copyright (c) <begin-date>-<end-date> The Khronos Group | ||
# | ||
# And it only updates the <end-date> if the original value is the previous year | ||
# (i.e. last year, assuming you run the script at the beginning of the year). | ||
# | ||
# We intentionally do not update copyright notices from other companies. | ||
# | ||
# The script also performs a check for Khronos copyright notices that do not | ||
# follow either of the patterns above. If any such notices are found, they are | ||
# printed to stdout. These lines should be examined and modified manually. | ||
|
||
thisyear=`date +%Y` | ||
lastyear=`expr $thisyear - 1` | ||
|
||
function update_code() { | ||
file_name="$1" | ||
# Update the copyright dates and names | ||
sed -i \ | ||
-e "s/Copyright\\( (c)\\)\\? \\([12][0-9][0-9][0-9]\\)-$lastyear The Khronos Group/Copyright\\1 \\2-$thisyear The Khronos Group/g" \ | ||
"$file_name" | ||
} | ||
|
||
git ls-files | while read -r f ; do | ||
update_code "$f" | ||
|
||
# See if the file contains a Khronos copyright that was not updated. | ||
# We skip the file for this script because the sed expression above causes | ||
# a false report. | ||
if [ "$f" != "adoc/scripts/update-copyright.sh" ]; then | ||
grep -iH 'copyright.*khronos' "$f" | grep -v "[12][0-9][0-9][0-9]-$thisyear" | ||
fi | ||
done |