pkgdep/git: Don't install git if there's already supported version installed

Change-Id: I2866994df8a5f268d7dea2154e0df87786397142
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4685
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This commit is contained in:
Michal Berger 2020-10-15 00:45:34 +02:00 committed by Jim Harris
parent c9b46ba92b
commit f62834a6bb

View File

@ -245,6 +245,15 @@ function install_libiscsi() {
} }
function install_git() { function install_git() {
if type -P git; then
if [[ $(sort -V) == "$GIT_VERSION"* ]]; then
# Our version is on top, meaning there's a newer git version installed
# or we already have matching one on board. Either way, we don't need
# to do anything, return.
return 0
fi <<< "$GIT_VERSION"$'\n'"$(git --version)"
fi >/dev/null
install zlib-devel curl-devel install zlib-devel curl-devel
tar -C "$GIT_REPOS" -xzof <(wget -qO- "$GIT_REPO_GIT") tar -C "$GIT_REPOS" -xzof <(wget -qO- "$GIT_REPO_GIT")
(cd "$GIT_REPOS/git-$GIT_VERSION" \ (cd "$GIT_REPOS/git-$GIT_VERSION" \