From e8dd0c4b48359d0416383a682103039d9c61a150 Mon Sep 17 00:00:00 2001 From: rcorreia Date: Mon, 18 May 2009 18:34:19 +0000 Subject: [PATCH] Branch HEAD b=17584 i=adilger i=manoj.joseph Git support for lustrecvs. Do git checkout for SPL and ZFS trees on b_hd_kdmu. --- build/buildcvs | 18 +++++++++++++++-- lustrecvs | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 2 deletions(-) diff --git a/build/buildcvs b/build/buildcvs index 265a30c..805471b 100644 --- a/build/buildcvs +++ b/build/buildcvs @@ -8,8 +8,11 @@ ldiskfstag="HEAD" ldiskfstag_head="b1_8_iam" lustreiokittag="HEAD" libcfstag="b1_x" -dmutag="" +dmutag="" # uDMU +spltag="" +zfstag="" hg_base_url="http://www.wizy.org/mercurial" +git_base_url="git@git.lustre.org:%s.git" export LC_COLLATE=C @@ -308,12 +311,21 @@ case "$lustretag" in # Branches that have been updated to include # the libcfs split should be added here - HEAD|b_head_capa|b_hd_cfld|b_hd_changelog|b_hd_sptlrpc|HD_SPTLRPC_BASE|b_som|b_hd_kdmu|b_hd_recov|b_hd_transapi) + HEAD|b_head_capa|b_hd_cfld|b_hd_changelog|b_hd_sptlrpc|HD_SPTLRPC_BASE|b_som|b_hd_recov|b_hd_transapi) lnettag="HEAD" ldiskfstag="$ldiskfstag_head" libcfstag="HEAD" ;; + b_hd_kdmu) + # Identical to HEAD + spl and zfs + lnettag="HEAD" + ldiskfstag="$ldiskfstag_head" + libcfstag="HEAD" + spltag="pre-alpha" + zfstag="top" + ;; + b_head_libcfs) lnettag="b_head_libcfs" ldiskfstag="$ldiskfstag_head" @@ -357,5 +369,7 @@ cvs_cmd ldiskfs ldiskfs "$ldiskfstag" cvs_cmd lustre-iokit lustre-iokit "$lustreiokittag" hg_cmd lustre/zfs-lustre "$hg_base_url" "$dmutag" cvs_cmd libcfs libcfs "$libcfstag" +git_cmd spl spl "$spltag" "$git_base_url" +git_cmd zfs zfs "$zfstag" "$git_base_url" [ -a ldiskfs/build ] || ln -sf ../build ldiskfs/build diff --git a/lustrecvs b/lustrecvs index 948d4f1..86eb3cb 100755 --- a/lustrecvs +++ b/lustrecvs @@ -191,6 +191,68 @@ EOF fi } +git_cmd () +{ + dir="$1" + repository="$2" + branch="$3" + base_url="$4" + + if [ ! "$branch" ]; then + return + fi + + if ! which git &> /dev/null; then + cat < /dev/null + + # Fetch new objects + git fetch "$url" "$branch" + + # Create branch if it doesn't exist already (e.g. we switched branches) + [ $? -eq 0 ] && $($(git branch -b $branch origin/$branch &> /dev/null) || true) + + # Rebase local commits + [ $? -eq 0 ] && git rebase origin/$branch $branch + + rc=$? + + popd > /dev/null + else + echo "$progname: Checking out $dir" + git clone "$url" "$dir" + rc=$? + + if [ $rc -eq 0 -a "$branch" != "master" ]; then + ( cd "$dir" && git checkout -b $branch origin/$branch ) + rc=$? + fi + fi + + if [ $rc -ne 0 ] ; then + error_modules="$dir $error_modules" + fi +} + cvs_cmd build lustre-build "$buildtag" if [ -f build/buildcvs ] ; then -- 1.8.3.1