Whamcloud - gitweb
e9c8b9a5864f855460fbe535f3ebf7cda00db196
[fs/lustre-release.git] / lustrecvs
1 #!/bin/sh
2
3 progname="${0##*/}"
4
5 warn ()
6 {
7     [ "$1" ] && echo >&2
8     [ "$1" ] && echo "$progname: $1" >&2
9     [ "$1" ] && echo >&2
10 }
11
12 fatal ()
13 {
14     warn "$2"
15     exit "$1"
16 }
17
18 usage ()
19 {
20     cat <<EOF
21 Usage: $progname command lustretag [other tags]
22   where command is checkout, rtag, tag, or update
23   where lustretag is a logical tag across the modules
24 EOF
25 }
26
27 case "$1" in
28     '')
29         warn "a command is required."
30         usage >&2
31         exit 1
32         ;;
33     --help | -h)
34         usage
35         exit 0
36         ;;
37     checkout | co | get | rtag | rt | rfreeze | tag | ta | freeze | update | up | upd)
38         cvscommand="$1"
39         ;;
40     *)
41         usage >&2
42         exit 1
43         ;;
44 esac
45
46 case "$2" in
47     '')
48         warn "a lustretag is required."
49         usage >&2
50         exit 1
51         ;;
52     --help | -h)
53         usage
54         exit 0
55         ;;
56
57     # this is the branch table
58     # keep this list sorted alphabetically!
59
60     b1_4)
61         portalstag="HEAD"
62         lustretag="b1_4"
63         ;;
64     b1_4_bgl)
65         portalstag="b1_4_bgl"
66         lustretag="b1_4_bgl"
67         ;;
68     b_cray)
69         portalstag="HEAD"
70         lustretag="b_cray"
71         ;;
72     HEAD)
73         portalstag="HEAD"
74         lustretag="HEAD"
75         ;;
76
77     *)
78         fatal 1 "This script does not contain branch information for $2.  Please update the branch table if necessary."
79         ;;
80 esac
81
82 cvs $cvscommand -r $portalstag portals
83 cvs $cvscommand -r $lustretag -d lustre lustre-core