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

Last change on this file since 137 was 137, checked in by rosiere, 14 years ago

Various modif (add test, and vhdl)

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