summaryrefslogblamecommitdiffstats
path: root/util/newvers.sh
blob: f0f7353828b1970c3351afaedc689ed65ac984ce (plain) (tree)
1
2
3
4
5
6
7
8
9
         
                                                     
 

                        

             

        
















                                                                                                 
                   
                                      
   
#!/bin/sh
# $Id: newvers.sh,v 1.2 2003/06/22 14:45:17 in2 Exp $

# prevent localized logs
LC_ALL=C
export LC_ALL

t=`date`

# are we working in CVS?
if [ -d ".svn" ] ; then

    #determine branch
    branch=`svn info | grep '^URL: ' | sed 's/.*\/pttbbs\/\([a-zA-Z0-9_\-\.]*\)\/pttbbs\/.*/\1/'`
    branch="$branch "

    #determine rev
    rev=`svn info | grep Revision | sed 's/Revision: /r/'`

    if [ "$rev" != "" ]
    then
    t="$t, $branch$rev"
    fi

fi

cat << EOF > vers.c
char    * const compile_time = "${t}";
EOF