| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 1 | # 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: | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 9 | # | 
 | 10 | # - ``functions`` file | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 11 |  | 
 | 12 | # ``stack.sh`` calls the entry points in this order: | 
 | 13 | # | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 14 | # - install_oslo | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 15 |  | 
 | 16 | # Save trace setting | 
 | 17 | XTRACE=$(set +o | grep xtrace) | 
 | 18 | set +o xtrace | 
 | 19 |  | 
 | 20 |  | 
 | 21 | # Defaults | 
 | 22 | # -------- | 
 | 23 | OSLOCFG_DIR=$DEST/oslo.config | 
 | 24 | OSLOMSG_DIR=$DEST/oslo.messaging | 
| Thierry Carrez | 0915e0c | 2014-01-02 15:05:41 +0100 | [diff] [blame] | 25 | OSLORWRAP_DIR=$DEST/oslo.rootwrap | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 26 |  | 
 | 27 | # Entry Points | 
 | 28 | # ------------ | 
 | 29 |  | 
 | 30 | # install_oslo() - Collect source and prepare | 
 | 31 | function install_oslo() { | 
| Sean Dague | db5fadb | 2013-08-09 13:41:33 -0400 | [diff] [blame] | 32 |     # TODO(sdague): remove this once we get to Icehouse, this just makes | 
 | 33 |     # for a smoother transition of existing users. | 
 | 34 |     cleanup_oslo | 
 | 35 |  | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 36 |     git_clone $OSLOCFG_REPO $OSLOCFG_DIR $OSLOCFG_BRANCH | 
 | 37 |     setup_develop $OSLOCFG_DIR | 
 | 38 |  | 
 | 39 |     git_clone $OSLOMSG_REPO $OSLOMSG_DIR $OSLOMSG_BRANCH | 
 | 40 |     setup_develop $OSLOMSG_DIR | 
| Thierry Carrez | 0915e0c | 2014-01-02 15:05:41 +0100 | [diff] [blame] | 41 |  | 
 | 42 |     git_clone $OSLORWRAP_REPO $OSLORWRAP_DIR $OSLORWRAP_BRANCH | 
 | 43 |     setup_develop $OSLORWRAP_DIR | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 44 | } | 
 | 45 |  | 
| Sean Dague | db5fadb | 2013-08-09 13:41:33 -0400 | [diff] [blame] | 46 | # cleanup_oslo() - purge possibly old versions of oslo | 
 | 47 | function cleanup_oslo() { | 
| Alessio Ababilov | c2a4c92 | 2013-08-16 21:53:22 +0300 | [diff] [blame] | 48 |     # this means we've got an old oslo installed, lets get rid of it | 
| Attila Fazekas | 025fc5e | 2013-08-13 18:55:33 +0200 | [diff] [blame] | 49 |     if ! python -c 'import oslo.config' 2>/dev/null; then | 
| Sean Dague | db5fadb | 2013-08-09 13:41:33 -0400 | [diff] [blame] | 50 |         echo "Found old oslo.config... removing to ensure consistency" | 
 | 51 |         local PIP_CMD=$(get_pip_command) | 
| Alessio Ababilov | c2a4c92 | 2013-08-16 21:53:22 +0300 | [diff] [blame] | 52 |         pip_install oslo.config | 
 | 53 |         sudo $PIP_CMD uninstall -y oslo.config | 
| Sean Dague | db5fadb | 2013-08-09 13:41:33 -0400 | [diff] [blame] | 54 |     fi | 
 | 55 | } | 
 | 56 |  | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 57 | # Restore xtrace | 
 | 58 | $XTRACE | 
 | 59 |  | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 60 | # Tell emacs to use shell-script-mode | 
 | 61 | ## Local variables: | 
 | 62 | ## mode: shell-script | 
 | 63 | ## End: |