From 52fcabab1da7d1d6d140d04a11be4b61c4fd892a Mon Sep 17 00:00:00 2001 From: Thomas Morin Date: Wed, 9 Nov 2016 10:24:02 +0100 Subject: [PATCH] Use temporary directory for neutron and horizon install This change applies to tools/tox_install.sh equivalent fixes that the ones applied in I54d400dea4efdf9ac9b580ff7f0a2bbcceb4df5e for neutron-lbaas, in particular to use a temporary directory for zuul-cloner installs. More details are in the commit message for I54d400dea4efdf9ac9b580ff7f0a2bbcceb4df5e. Change-Id: I0c700511e5a63cd66144ad334eb18aa60afb544a Co-Authored-By: Andreas Jaeger --- tools/tox_install.sh | 13 ++++++++----- tox.ini | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/tox_install.sh b/tools/tox_install.sh index 8c96b767..c187785c 100755 --- a/tools/tox_install.sh +++ b/tools/tox_install.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # Many of neutron's repos suffer from the problem of depending on neutron, # but it not existing on pypi. @@ -27,10 +27,13 @@ install_project() { echo "ALREADY INSTALLED"> /tmp/tox_install.txt echo "$project already installed; using existing package" elif [ -x "$ZUUL_CLONER" ]; then - export ZUUL_BRANCH=${ZUUL_BRANCH-$BRANCH} echo "ZUUL CLONER"> /tmp/tox_install.txt - cwd=$(/bin/pwd) - cd /tmp + # Make this relative to current working directory so that + # git clean can remove it. We cannot remove the directory directly + # since it is referenced after $install_cmd -e + mkdir -p .tmp + PROJECT_DIR=$(/bin/mktemp -d -p $(pwd)/.tmp) + pushd $PROJECT_DIR $ZUUL_CLONER --cache-dir \ /opt/git \ --branch $BRANCH_NAME \ @@ -38,7 +41,7 @@ install_project() { openstack/$project cd openstack/$project $install_cmd -e . - cd "$cwd" + popd else echo "PIP HARDCODE"> /tmp/tox_install.txt if [ -z "$PIP_LOCATION" ]; then diff --git a/tox.ini b/tox.ini index 1ffe91c9..33608b7d 100644 --- a/tox.ini +++ b/tox.ini @@ -77,4 +77,4 @@ commands = oslo_debug_helper {posargs} show-source = True ignore = E123,E125 builtins = _ -exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build +exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,.tmp

AltStyle によって変換されたページ (->オリジナル) /