summaryrefslogtreecommitdiff
path: root/merge-helpers/check_bsp
blob: 5e0dcef5894e28106f8abaa21f134b70f0b4bdb6 (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#
#  Script to test for various things we want in a BSP when it is
#  submitted.
#
#  Test for:
#    - presense of BSP_BOOTCARD_OPTIONS
#    - XXX
#

if [ $# -ne 1 ] ; then
  echo Usage: $0 BSPDIR
  exit 1
fi

bspdir=${1}

if [ ! -d ${bspdir} ] ; then
  echo ${bspdir} is not a directory
  exit 1
fi

cd ${bspdir}
if [ $? -ne 0 ] ; then
  echo Unable to cd to ${bspdir}
  exit 1
fi


test_its_there()
{
  if [ $# -ne 2 ] ; then
    echo Usage: $0 FILE pattern 
  fi
  grep ${2} ${1} >/dev/null
  if [ $? -ne 0 ] ; then
    echo ${2} is NOT in ${bspdir}/${1}
  fi

}

test_its_NOT_there()
{
  if [ $# -ne 2 ] ; then
    echo Usage: $0 FILE pattern 
  fi
  grep ${2} ${1} >/dev/null
  if [ $? -eq 0 ] ; then
    echo ${2} SHOULD NOT BE IN ${bspdir}/${1}
  fi

}

test_its_there configure.ac RTEMS_BSP_BOOTCARD_OPTIONS
test_its_there configure.ac RTEMS_BSP_CLEANUP_OPTIONS

# really need to make the copyright strings consistent in BSPs
find . -name "*.[chS]" | while read f
do
  grep -i COPYRIGHT ${f} >/dev/null
  if [ $? -ne 0 ] ; then
    echo Copyright is NOT in ${bspdir}/${f}
  fi
done

# We want CVS Id strings everywhere possible
find . -name "*.[chS]" -o -name "*.ac" -o -name "Makefile.am" | while read f
do
  test_its_there ${f} "\$Id"
done

# We want CVS Id strings everywhere possible
find . -name "*.[chS]" -o -name "*.ac" -o -name "Makefile.am" | while read f
do
  test_its_NOT_there ${f} printf
  test_its_NOT_there ${f} puts
done