#!/bin/bash ffoo import core ffoo import yummy any_install() { # # Read key=value pair, install $value by $key # local tool pkg sed -e 's/^\s*//; s/\s*=\s*/=/;' \ | while read line; do tool=$(cut -d= -f1 <<<"$line") pkg=$(cut -d= -f2- <<<"$line") debug -v line tool pkg think "installing $pkg" case $tool in cpan) yum_install_if_needed perl-CPAN cpan $pkg ;; pypi) yum_install_if_needed python-setuptools easy_install -q $pkg ;; yum) yum_install_if_needed $pkg ;; *) warn "unsupported tool: $tool to install $pkg" ;; esac done }