From a856f5a573af6931b73228904d087239ed5e66c3 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sat, 27 Oct 2012 04:51:54 +0100 Subject: [PATCH] Take care of whitespace when parsing versions. Installing from git on Ubuntu without installing from package first. --- bootstrap-salt-minion.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bootstrap-salt-minion.sh b/bootstrap-salt-minion.sh index 0380227..81a89b7 100755 --- a/bootstrap-salt-minion.sh +++ b/bootstrap-salt-minion.sh @@ -225,9 +225,7 @@ __gather_linux_system_info() { [ ! -f "/etc/${rsource}" ] && continue n=$(echo ${rsource} | sed -e 's/[_-]release$//' -e 's/[_-]version$//') - v=$(__parse_version_string $( - (grep VERSION /etc/${rsource}; cat /etc/${rsource}) | grep '[0-9]' | sed -e 'q' - )) + v=$(__parse_version_string "$((grep VERSION /etc/${rsource}; cat /etc/${rsource}) | grep '[0-9]' | sed -e 'q')") case $(echo ${n} | tr '[:upper:]' '[:lower:]') in redhat ) if [ ".$(egrep '(Red Hat Enterprise Linux|CentOS)' /etc/${rsource})" != . ]; then @@ -422,7 +420,7 @@ install_ubuntu_git_deps() { apt-get install -y python-software-properties add-apt-repository ppa:saltstack/salt apt-get update - apt-get install -y salt-minion git-core + apt-get install -y git python-yaml python-m2crypto python-crypto msgpack-python python-zmq python-jinja2 } install_ubuntu_1110_post() { @@ -438,8 +436,6 @@ install_ubuntu_daily() { } install_ubuntu_git() { - rm -rf /usr/share/pyshared/salt* - rm -rf /usr/bin/salt-* mkdir -p /root/git cd /root/git git clone git://github.com/saltstack/salt.git @@ -449,6 +445,11 @@ install_ubuntu_git() { } install_ubuntu_git_post() { + for fname in $(echo "minion master syndic"); do + cp /root/git/salt/debian/salt-$fname.init /etc/init.d/salt-$fname + cp /root/git/salt/debian/salt-$fname.upstart /etc/init/salt-$fname.conf + chmod +x /etc/init.d/salt-$fname + done service salt-minion start } #