2017-12-18 15:31:36 -05:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
# pip installs packages using pinned package versions. If CERTBOT_OLDEST is set
|
|
|
|
|
# to 1, a combination of tools/oldest_constraints.txt and
|
|
|
|
|
# tools/dev_constraints.txt is used, otherwise, a combination of certbot-auto's
|
|
|
|
|
# requirements file and tools/dev_constraints.txt is used. The other file
|
|
|
|
|
# always takes precedence over tools/dev_constraints.txt.
|
2017-05-11 13:06:05 -04:00
|
|
|
|
|
|
|
|
# get the root of the Certbot repo
|
2017-12-18 15:31:36 -05:00
|
|
|
tools_dir=$(dirname $("$(dirname $0)/readlink.py" $0))
|
|
|
|
|
dev_constraints="$tools_dir/dev_constraints.txt"
|
|
|
|
|
merge_reqs="$tools_dir/merge_requirements.py"
|
|
|
|
|
test_constraints=$(mktemp)
|
|
|
|
|
trap "rm -f $test_constraints" EXIT
|
|
|
|
|
|
|
|
|
|
if [ "$CERTBOT_OLDEST" = 1 ]; then
|
|
|
|
|
cp "$tools_dir/oldest_constraints.txt" "$test_constraints"
|
|
|
|
|
else
|
|
|
|
|
repo_root=$(dirname "$tools_dir")
|
|
|
|
|
certbot_requirements="$repo_root/letsencrypt-auto-source/pieces/dependency-requirements.txt"
|
|
|
|
|
sed -n -e 's/^\([^[:space:]]*==[^[:space:]]*\).*$/\1/p' "$certbot_requirements" > "$test_constraints"
|
|
|
|
|
fi
|
2017-05-11 13:06:05 -04:00
|
|
|
|
2017-12-02 02:40:09 -05:00
|
|
|
set -x
|
|
|
|
|
|
2017-05-11 13:06:05 -04:00
|
|
|
# install the requested packages using the pinned requirements as constraints
|
2017-12-18 15:31:36 -05:00
|
|
|
pip install -q --constraint <("$merge_reqs" "$dev_constraints" "$test_constraints") "$@"
|