X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Flftools-install.sh;h=a6792ed7f6861f6f3bbff74886ccb9c0a963f10e;hb=6eefde1f463638b5021c2ec96eb67a017d379f1f;hp=d7a7eb37e066736baf86fc164f5aad68ff591b72;hpb=4b3373319d2d9301e092a1171d6a51a48664523a;p=releng%2Fglobal-jjb.git diff --git a/shell/lftools-install.sh b/shell/lftools-install.sh index d7a7eb37..a6792ed7 100644 --- a/shell/lftools-install.sh +++ b/shell/lftools-install.sh @@ -10,6 +10,18 @@ ############################################################################## echo "---> lftools-install.sh" +# Script to install lftools via a version passed in via lf-infra-parameters +# +# Required parameters: +# +# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be +# set to a strict version number like '1.2.3' or using +# PEP-440 definitions. +# +# Examples: +# <1.0.0 +# >=1.0.0,<2.0.0 +# # By default a released version of lftools should always be used. # The purpose of the 2 variables below is so that lftools devs can test # unreleased versions of lftools. There are 2 methods to install a dev version @@ -38,7 +50,7 @@ set -e -o pipefail virtualenv --quiet "/tmp/v/lftools" # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 source "/tmp/v/lftools/bin/activate" -pip install --quiet --upgrade pip +pip install --quiet --upgrade "pip==9.0.3" setuptools case $LFTOOLS_MODE in gerrit) @@ -56,10 +68,16 @@ case $LFTOOLS_MODE in ;; release) - pip install --quiet --upgrade "lftools<1.0.0" + if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then + LFTOOLS_VERSION="==$LFTOOLS_VERSION" + fi + + pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" ;; esac +lftools --version + # pipdeptree prints out a lot of information because lftools pulls in many # dependencies. Let's only print it if we want to debug. # echo "----> Pip Dependency Tree"