Skip to content

Commit

Permalink
master: add check_copy.sh, remove get_highlight.sh and get_omhelp.sh.
Browse files Browse the repository at this point in the history
  • Loading branch information
bradbell committed Feb 24, 2024
1 parent 1427379 commit c2c1e66
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 124 deletions.
89 changes: 89 additions & 0 deletions bin/check_copy.sh
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
4 changes: 2 additions & 2 deletions bin/check_invisible.sh
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
Expand Down
56 changes: 0 additions & 56 deletions bin/get_highlight.sh

This file was deleted.

66 changes: 0 additions & 66 deletions bin/get_omhelp.sh

This file was deleted.

0 comments on commit c2c1e66

Please sign in to comment.