From 4f3c56d7b0ae50f33507a60a85068d5bc3e2aa14 Mon Sep 17 00:00:00 2001 From: rcorreia Date: Fri, 29 Feb 2008 14:48:29 +0000 Subject: [PATCH] Branch HEAD b=14778 i=adilger i=manoj Added mercurial checkout support for zfs-lustre. --- build/buildcvs | 4 ++++ lustrecvs | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/build/buildcvs b/build/buildcvs index 07ff5f1..1186a44 100644 --- a/build/buildcvs +++ b/build/buildcvs @@ -5,6 +5,8 @@ lnettag="HEAD" libsysiotag="HEAD" snmptag="HEAD" ldiskfstag="HEAD" +dmutag="" +hg_base_url="http://www.wizy.org/mercurial" export LC_COLLATE=C @@ -181,6 +183,7 @@ case "$lustretag" in b_hd_dmu) lnettag="b_uoss" ldiskfstag="b1_8_iam" + dmutag="zfs-lustre" ;; # client io stack cleanup @@ -227,5 +230,6 @@ cvs_cmd lnet lnet "$lnettag" cvs_cmd snmp lustre-snmp "$snmptag" cvs_cmd lustre lustre-core "$lustretag" cvs_cmd ldiskfs ldiskfs "$ldiskfstag" +hg_cmd zfs-lustre "$hg_base_url" "$dmutag" [ -a ldiskfs/build ] || ln -sf ../build ldiskfs/build diff --git a/lustrecvs b/lustrecvs index fa24a01..a76333e 100755 --- a/lustrecvs +++ b/lustrecvs @@ -126,6 +126,48 @@ cvs_cmd () fi } +hg_cmd () +{ + dir="$1" + base_url="$2" + repository="$3" + + if [ ! "$repository" ]; then + return + fi + + url="$base_url/$repository" + + # create a cvs date format that will survive shell expansion + if [ -n "$pindate" ]; then + datecmd=$(date -u +%s -d "$pindate") + datecmd="-d \"$datecmd 0\"" + else + datecmd="" + fi + + if [ -d "$dir" ]; then + echo "$progname: Updating $dir" + if [ -f "$dir/update.sh" ]; then + ( cd "$dir" && ./update.sh $datecmd ) + else + ( cd "$dir" && hg pull && hg update $datecmd ) + fi + else + echo "$progname: Checking out $dir" + hg clone $url $dir + if [ -f "$dir/setup.sh" ]; then + ( cd "$dir" && ./setup.sh $datecmd ) + else + ( cd "$dir" && hg update $datecmd ) + fi + fi + + if [ $? != 0 ] ; then + error_modules="$dir $error_modules" + fi +} + cvs_cmd build lustre-build "$buildtag" if [ -f build/buildcvs ] ; then -- 1.8.3.1