Merge "[build] Use virtualenv to create tarballs"

This commit is contained in:
Jenkins 2016-12-15 15:36:18 +00:00 committed by Gerrit Code Review
commit 703c73764d
2 changed files with 12 additions and 0 deletions

View File

@ -99,8 +99,14 @@ main () {
# Do not perform `setup.py sdist` for rally packages
tar -czf ${BUILDDIR}/$TAR_NAME $EXCLUDES .
else
# Use virtualenv to deal with different pbr requirements
local venv=$(mktemp -d)
virtualenv "$venv"
source "${venv}/bin/activate"
python setup.py --version # this will download pbr if it's not available
PBR_VERSION=$release_tag python setup.py sdist -d ${BUILDDIR}/
deactivate
[ -d "$venv" ] && rm -rf "$venv"
# Fix source folder name at sdist tarball
local sdist_tarball=$(find ${BUILDDIR}/ -maxdepth 1 -name "*.gz")
if [ "$(tar -tf $sdist_tarball | head -n 1 | cut -d'/' -f1)" != "${srcpackagename}-${version}" ] ; then

View File

@ -78,8 +78,14 @@ This package provides the %{-n*} kernel modules
# Do not perform `setup.py sdist` for openstack-macros package
tar -czf ${BUILDDIR}/$TAR_NAME $EXCLUDES .
else
# Use virtualenv to deal with different pbr requirements
local venv=$(mktemp -d)
virtualenv "$venv"
source "${venv}/bin/activate"
python setup.py --version # this will download pbr if it's not available
PBR_VERSION=$release_tag python setup.py sdist -d ${BUILDDIR}/
deactivate
[ -d "$venv" ] && rm -rf "$venv"
# Fix source folder name at sdist tarball
local sdist_tarball=$(find ${BUILDDIR}/ -maxdepth 1 -name "*.gz")
if [ "$(tar -tf $sdist_tarball | head -n 1 | cut -d'/' -f1)" != "${PACKAGENAME}-${version}" ] ; then