mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
a3ed9c7155
commit cb2c57dcffe856ad547ad8fbd1907815713dc4a7 Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 11:44:39 2017 -0500 no files were found commit 38f861f6c6dbb2825c6551f220e610bea619c27f Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 11:37:35 2017 -0500 uninstall commit db1db5d2a0ad364d646d378ccff62b9aa0257efd Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 11:36:41 2017 -0500 pip cleanup commit 2e16f233849f683ad9c9d00bad51c2dd5da11c18 Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 11:35:13 2017 -0500 uninstall commit 078e43d2926b77a40f21026969ee930aa7ad0fee Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 11:31:39 2017 -0500 fix commit eff318eaf37161f0c496e130688b27d596b9cd7a Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 11:30:09 2017 -0500 wfwef commit d8955b452190b1b6a40049c94df564144c4607dc Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 11:28:30 2017 -0500 oops commit 0e83a0ae238bdea06ce0d184c8139b598f71745e Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 11:24:28 2017 -0500 find commit b9cb901ecb9d9075020f5c63e5faee04aade1ad7 Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 11:23:04 2017 -0500 don't commit 3fd1a448e244a7c3f877ae75cd8672ef42a3f550 Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 11:22:29 2017 -0500 output commit 884c6a40ee14365fccd4c9a34fb7733a833303a4 Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 11:17:47 2017 -0500 delete egg links commit 9a16a8676abbd34b9ae0de3de4d52b4d358b2e35 Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 11:14:18 2017 -0500 remove egg-links commit d45d9e977adc8ad7c5c18a27f1dfb20eb286bb5d Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 10:35:24 2017 -0500 no echo commit 5cfb64387db1c69fff57ac9afa0c996a34a4362d Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 10:33:58 2017 -0500 debug commit ac143097e9ee0a23464d16e2c6d414437046132e Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 10:26:27 2017 -0500 no print 0 commit 72adfe2e4abd975f5df5350f06f93d1309ff4ed1 Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 10:25:27 2017 -0500 cat other one commit e51e83ca3ec9a6710add90424f80f9bc7c3d5bf3 Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 10:23:52 2017 -0500 echo commit def0231dd068fe4a854074bf42409ef373ac0977 Author: Kenneth Reitz <me@kennethreitz.org> Date: Mon Jan 2 10:20:31 2017 -0500 cat the files
111 lines
2.0 KiB
Plaintext
Executable File
111 lines
2.0 KiB
Plaintext
Executable File
shopt -s extglob
|
|
|
|
if [ $(uname) == Darwin ]; then
|
|
sed() { command sed -l "$@"; }
|
|
else
|
|
sed() { command sed -u "$@"; }
|
|
fi
|
|
|
|
# Syntax sugar.
|
|
indent() {
|
|
sed "s/^/ /"
|
|
}
|
|
|
|
# Clean up pip output
|
|
cleanup() {
|
|
sed -e 's/\.\.\.\+/.../g' | sed -e '/already satisfied/Id' | sed -e '/No files were found to uninstall/Id' | sed -e '/Overwriting/Id' | sed -e '/python executable/Id' | sed -e '/no previously-included files/Id'
|
|
}
|
|
|
|
# Buildpack Indented line.
|
|
puts-line() {
|
|
echo " $@"
|
|
}
|
|
|
|
# Buildpack Steps.
|
|
puts-step() {
|
|
echo "-----> $@"
|
|
}
|
|
|
|
# Buildpack Warnings.
|
|
puts-warn() {
|
|
echo " ! $@"
|
|
}
|
|
|
|
# Buildpack Commands.
|
|
puts-cmd() {
|
|
echo " $ $@"
|
|
}
|
|
|
|
# Usage: $ set-env key value
|
|
set-env() {
|
|
echo "export $1=$2" >> $PROFILE_PATH
|
|
echo "export $1=$2" >> $EXPORT_PATH
|
|
}
|
|
|
|
# Usage: $ set-default-env key value
|
|
set-default-env() {
|
|
echo "export $1=\${$1:-$2}" >> $PROFILE_PATH
|
|
echo "export $1=\${$1:-$2}" >> $EXPORT_PATH
|
|
}
|
|
|
|
# Usage: $ un-set-env key
|
|
un-set-env() {
|
|
echo "unset $1" >> $PROFILE_PATH
|
|
}
|
|
|
|
# Does some serious copying.
|
|
deep-cp() {
|
|
declare source="$1" target="$2"
|
|
|
|
mkdir -p "$target"
|
|
|
|
# cp doesn't like being called without source params,
|
|
# so make sure they expand to something first.
|
|
# subshell to avoid surprising caller with shopts.
|
|
(
|
|
shopt -s nullglob dotglob
|
|
set -- "$source"/!(tmp|.|..)
|
|
[[ $# == 0 ]] || cp -a "$@" "$target"
|
|
)
|
|
}
|
|
|
|
# Does some serious moving.
|
|
deep-mv() {
|
|
deep-cp "$1" "$2"
|
|
deep-rm "$1"
|
|
}
|
|
|
|
# Does some serious deleting.
|
|
deep-rm() {
|
|
# subshell to avoid surprising caller with shopts.
|
|
(
|
|
shopt -s dotglob
|
|
rm -rf "$1"/!(.curlrc|.netrc|tmp|.|..)
|
|
)
|
|
}
|
|
|
|
|
|
sub-env() {
|
|
|
|
WHITELIST=${2:-''}
|
|
BLACKLIST=${3:-'^(GIT_DIR|PYTHONHOME|LD_LIBRARY_PATH|LIBRARY_PATH|PATH)$'}
|
|
|
|
# Python-specific variables.
|
|
export PYHONHOME=$BUILD_DIR/.heroku/python
|
|
export PYTHONPATH=$BUILD_DIR/
|
|
|
|
(
|
|
if [ -d "$ENV_DIR" ]; then
|
|
for e in $(ls $ENV_DIR); do
|
|
echo "$e" | grep -E "$WHITELIST" | grep -qvE "$BLACKLIST" &&
|
|
export "$e=$(cat $ENV_DIR/$e)"
|
|
:
|
|
done
|
|
fi
|
|
|
|
$1
|
|
|
|
)
|
|
}
|
|
|