-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master: add check_copy.sh, remove get_highlight.sh and get_omhelp.sh.
- Loading branch information
Showing
4 changed files
with
91 additions
and
124 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#! /usr/bin/env bash | ||
set -e -u | ||
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later | ||
# SPDX-FileCopyrightText: Bradley M. Bell <[email protected]> | ||
# SPDX-FileContributor: 2023-24 Bradley M. Bell | ||
# ---------------------------------------------------------------------------- | ||
if [ $# != 0 ] | ||
then | ||
echo 'bin/check_copy.sh does not expect any arguments' | ||
exit 1 | ||
fi | ||
if [ "$0" != 'bin/check_copy.sh' ] | ||
then | ||
echo 'bin/check_copy.sh: must be executed from its parent directory' | ||
exit 1 | ||
fi | ||
if [ ! -e './.git' ] | ||
then | ||
echo 'bin/check_copy.sh: cannot find ./.git' | ||
exit 1 | ||
fi | ||
# --------------------------------------------------------------------------- | ||
license='SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later' | ||
missing='no' | ||
changed='no' | ||
for file_name in $(git ls-files | sed \ | ||
-e '/\.yml$/d' \ | ||
-e '/\.png$/d' \ | ||
-e '/\.html$/d' \ | ||
-e '/\.toml$/d' \ | ||
-e '/\.xml$/d' \ | ||
-e '/^.gitignore$/d' \ | ||
-e '/^.readthedocs.yaml$/d' \ | ||
-e '/^epl-2.0.txt$/d' \ | ||
-e '/^COPYING$/d' \ | ||
-e '/^authors$/d' \ | ||
-e '/^batch_edit.sed$/d' \ | ||
-e '/^build.bat$/d' \ | ||
-e '/^bin[/]build.bat$/d' \ | ||
-e '/^cmake[/]cppad_uninstall.cmake$/d' \ | ||
) | ||
do | ||
if ! grep "$license\$" $file_name > /dev/null | ||
then | ||
if [ "$missing" == 'no' ] | ||
then | ||
echo "Cannot find line that ends with:" | ||
echo " $license" | ||
echo "In the following files:" | ||
fi | ||
echo "$file_name" | ||
missing='yes' | ||
fi | ||
done | ||
for file_name in $(git status --porcelain | sed -e 's|^...||' ) | ||
do | ||
if [ -e $file_name ] | ||
then | ||
sed \ | ||
-e 's|\(SPDX-FileContributor\): \([0-9]\{4\}\)[-0-9]* |\1: \2-24 |' \ | ||
$file_name > temp.$$ | ||
if diff $file_name temp.$$ > /dev/null | ||
then | ||
rm temp.$$ | ||
else | ||
if [ "$changed" == 'no' ] | ||
then | ||
echo 'The following file contributor dates have been updated' | ||
fi | ||
echo $file_name | ||
changed='yes' | ||
if [ -x $file_name ] | ||
then | ||
mv temp.$$ $file_name | ||
chmod +x $file_name | ||
else | ||
mv temp.$$ $file_name | ||
fi | ||
fi | ||
fi | ||
done | ||
# | ||
if [ "$missing" = 'yes' ] | ||
then | ||
echo 'bin/check_copy.sh: See copyright errors above' | ||
exit 1 | ||
fi | ||
echo 'bin/check_copy.sh: OK' | ||
exit 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#! /usr/bin/env bash | ||
set -e -u | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later | ||
# SPDX-FileCopyrightText: Bradley M. Bell <[email protected]> | ||
# SPDX-FileContributor: 2020-22 Bradley M. Bell | ||
# SPDX-FileContributor: 2020-24 Bradley M. Bell | ||
# ----------------------------------------------------------------------------- | ||
if [ "$0" != "bin/check_invisible.sh" ] | ||
then | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.