2013-02-07 14:09:57 -05:00
|
|
|
old_pkgs =
|
|
|
|
if(::File.exist?(node[:omnibus_updater][:cache_dir]))
|
|
|
|
Dir.glob(File.join(node[:omnibus_updater][:cache_dir], 'chef*')).find_all do |file|
|
2013-07-05 10:56:57 -04:00
|
|
|
!file.include?(node[:omnibus_updater][:version].to_s) && !file.scan(/\.(rpm|deb)$/).empty?
|
2013-02-07 14:09:57 -05:00
|
|
|
end
|
|
|
|
else
|
|
|
|
[]
|
|
|
|
end
|
|
|
|
|
|
|
|
old_pkgs.each do |filename|
|
|
|
|
file filename do
|
|
|
|
action :delete
|
|
|
|
end
|
|
|
|
end
|