Skip to content

Instantly share code, notes, and snippets.

@bonyiii
Created June 18, 2010 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bonyiii/443716 to your computer and use it in GitHub Desktop.
Save bonyiii/443716 to your computer and use it in GitHub Desktop.
include_recipe "gentoo::portage"
use_flags << node[:subversion][:use_flags].to_a.each do |use_flag|
"/bin/egrep '(\"| )#{bash-completion}{use_flag}(\"| )' | "
end
bash "test_use_flags" do
user "root"
code <<-EOC
#!/bin/sh
RESULT=$(/usr/bin/emerge -pv subversion /bin/grep 'subversion' | #{use_flags} /usr/bin/wc -l)
# No lines means that use flags on client differs from those what we want.
if [ $RESULT -eq 0 ]
then
exit 1
else
exit 0
fi
EOC
notifies [:purge, :install], resources(:gentoo_package => "subversion")
end
gentoo_package "subversion" do
name "dev-util/subversion"
action :install
use node[:subversion][:use_flags].to_s
end
execute "eselect bashcomp enable subversion"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment