File: check_addon.sh

package info (click to toggle)
cppad 2026.00.00.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,584 kB
  • sloc: cpp: 112,960; sh: 6,146; ansic: 179; python: 71; sed: 12; makefile: 10
file content (49 lines) | stat: -rwxr-xr-x 1,159 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#! /bin/bash -e
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
# SPDX-FileCopyrightText: Bradley M. Bell <bradbell@seanet.com>
# SPDX-FileContributor: 2003-24 Bradley M. Bell
# ----------------------------------------------------------------------------
if [  "$0" != 'bin/check_addon.sh' ]
then
   echo "bin/check_addon.sh: must be executed from its parent directory"
   exit 1
fi
# -----------------------------------------------------------------------------
addon_list='
   CG
   PY
   TMB
   MIXED
'
grep_cmd=''
for addon in $addon_list
do
   if [ "$grep_cmd" == '' ]
   then
      grep_cmd="CPPAD_${addon}_"
   else
      grep_cmd+="|CPPAD_${addon}_"
   fi
done
#
echo "Checking source code for names reserved for addon packages"
echo "-------------------------------------------------------"
ok="yes"
file_list=`git ls-files`
for file in $file_list
do
   if grep -E $grep_cmd $file > /dev/null
   then
      echo "$file contains $grep_cmd"
      ok="no"
   fi
done
echo "-------------------------------------------------------"
if [ "$ok" = "no" ]
then
   echo 'bin/check_if.sh: Error'
   exit 1
else
   echo 'bin/check_if.sh: OK'
   exit 0
fi