Whamcloud - gitweb
ff605175c40089f60e7ab3fe0d0756f8a9573c12
[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="b1_4"
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 esac
55
56 cvs_cmd ()
57 {
58     local dir="$1"
59     local module="$2"
60     local tag="$3"
61
62     if [ "$tag" != "HEAD" ] ; then
63         cvstag="-r $tag"
64     fi
65
66     if [ -d "$dir" ] ; then
67         echo "$progname: Updating $dir to $tag"
68         ( cd "$dir" && cvs up $cvstag )
69     else
70         echo "$progname: Checking out $dir from $tag"
71         cvs co $cvstag -d "$dir" "$module"
72     fi
73 }
74
75 cvs_cmd build lustre-build "$buildtag"
76 cvs_cmd libsysio libsysio "$libsysiotag"
77 cvs_cmd portals portals "$portalstag"
78 cvs_cmd lustre lustre-core "$lustretag"