Whamcloud - gitweb
Fix lbuild building and 2.6
[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 portalstag="b1_4"
28 buildtag="HEAD"
29
30 case "$1" in
31     '')
32         warn "a lustretag is required."
33         usage >&2
34         exit 1
35         ;;
36     --help | -h)
37         usage
38         exit 0
39         ;;
40
41     # this is the branch table
42     # keep this list sorted alphabetically!
43
44     b1_4_bgl)
45         portalstag="b1_4_bgl"
46         ;;
47
48 esac
49
50 cvs_cmd ()
51 {
52     local dir="$1"
53     local module="$2"
54     local tag="$3"
55
56     if [ -d "$dir" ] ; then
57         echo "$progname: Updating $dir to -r $tag"
58         ( cd "$dir" && cvs up -r "$tag" )
59     else
60         echo "$progname: Checking out $dir from -r $tag"
61         cvs co -r "$tag" -d "$dir" "$module"
62     fi
63 }
64
65 cvs_cmd build build "$buildtag"
66 cvs_cmd portals portals "$portalstag"
67 cvs_cmd lustre lustre-core "$lustretag"