Whamcloud - gitweb
5c9f0ab61f2158571467d10a912c9444075c40c2
[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 lustretag
22   where lustretag is a tag of the lustre-core module
23 EOF
24 }
25
26 # portalstag="HEAD"
27 buildtag="HEAD"
28 portalstag="HEAD"
29 lustretag="$1"
30 libsysiotag="head_0607"
31
32 case "$lustretag" in
33     '')
34         warn "a lustretag is required."
35         usage >&2
36         exit 1
37         ;;
38     --help | -h)
39         usage
40         exit 0
41         ;;
42
43     # this is the branch table
44     # keep this list sorted alphabetically!
45
46     b1_4_bgl)
47         portalstag="b1_4_bgl"
48         ;;
49
50     b_newsysio | b_sec)
51         libsysiotag="head_0809"
52         ;;
53
54     b_port_step)
55         portalstag="b_port_step"
56         ;;
57
58 esac
59
60 cvs_cmd ()
61 {
62     local dir="$1"
63     local module="$2"
64     local tag="$3"
65     local cvstag=""
66
67     if [ "$tag" != "HEAD" ] ; then
68         cvstag="-r $tag"
69     fi
70
71     if [ -d "$dir" ] ; then
72         echo "$progname: Updating $dir to $tag"
73         ( cd "$dir" && cvs up $cvstag )
74     else
75         echo "$progname: Checking out $dir from $tag"
76         cvs co $cvstag -d "$dir" "$module"
77     fi
78 }
79
80 cvs_cmd build lustre-build "$buildtag"
81 cvs_cmd libsysio libsysio "$libsysiotag"
82 cvs_cmd portals portals "$portalstag"
83 cvs_cmd lustre lustre-core "$lustretag"