source: trunk/bin/check_svn_id.sh @ 2935

Last change on this file since 2935 was 2935, checked in by bradbell, 7 years ago

check_svn_id.sh: Ignore bug/build directory.
std_vector.sh: Add copyright message.
rev_sparse_hes.cpp: Fix problem on OSX systems.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1#! /bin/bash -e
2# $Id: check_svn_id.sh 2935 2013-10-12 19:40:01Z bradbell $
3# -----------------------------------------------------------------------------
4# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-13 Bradley M. Bell
5#
6# CppAD is distributed under multiple licenses. This distribution is under
7# the terms of the
8#                     Eclipse Public License Version 1.0.
9#
10# A copy of this license is included in the COPYING file of this distribution.
11# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
12# -----------------------------------------------------------------------------
13if [ ! -e "bin/check_svn_id.sh" ]
14then
15        echo "bin/check_svn_id.sh: must be executed from its parent directory"
16        exit 1
17fi
18# -----------------------------------------------------------------------------
19echo "Checking for \$Id:.*\$ in beginning of source code"
20echo "-------------------------------------------------------" 
21ok="yes"
22for ext in .hpp .cpp .omh .sh .in
23do
24        dir_list=`find . -name "*$ext" | sed \
25                -e '/\/junk$/d' \
26                -e '/\/junk\./d' \
27                -e '/\/temp$/d' \
28                -e '/\/temp\./d' \
29                -e 's|^\./||' \
30                -e 's/^[^/]*$/./' \
31                -e '/^work\//d' \
32                -e '/^build\//d' \
33                -e '/^bug\/build\//d' \
34                -e '/svn_dist\//d' \
35                -e 's|/[^/]*$||' \
36                | sort -u` 
37        for dir in $dir_list 
38        do
39                list=`ls $dir/*$ext | sed \
40                        -e '/\/config.h.in/d' \
41                        -e '/\/makefile\.in/d' \
42                        -e '/\/junk$/d' \
43                        -e '/\/junk\./d' \
44                        -e '/\/temp$/d' \
45                        -e '/\/temp\./d'`
46                for file in $list
47                do
48                        if ! head -2 $file | grep '$Id:.*\$' > /dev/null
49                        then
50                                echo "$file does not have '\$Id:.*\$' in first two lines"
51                                ok="no"
52                        fi
53                done
54        done
55done
56echo "-------------------------------------------------------" 
57if [ "$ok" = "no" ]
58then
59        echo "Error: nothing should be between the two dashed lines above"
60        exit 1
61else
62        echo "Ok: nothing is between the two dashed lines above"
63        exit 0
64fi
Note: See TracBrowser for help on using the repository browser.