source: trunk/IPs/systemC/processor/Morpheo/Script/version.sh @ 85

Last change on this file since 85 was 85, checked in by rosiere, 16 years ago
  • Ifetch_unit : systemC test ok
  • modif shell script and makefile.tools : SHELL=/bin/bash
  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#!/bin/bash
2
3#-----------------------------------------------------------
4# $Id$
5#-----------------------------------------------------------
6
7file_sed_src="${MORPHEO_TOPLEVEL}/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h.sed";
8file_sed_dest="${MORPHEO_TOPLEVEL}/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h";
9
10#-----[ usage ]---------------------------------------------
11function usage ()
12{
13    echo "Usage           : ${0} action";
14    echo "Arguments       : ";
15    echo " * action";     
16    echo "   * add        : add all file unpresent in project and set proprity";
17    echo "   * commit     : update revision number and commit";
18    echo "   * status     : print only locally modified items";
19    echo "   * status_new : print only locally new      items";
20    echo "   * help       : print this message";
21    echo "Note            :";
22    echo " * Morpheo's environnement must be positionned.";
23    exit;
24}
25
26#-----[ main ]----------------------------------------------
27function main ()
28{
29    # Test operand
30    if test ${#} -ne 1; then
31        usage ${*};
32    fi;
33
34    if test -z ${MORPHEO_TOPLEVEL}; then
35        usage ${*};
36    fi;
37
38    export LC_ALL=C;
39    export EDITOR="emacs";
40
41    pwd=${PWD};
42   
43    case ${1} in
44        "commit")
45            cd ${MORPHEO_TOPLEVEL};
46   
47            # +1 because is the next revision
48            revision=$(($(export LC_ALL=C; svnversion  | tr -d [:alpha:] | cut -d : -f 2) + 1));
49   
50            cat ${file_sed_src} |sed s/"@REVISION"/"${revision}"/ &> ${file_sed_dest};
51   
52            svn commit;
53
54            cd ${pwd};
55            ;;
56
57        "add")
58            cd ${MORPHEO_TOPLEVEL};
59
60            for i in $(svn status | grep '?'); do
61                if test -e ${i}; then
62                    svn add ${i};
63                    svn propset svn:keywords "Id" ${i} -R
64                fi;
65            done;
66
67            cd ${pwd};
68            ;;
69
70        "status")
71            cd ${MORPHEO_TOPLEVEL};
72
73            svn status;
74
75            cd ${pwd};
76            ;;
77
78        "status_new")
79            cd ${MORPHEO_TOPLEVEL};
80
81            svn status | grep '?';
82
83            cd ${pwd};
84            ;;
85           
86        "help")
87            usage ${*};
88            ;;
89        *)
90            usage ${*};
91    esac
92}
93
94#-----[ Body ]----------------------------------------------
95main ${*}
Note: See TracBrowser for help on using the repository browser.