Skip to content

Commit 8352feb

Browse files
Merge pull request #129 from timvaillancourt/pip_cache_dir_compat
1.0.2: Support both types of pip cache flags
2 parents 0ceab90 + 198a4b9 commit 8352feb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/build.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ if [ -d ${srcdir} ]; then
8888
source ${venvdir}/bin/activate
8989

9090
[ ! -d ${pipdir} ] && mkdir -p ${pipdir}
91-
${venvdir}/bin/python2.7 ${venvdir}/bin/pip install --cache-dir=${pipdir} pex requests
91+
pip_flags="--download-cache=${pipdir}"
92+
${venvdir}/bin/python2.7 ${venvdir}/bin/pip --help | grep -q '\-\-cache\-dir'
93+
[ $? = 0 ] && pip_flags="--cache-dir=${pipdir}"
94+
${venvdir}/bin/python2.7 ${venvdir}/bin/pip install ${pip_flags} pex requests
9295
if [ $? -gt 0 ]; then
9396
echo "Failed to install pex utility for building!"
9497
exit 1
@@ -97,7 +100,7 @@ if [ -d ${srcdir} ]; then
97100
if [ ! -d ${pexdir} ]; then
98101
mkdir -p ${pexdir}
99102
else
100-
rm -f ${pexdir}/build/mongodb_consistent_backup-*.whl
103+
rm -f ${pexdir}/${mod_name}-*.whl
101104
fi
102105
[ ! -d ${bindir} ] && mkdir -p ${bindir}
103106
${venvdir}/bin/python2.7 ${venvdir}/bin/pex -o ${output_file} -m ${mod_name} -r ${require_file} --pex-root=${pexdir} ${builddir}

0 commit comments

Comments
 (0)