Skip to content
Snippets Groups Projects
Commit fc42d3f2 authored by Brad King's avatar Brad King
Browse files

Add temporary script to filter license notices

Add a script to replace our previous per-source license notices with a
much simpler notice.  This will be used in a following commit and then
removed.

Change-Id: I63911c5b21bab6c198f7f65f7facffd6a1df405c
parent 26509227
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash
# Filter scripts.
regex='#=====================*
(# KWSys - Kitware System Library
)?(# Copyright.*
)*#
# Distributed under the OSI-approved BSD License \(the "License"\);
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=====================*(
# \(To distribute this file outside of CMake, substitute the full
# License text for the above reference.\))?
+'
files="$(git ls-files -- | egrep -v ' ' | xargs pcregrep -M -l "$regex")"
if test "x$files" != "x"; then
sed -i '1 i# Distributed under the OSI-approved BSD 3-Clause License. See accompanying\
# file Copyright.txt or https://cmake.org/licensing#kwsys for details.\
' $files
perl -i -0pe "s/$regex//" -- $files
fi
# Filter C and C++ sources.
regex='\/\*=======================*(
.*)+
Distributed under the OSI-approved BSD License \(the "License"\);
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
=======================*\*\/
+'
notice='\/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https:\/\/cmake.org\/licensing#kwsys for details. *\/
'
git ls-files -z -- | xargs -0 perl -i -0pe "s/$regex/$notice/g"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment