From 2dc51c0febf508d70560974a12d87e3672d4f310 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Mon, 19 Nov 2012 14:10:00 -0800 Subject: [PATCH] Seems like nova uses 1.2, others use 1.3+ --- .anvilrc | 1 + conf/distros/rhel.yaml | 1 - smithy | 62 +++++++++++++++++++++++++----------------- tools/pip-requires | 5 ++++ tools/pkg-requires | 13 +++++++++ 5 files changed, 56 insertions(+), 26 deletions(-) create mode 100644 .anvilrc create mode 100644 tools/pip-requires create mode 100644 tools/pkg-requires diff --git a/.anvilrc b/.anvilrc new file mode 100644 index 00000000..d4f1aaf4 --- /dev/null +++ b/.anvilrc @@ -0,0 +1 @@ +# Any overrides diff --git a/conf/distros/rhel.yaml b/conf/distros/rhel.yaml index 62182ae2..47ca7417 100644 --- a/conf/distros/rhel.yaml +++ b/conf/distros/rhel.yaml @@ -249,7 +249,6 @@ components: - name: nosehtmloutput - name: openstack.nose_plugin - name: pep8 # The rhel version appears to not be new enough... - version: "1.2" - name: prettytable version: "0.6.1" - name: pycrypto diff --git a/smithy b/smithy index b39111df..6a962181 100755 --- a/smithy +++ b/smithy @@ -7,10 +7,15 @@ fi shopt -s nocasematch -# Possible locations of the epel rpm/list url RHEL_VERSION=$(lsb_release -r | awk '{ print $2 }' | cut -d"." -f1) EPEL_RPM_LIST="http://mirrors.kernel.org/fedora-epel/$RHEL_VERSION/i386" NODE_RPM_URL="http://nodejs.tchol.org/repocfg/el/nodejs-stable-release.noarch.rpm" +PKG_DEPS=$(cat "tools/pkg-requires" | egrep -v "^\s*(#|$)") +PIP_DEP_FN="tools/pip-requires" +YUM_OPTS="--assumeyes --nogpgcheck" + +# Source in our variables (or overrides) +source ".anvilrc" ARGS="$@" VER=$(python -c "from anvil import version; print version.version_string()") @@ -27,24 +32,8 @@ if [ -z "$BOOT_FILES" ]; then BOOT_FILES="${BOOT_FILES} ${HOME}/$BOOT_FN" fi -has_bootstrapped() +bootstrap_node() { - for i in $BOOT_FILES; do - if [ -f $i ]; then - contents=`cat $i` - if [ "$contents" == "$VER" ]; then - return 0 - fi - fi - done - return 1 -} - -bootstrap_rh() -{ - echo "Bootstrapping RHEL: $1" - echo "Please wait..." - echo "Installing node.js yum repository configuration." JS_REPO_RPM_FN=$(basename $NODE_RPM_URL) if [ ! -f "/tmp/$JS_REPO_RPM_FN" ]; then @@ -55,8 +44,11 @@ bootstrap_rh() fi fi echo "Installing /tmp/$JS_REPO_RPM_FN..." - yum install --assumeyes --nogpgcheck -t "/tmp/$JS_REPO_RPM_FN" 2>&1 + yum install $YUM_OPTS -t "/tmp/$JS_REPO_RPM_FN" 2>&1 +} +bootstrap_epel() +{ echo "Locating the EPEL rpm..." if [ -z "$EPEL_RPM" ]; then EPEL_RPM=$(curl -s "$EPEL_RPM_LIST/" | grep -io ">\s*epel.*.rpm\s*<" | grep -io "epel.*.rpm") @@ -72,15 +64,35 @@ bootstrap_rh() fi fi echo "Installing /tmp/$EPEL_RPM..." - yum install --assumeyes --nogpgcheck -t "/tmp/$EPEL_RPM" 2>&1 + yum install $YUM_OPTS -t "/tmp/$EPEL_RPM" 2>&1 +} + +has_bootstrapped() +{ + for i in $BOOT_FILES; do + if [ -f $i ]; then + contents=`cat $i` + if [ "$contents" == "$VER" ]; then + return 0 + fi + fi + done + return 1 +} + +bootstrap_rhel() +{ + echo "Bootstrapping RHEL: $1" + echo "Please wait..." + bootstrap_node + bootstrap_epel + bootstrap_dependencies echo "Installing distribution dependencies..." - pkgs="gcc git pylint python python-netifaces python-pep8 python-cheetah" - pkgs="$pkgs python-pip python-progressbar PyYAML python-ordereddict python-iso8601" - yum install -y $pkgs 2>&1 + yum install $YUM_OPTS $PKG_DEPS 2>&1 echo "Installing pypi dependencies..." - pip-python install -U -I termcolor iniparse hgtools "keyring>=0.9.2" + pip-python install -U -I -r "$PIP_DEP_FN" return 0 } @@ -113,7 +125,7 @@ if [[ "$TYPE" =~ "Red Hat Enterprise Linux Server" ]]; then echo "This script must be ran on RHEL 6.0+ and not RHEL $RH_VER." puke fi - bootstrap_rh $RH_VER + bootstrap_rhel $RH_VER if [ $? -eq 0 ]; then for i in $BOOT_FILES; do echo "$VER" > $i diff --git a/tools/pip-requires b/tools/pip-requires new file mode 100644 index 00000000..533eab96 --- /dev/null +++ b/tools/pip-requires @@ -0,0 +1,5 @@ +termcolor +iniparse +hgtools +keyring>=0.9.2 + diff --git a/tools/pkg-requires b/tools/pkg-requires new file mode 100644 index 00000000..1ba6d6bb --- /dev/null +++ b/tools/pkg-requires @@ -0,0 +1,13 @@ +gcc +git +pylint +python +python-netifaces +# python-pep8 (conflicts with the ones to be installed) +python-cheetah +# python-pip (conflicts with the ones to be installed) +python-progressbar +PyYAML +python-ordereddict +python-iso8601 +