Browse code

Robustify shocco install and config

* shocco has some non-optional prereqs, make sure they are present if
shocco is being installed
* set the path to installed shocco correctly
* add the working dir to .gitignore

Change-Id: If786ea9e28d3595775f7b86d2fe760dff8047f49

Dean Troyer authored on 2013/11/06 17:15:11
Showing 2 changed files
... ...
@@ -13,5 +13,6 @@ stack-screenrc
13 13
 accrc
14 14
 .stackenv
15 15
 .prereqs
16
+devstack-docs-*
16 17
 docs/
17 18
 docs-files
... ...
@@ -28,22 +28,31 @@ MASTER_BRANCH=${MASTER_BRANCH:-master}
28 28
 # http://devstack.org is a GitHub gh-pages site in the https://github.com/cloudbuilders/devtack.git repo
29 29
 GH_PAGES_REPO=git@github.com:cloudbuilders/devstack.git
30 30
 
31
+# Keep track of the devstack directory
32
+TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
33
+
31 34
 # Uses this shocco branch: https://github.com/dtroyer/shocco/tree/rst_support
32 35
 SHOCCO=${SHOCCO:-shocco}
33 36
 if ! which shocco; then
34
-    if [[ ! -x shocco/shocco ]]; then
37
+    if [[ ! -x $TOP_DIR/shocco/shocco ]]; then
35 38
         if [[ -z "$INSTALL_SHOCCO" ]]; then
36 39
             echo "shocco not found in \$PATH, please set environment variable SHOCCO"
37 40
             exit 1
38 41
         fi
39 42
         echo "Installing local copy of shocco"
43
+        if ! which pygmentize; then
44
+            sudo pip install Pygments
45
+        fi
46
+        if ! which rst2html.py; then
47
+            sudo pip install docutils
48
+        fi
40 49
         git clone -b rst_support https://github.com/dtroyer/shocco shocco
41 50
         cd shocco
42 51
         ./configure
43 52
         make
44 53
         cd ..
45 54
     fi
46
-    SHOCCO=shocco/shocco
55
+    SHOCCO=$TOP_DIR/shocco/shocco
47 56
 fi
48 57
 
49 58
 # Process command-line args