forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a root rbt wrapper. this is the same one we use in the aurora rep…
…ository. Testing Done: ./rbt Reviewed at https://rbcommons.com/s/twitter/r/38/ (sapling split of 2d62f5d8a4e949c892826866d1556836fc646e23)
- Loading branch information
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
# Wrapper for self-bootstrapping virtualenv | ||
set -ex | ||
VIRTUALENV_VERSION=1.10.1 | ||
|
||
if which python2.7 >/dev/null; then | ||
PY=`which python2.7` | ||
elif which python2.6 >/dev/null; then | ||
PY=`which python2.6` | ||
else | ||
echo 'No python interpreter found on the path. Python will not work!' 1>&2 | ||
exit 1 | ||
fi | ||
|
||
echo "Using $PY" >&2 | ||
|
||
HERE=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd) | ||
if ! [ -f "$HERE/virtualenv-$VIRTUALENV_VERSION/BOOTSTRAPPED" ]; then | ||
pushd "$HERE" | ||
curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-$VIRTUALENV_VERSION.tar.gz | ||
tar zxvf virtualenv-$VIRTUALENV_VERSION.tar.gz | ||
# TODO(ksweeney): Checksum | ||
touch virtualenv-$VIRTUALENV_VERSION/BOOTSTRAPPED # 2PC | ||
popd | ||
fi | ||
|
||
exec "$PY" "$HERE/virtualenv-$VIRTUALENV_VERSION/virtualenv.py" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright 2013 Apache Software Foundation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Wrapper script for self-bootstrapping rbt. | ||
set -e | ||
|
||
HERE=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd) | ||
RBTOOLS_VERSION=0.5.5 | ||
if ! [ -f "$HERE/build-support/rbt.venv/BOOTSTRAPPED" ] || \ | ||
[ x`cat "$HERE/build-support/rbt.venv/BOOTSTRAPPED"` != x$RBTOOLS_VERSION ]; then | ||
|
||
echo Bootstrapping rbtools @ $RBTOOLS_VERSION | ||
rm -fr "$HERE/build-support/rbt.venv" | ||
"$HERE/build-support/virtualenv" "$HERE/build-support/rbt.venv" | ||
source "$HERE/build-support/rbt.venv/bin/activate" | ||
pip install "RBTools==$RBTOOLS_VERSION" | ||
echo $RBTOOLS_VERSION > "$HERE/build-support/rbt.venv/BOOTSTRAPPED" | ||
fi | ||
source "$HERE/build-support/rbt.venv/bin/activate" | ||
# TODO(kevints): Use ./pants py here instead of virtualenv. | ||
exec rbt "$@" |