shell dot on steroids https://pagure.io/shellfu

sw.sh 910B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. ffoo import core
  3. ffoo import yummy
  4. any_install() {
  5. #
  6. # Read key=value pair, install $value by $key
  7. #
  8. local tool pkg
  9. sed -e 's/^\s*//; s/\s*=\s*/=/;' \
  10. | while read line;
  11. do
  12. tool=$(cut -d= -f1 <<<"$line")
  13. pkg=$(cut -d= -f2- <<<"$line")
  14. debug -v line tool pkg
  15. think "installing $pkg"
  16. case $tool in
  17. cpan)
  18. yum_install_if_needed perl-CPAN
  19. cpan $pkg
  20. ;;
  21. pypi)
  22. yum_install_if_needed python-setuptools
  23. easy_install -q $pkg
  24. ;;
  25. yum)
  26. yum_install_if_needed $pkg
  27. ;;
  28. *)
  29. warn "unsupported tool: $tool to install $pkg"
  30. ;;
  31. esac
  32. done
  33. }