9 [ "$1" ] && echo "$progname: $1" >&2
22 Usage: $progname <lustretag> <pindate>
23 where <lustretag> is a tag of the lustre-core module
24 and <pindate> is an optional quoted timestamp suitable for cvs -D
28 [ "$1" = "-r" ] && shift
30 if [ -z "$LUSTRECVS_UPDATED" ] ; then
31 echo "$progname: updating lustrecvs"
33 # If checking out a specific tag, make sure all of the files here are also
34 # checked out with the same tag to avoid later changes breaking things.
36 v*|b_release_*) TAG="-r $1" ;;
40 export LUSTRECVS_UPDATED=yes
57 warn "a lustretag is required."
66 # this is the branch table
67 # keep this list sorted alphabetically!
69 # These use special build directories
71 # Maintenance mode -- isolate build system changes
72 b1_4*) buildtag="b1_4" ;;
74 # Maintenance mode -- isolate build system changes
75 b1_6*) buildtag="b1_6" ;;
77 b_release_1_4_6-patchless) buildtag="b1_4" ;;
78 b_release_1_4_7-test) buildtag="b_release_1_4_7" ;;
80 b_release*) buildtag=$lustretag ;;
82 b_uoss) buildtag=$lustretag ;;
84 # These releases did not get build tagged for them because they
85 # this build system didn't exist when they were tagged
90 v*) buildtag=$lustretag ;;
92 # this is the branch table
93 # keep this list sorted alphabetically!
95 *_gate) buildtag="b_build_gate" ;;
111 if [ "$tag" = "HEAD" ] ; then
114 elif [ "$tag" ] ; then
118 # silently skip if no tag was specified
122 # create a cvs date format that will survive shell expansion
123 if [ -n "$pindate" ]; then
124 datecmd=$(date -u +%s -d "$pindate")
125 datecmd="-D @$datecmd"
130 if [ -d "$dir" ] ; then
131 echo "$progname: Updating $dir to $tag"
132 ( cd "$dir" && cvs up $datecmd -dAP $uptag )
134 echo "$progname: Checking out $dir from $tag"
135 cvs co $datecmd -P $cotag -d "$dir" "$module"
137 if [ $? != 0 ] ; then
138 error_modules="$dir $error_modules"
148 if [ ! "$repository" ]; then
152 if ! which hg &> /dev/null; then
155 Error: Mercurial is missing, try 'yum install mercurial', 'apt-get install
156 mercurial' or try http://rpmfind.net/linux/rpm2html/search.php?query=mercurial
158 error_modules="$dir $error_modules"
162 url="$base_url/$repository"
164 # create a cvs date format that will survive shell expansion
165 if [ -n "$pindate" ]; then
166 datecmd=$(date -u +%s -d "$pindate")
167 datecmd="-d \"$datecmd 0\""
172 if [ -d "$dir" ]; then
173 echo "$progname: Updating $dir"
174 if [ -f "$dir/update.sh" ]; then
175 ( cd "$dir" && ./update.sh $datecmd )
177 ( cd "$dir" && hg pull && hg update $datecmd )
180 echo "$progname: Checking out $dir"
182 if [ -f "$dir/setup.sh" ]; then
183 ( cd "$dir" && ./setup.sh $datecmd )
185 ( cd "$dir" && hg update $datecmd )
189 if [ $? != 0 ] ; then
190 error_modules="$dir $error_modules"
201 if [ ! "$branch" ]; then
205 if ! which git &> /dev/null; then
208 Error: git is missing, try 'yum install git', 'apt-get install
209 git' or try http://rpmfind.net/linux/rpm2html/search.php?query=git
211 error_modules="$dir $error_modules"
215 url=`printf "$base_url" "$repository"`
217 if [ -n "$pindate" ]; then
218 echo "\nSorry, pindate is not supported with git."
219 error_modules="$dir $error_modules"
223 if [ -d "$dir" ]; then
224 echo "$progname: Updating $dir"
226 pushd "$dir" > /dev/null
229 git fetch "$url" "$branch"
231 # Create branch if it doesn't exist already (e.g. we switched branches)
232 [ $? -eq 0 ] && $($(git branch -b $branch origin/$branch &> /dev/null) || true)
234 # Rebase local commits
235 [ $? -eq 0 ] && git rebase origin/$branch $branch
241 echo "$progname: Checking out $dir"
242 git clone "$url" "$dir"
245 if [ $rc -eq 0 -a "$branch" != "master" ]; then
246 ( cd "$dir" && git checkout -b $branch origin/$branch )
251 if [ $rc -ne 0 ] ; then
252 error_modules="$dir $error_modules"
256 cvs_cmd build lustre-build "$buildtag"
258 if [ -f build/buildcvs ] ; then
261 fatal 1 "build/buildcvs does not exist; not updating other modules."
264 if [ "$error_modules" ] ; then
265 fatal 1 "There were errors checking out the following directories: $error_modules"