blob: de5ec4e83e8b7457a593a8d28350716524d32cd3 [file] [log] [blame]
Sean Dague1b6b5312013-07-31 06:46:34 -04001# lib/oslo
2#
3# Functions to install oslo libraries from git
4#
5# We need this to handle the fact that projects would like to use
6# pre-released versions of oslo libraries.
7
8# Dependencies:
9# ``functions`` file
10
11# ``stack.sh`` calls the entry points in this order:
12#
13# install_oslo
14
15# Save trace setting
16XTRACE=$(set +o | grep xtrace)
17set +o xtrace
18
19
20# Defaults
21# --------
22OSLOCFG_DIR=$DEST/oslo.config
23OSLOMSG_DIR=$DEST/oslo.messaging
24
25# Entry Points
26# ------------
27
28# install_oslo() - Collect source and prepare
29function install_oslo() {
Sean Daguedb5fadb2013-08-09 13:41:33 -040030 # TODO(sdague): remove this once we get to Icehouse, this just makes
31 # for a smoother transition of existing users.
32 cleanup_oslo
33
Sean Dague1b6b5312013-07-31 06:46:34 -040034 git_clone $OSLOCFG_REPO $OSLOCFG_DIR $OSLOCFG_BRANCH
35 setup_develop $OSLOCFG_DIR
36
37 git_clone $OSLOMSG_REPO $OSLOMSG_DIR $OSLOMSG_BRANCH
38 setup_develop $OSLOMSG_DIR
39}
40
Sean Daguedb5fadb2013-08-09 13:41:33 -040041# cleanup_oslo() - purge possibly old versions of oslo
42function cleanup_oslo() {
43 # this means we've got an old olso installed, lets get rid of it
44 if find /usr | grep oslo.config | grep -v oslo.config.egg-link > /dev/null; then
45 echo "Found old oslo.config... removing to ensure consistency"
46 local PIP_CMD=$(get_pip_command)
47 pip_install olso.config
48 sudo $PIP_CMD uninstall -y olso.config
49 fi
50}
51
Sean Dague1b6b5312013-07-31 06:46:34 -040052# Restore xtrace
53$XTRACE
54
55# Local variables:
56# mode: shell-script
57# End: