Dean Troyer | 9acc12a | 2013-08-09 15:09:31 -0500 | [diff] [blame^] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # **fixup_stuff.sh** |
| 4 | |
| 5 | # fixup_stuff.sh |
| 6 | # |
| 7 | # All distro and package specific hacks go in here |
| 8 | # - prettytable 0.7.2 permissions are 600 in the package and |
| 9 | # pip 1.4 doesn't fix it (1.3 did) |
| 10 | # - httplib2 0.8 permissions are 600 in the package and |
| 11 | # pip 1.4 doesn't fix it (1.3 did) |
| 12 | |
| 13 | # Keep track of the current directory |
| 14 | TOOLS_DIR=$(cd $(dirname "$0") && pwd) |
| 15 | TOP_DIR=`cd $TOOLS_DIR/..; pwd` |
| 16 | |
| 17 | # Change dir to top of devstack |
| 18 | cd $TOP_DIR |
| 19 | |
| 20 | # Import common functions |
| 21 | source $TOP_DIR/functions |
| 22 | |
| 23 | FILES=$TOP_DIR/files |
| 24 | |
| 25 | # Pre-install affected packages so we can fix the permissions |
| 26 | sudo pip install prettytable |
| 27 | sudo pip install httplib2 |
| 28 | |
| 29 | SITE_DIRS=$(python -c "import site; import os; print os.linesep.join(site.getsitepackages())") |
| 30 | for dir in $SITE_DIRS; do |
| 31 | |
| 32 | # Fix prettytable 0.7.2 permissions |
| 33 | if [[ -r $dir/prettytable.py ]]; then |
| 34 | sudo chmod +r $dir/prettytable-0.7.2*/* |
| 35 | fi |
| 36 | |
| 37 | # Fix httplib2 0.8 permissions |
| 38 | httplib_dir=httplib2-0.8.egg-info |
| 39 | if [[ -d $dir/$httplib_dir ]]; then |
| 40 | sudo chmod +r $dir/$httplib_dir/* |
| 41 | fi |
| 42 | |
| 43 | done |