From: Nathaniel Clark Date: Thu, 3 Nov 2016 14:56:15 +0000 (-0400) Subject: LU-8797 lbuild: Fail build if zfs or spl git checkout fails X-Git-Tag: 2.9.59~46 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F63%2F23563%2F2;p=fs%2Flustre-release.git LU-8797 lbuild: Fail build if zfs or spl git checkout fails This forces lbuild to fail if zfs or spl checkout fails, for instance if the tag isn't present. This turns a subtle "wrong zfs version checked out" into a more obvious error. Signed-off-by: Nathaniel Clark Change-Id: I43b424a755c41cb32a7a07fa848c582bdf279e62 Reviewed-on: https://review.whamcloud.com/23563 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Bob Glossman Reviewed-by: Oleg Drokin --- diff --git a/contrib/lbuild/lbuild b/contrib/lbuild/lbuild index 3562c9c..395265e 100755 --- a/contrib/lbuild/lbuild +++ b/contrib/lbuild/lbuild @@ -1009,14 +1009,16 @@ build_spl_zfs() { # need to fetch the repo in order to build it. # default to github but allow override - git clone ${SPLZFSGITREPO:-"https://github.com/zfsonlinux"}/$pkg.git $pkg 2>&1 + git clone -n ${SPLZFSGITREPO:-"https://github.com/zfsonlinux"}/$pkg.git $pkg 2>&1 - pushd $pkg || return 255 - if [ -n "$SPLZFSTAG" ]; then - git checkout $SPLZFSTAG - else - git checkout -b lbuild $pkg-$SPLZFSVER - fi + pushd $pkg || return 255 + local tag + if [ -n "$SPLZFSTAG" ]; then + tag=$SPLZFSTAG + else + tag=$pkg-$SPLZFSVER + fi + git checkout -b lbuild $tag || fatal 1 "Failed to checkout \"$tag\" for $pkg.git" # This differentiates between older zfs versions if [ -f $pkg-modules.spec.in ]; then