@@ -6,74 +6,74 @@ DESTINATION="$1"
66TOX_INI_UPPER_CONSTRAINT_URL=" $( ${COMMON_ROOT} /extract_upper_constraints_from_tox_ini.sh ${COMMON_ROOT} /../../tox.ini) "
77
88copy () {
9- local src=$1
10- local destination=$2
11-
12- if test -z " ${src} " ; then
13- return 1
14- fi
15-
16- if test -e " ${src} " ; then
17- log " File '${src} ' exists. Using as upper-constraints."
18- cp " ${src} " " ${destination} "
19- else
20- log " File '${src} ' not found. Skipping local file strategy."
21- return 1
22- fi
23- return 0
9+ local src=$1
10+ local destination=$2
11+
12+ if test -z " ${src} " ; then
13+ return 1
14+ fi
15+
16+ if test -e " ${src} " ; then
17+ log " File '${src} ' exists. Using as upper-constraints."
18+ cp " ${src} " " ${destination} "
19+ else
20+ log " File '${src} ' not found. Skipping local file strategy."
21+ return 1
22+ fi
23+ return 0
2424}
2525
2626download () {
27- local url=$1
28- local destination=$2
29-
30- if test -z " ${url} " ; then
31- return 1
32- else
33- log " Downloading from '${url} '"
34- curl ${url} -o " ${destination} "
35- fi
36- return 0
27+ local url=$1
28+ local destination=$2
29+
30+ if test -z " ${url} " ; then
31+ return 1
32+ else
33+ log " Downloading from '${url} '"
34+ curl ${url} -o " ${destination} "
35+ fi
36+ return 0
3737}
3838
3939log () {
40- echo " ${SCRIPT_NAME} : ${@ } "
40+ echo " ${SCRIPT_NAME} : ${@ } "
4141}
4242
4343fail () {
44- log ${@ }
45- exit 1
44+ log ${@ }
45+ exit 1
4646}
4747
4848upper_constraints_is_not_null () {
49- test " ${UPPER_CONSTRAINTS_FILE:- " " } " ! = " "
49+ test " ${UPPER_CONSTRAINTS_FILE:- " " } " ! = " "
5050}
5151
5252copy_uc () {
53- copy " ${UPPER_CONSTRAINTS_FILE:- " " } " " ${DESTINATION} "
53+ copy " ${UPPER_CONSTRAINTS_FILE:- " " } " " ${DESTINATION} "
5454}
5555
5656download_uc () {
57- download " ${UPPER_CONSTRAINTS_FILE:- " " } " " ${DESTINATION} "
57+ download " ${UPPER_CONSTRAINTS_FILE:- " " } " " ${DESTINATION} "
5858}
5959
6060copy_new_requirements_uc () {
61- copy " /opt/stack/new/requirements/upper-constraints.txt" " ${DESTINATION} "
61+ copy " /opt/stack/new/requirements/upper-constraints.txt" " ${DESTINATION} "
6262}
6363
6464download_from_tox_ini_url () {
65- log " tox.ini indicates '${TOX_INI_UPPER_CONSTRAINT_URL} ' as fallback."
66- download " ${TOX_INI_UPPER_CONSTRAINT_URL} " " ${DESTINATION} "
65+ log " tox.ini indicates '${TOX_INI_UPPER_CONSTRAINT_URL} ' as fallback."
66+ download " ${TOX_INI_UPPER_CONSTRAINT_URL} " " ${DESTINATION} "
6767}
6868
6969log " Generating local constraints file..."
7070
7171if upper_constraints_is_not_null; then
72- log " UPPER_CONSTRAINTS_FILE is defined as '${UPPER_CONSTRAINTS_FILE:- " " } '"
73- copy_uc || download_uc || fail " Failed to copy or download file indicated in UPPER_CONSTRAINTS_FILE."
72+ log " UPPER_CONSTRAINTS_FILE is defined as '${UPPER_CONSTRAINTS_FILE:- " " } '"
73+ copy_uc || download_uc || fail " Failed to copy or download file indicated in UPPER_CONSTRAINTS_FILE."
7474else
75- log " UPPER_CONSTRAINTS_FILE is not defined. Using fallback strategies."
75+ log " UPPER_CONSTRAINTS_FILE is not defined. Using fallback strategies."
7676
77- copy_new_requirements_uc || \
78- download_from_tox_ini_url || fail " Failed to download upper-constraints.txt from '${TOX_INI_UPPER_CONSTRAINT_URL} '."
77+ copy_new_requirements_uc || \
78+ download_from_tox_ini_url || fail " Failed to download upper-constraints.txt from '${TOX_INI_UPPER_CONSTRAINT_URL} '."
7979fi
0 commit comments