microwave 0.1004.4 → 0.1004.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. data/README.rdoc +0 -3
  2. data/lib/chef/client.rb +2 -11
  3. data/lib/chef/platform.rb +1 -192
  4. data/lib/chef/providers.rb +0 -68
  5. data/lib/chef/resources.rb +0 -36
  6. data/lib/chef/version.rb +1 -1
  7. metadata +123 -239
  8. data/lib/chef/provider/breakpoint.rb +0 -31
  9. data/lib/chef/provider/cron.rb +0 -186
  10. data/lib/chef/provider/cron/solaris.rb +0 -195
  11. data/lib/chef/provider/deploy.rb +0 -343
  12. data/lib/chef/provider/deploy/revision.rb +0 -80
  13. data/lib/chef/provider/deploy/timestamped.rb +0 -33
  14. data/lib/chef/provider/env.rb +0 -152
  15. data/lib/chef/provider/env/windows.rb +0 -75
  16. data/lib/chef/provider/erl_call.rb +0 -101
  17. data/lib/chef/provider/git.rb +0 -243
  18. data/lib/chef/provider/group.rb +0 -133
  19. data/lib/chef/provider/group/aix.rb +0 -70
  20. data/lib/chef/provider/group/dscl.rb +0 -121
  21. data/lib/chef/provider/group/gpasswd.rb +0 -53
  22. data/lib/chef/provider/group/groupadd.rb +0 -81
  23. data/lib/chef/provider/group/pw.rb +0 -84
  24. data/lib/chef/provider/group/suse.rb +0 -53
  25. data/lib/chef/provider/group/usermod.rb +0 -57
  26. data/lib/chef/provider/group/windows.rb +0 -79
  27. data/lib/chef/provider/ifconfig.rb +0 -134
  28. data/lib/chef/provider/log.rb +0 -54
  29. data/lib/chef/provider/mdadm.rb +0 -91
  30. data/lib/chef/provider/mount.rb +0 -114
  31. data/lib/chef/provider/mount/mount.rb +0 -240
  32. data/lib/chef/provider/mount/windows.rb +0 -81
  33. data/lib/chef/provider/ohai.rb +0 -42
  34. data/lib/chef/provider/package.rb +0 -163
  35. data/lib/chef/provider/package/apt.rb +0 -135
  36. data/lib/chef/provider/package/dpkg.rb +0 -115
  37. data/lib/chef/provider/package/easy_install.rb +0 -136
  38. data/lib/chef/provider/package/freebsd.rb +0 -125
  39. data/lib/chef/provider/package/macports.rb +0 -105
  40. data/lib/chef/provider/package/pacman.rb +0 -101
  41. data/lib/chef/provider/package/portage.rb +0 -135
  42. data/lib/chef/provider/package/rpm.rb +0 -104
  43. data/lib/chef/provider/package/rubygems.rb +0 -465
  44. data/lib/chef/provider/package/solaris.rb +0 -130
  45. data/lib/chef/provider/package/yum.rb +0 -1128
  46. data/lib/chef/provider/package/zypper.rb +0 -144
  47. data/lib/chef/provider/route.rb +0 -193
  48. data/lib/chef/provider/ruby_block.rb +0 -34
  49. data/lib/chef/provider/script.rb +0 -55
  50. data/lib/chef/provider/service.rb +0 -122
  51. data/lib/chef/provider/service/arch.rb +0 -116
  52. data/lib/chef/provider/service/debian.rb +0 -130
  53. data/lib/chef/provider/service/freebsd.rb +0 -154
  54. data/lib/chef/provider/service/gentoo.rb +0 -53
  55. data/lib/chef/provider/service/init.rb +0 -71
  56. data/lib/chef/provider/service/insserv.rb +0 -52
  57. data/lib/chef/provider/service/redhat.rb +0 -60
  58. data/lib/chef/provider/service/simple.rb +0 -120
  59. data/lib/chef/provider/service/solaris.rb +0 -85
  60. data/lib/chef/provider/service/systemd.rb +0 -102
  61. data/lib/chef/provider/service/upstart.rb +0 -198
  62. data/lib/chef/provider/service/windows.rb +0 -146
  63. data/lib/chef/provider/subversion.rb +0 -197
  64. data/lib/chef/provider/user.rb +0 -186
  65. data/lib/chef/provider/user/dscl.rb +0 -280
  66. data/lib/chef/provider/user/pw.rb +0 -113
  67. data/lib/chef/provider/user/useradd.rb +0 -137
  68. data/lib/chef/provider/user/windows.rb +0 -124
  69. data/lib/chef/resource/apt_package.rb +0 -34
  70. data/lib/chef/resource/bash.rb +0 -33
  71. data/lib/chef/resource/breakpoint.rb +0 -35
  72. data/lib/chef/resource/cron.rb +0 -188
  73. data/lib/chef/resource/csh.rb +0 -33
  74. data/lib/chef/resource/deploy.rb +0 -380
  75. data/lib/chef/resource/deploy_revision.rb +0 -40
  76. data/lib/chef/resource/dpkg_package.rb +0 -34
  77. data/lib/chef/resource/easy_install_package.rb +0 -57
  78. data/lib/chef/resource/erl_call.rb +0 -83
  79. data/lib/chef/resource/freebsd_package.rb +0 -35
  80. data/lib/chef/resource/gem_package.rb +0 -53
  81. data/lib/chef/resource/git.rb +0 -46
  82. data/lib/chef/resource/group.rb +0 -70
  83. data/lib/chef/resource/ifconfig.rb +0 -134
  84. data/lib/chef/resource/log.rb +0 -62
  85. data/lib/chef/resource/macports_package.rb +0 -29
  86. data/lib/chef/resource/mdadm.rb +0 -82
  87. data/lib/chef/resource/mount.rb +0 -134
  88. data/lib/chef/resource/ohai.rb +0 -40
  89. data/lib/chef/resource/package.rb +0 -80
  90. data/lib/chef/resource/pacman_package.rb +0 -33
  91. data/lib/chef/resource/perl.rb +0 -33
  92. data/lib/chef/resource/portage_package.rb +0 -33
  93. data/lib/chef/resource/python.rb +0 -33
  94. data/lib/chef/resource/route.rb +0 -135
  95. data/lib/chef/resource/rpm_package.rb +0 -34
  96. data/lib/chef/resource/ruby.rb +0 -33
  97. data/lib/chef/resource/ruby_block.rb +0 -40
  98. data/lib/chef/resource/scm.rb +0 -147
  99. data/lib/chef/resource/script.rb +0 -60
  100. data/lib/chef/resource/service.rb +0 -160
  101. data/lib/chef/resource/solaris_package.rb +0 -36
  102. data/lib/chef/resource/subversion.rb +0 -36
  103. data/lib/chef/resource/timestamped_deploy.rb +0 -31
  104. data/lib/chef/resource/user.rb +0 -130
  105. data/lib/chef/resource/yum_package.rb +0 -63
@@ -1,136 +0,0 @@
1
- #
2
- # Author:: Joe Williams (<joe@joetify.com>)
3
- # Copyright:: Copyright (c) 2009 Joe Williams
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- require 'chef/provider/package'
20
- require 'chef/mixin/command'
21
- require 'chef/mixin/shell_out'
22
- require 'chef/resource/package'
23
- require 'chef/mixin/shell_out'
24
-
25
- class Chef
26
- class Provider
27
- class Package
28
- class EasyInstall < Chef::Provider::Package
29
-
30
- include Chef::Mixin::ShellOut
31
-
32
- def install_check(name)
33
- check = false
34
-
35
- begin
36
- # first check to see if we can import it
37
- output = shell_out!("#{python_binary_path} -c \"import #{name}\"", :returns=>[0,1]).stderr
38
- if output.include? "ImportError"
39
- # then check to see if its on the path
40
- output = shell_out!("#{python_binary_path} -c \"import sys; print sys.path\"", :returns=>[0,1]).stdout
41
- if output.downcase.include? "#{name.downcase}"
42
- check = true
43
- end
44
- else
45
- check = true
46
- end
47
- rescue
48
- # it's probably not installed
49
- end
50
-
51
- check
52
- end
53
-
54
- def easy_install_binary_path
55
- path = @new_resource.easy_install_binary
56
- path ? path : 'easy_install'
57
- end
58
-
59
- def python_binary_path
60
- path = @new_resource.python_binary
61
- path ? path : 'python'
62
- end
63
-
64
- def module_name
65
- m = @new_resource.module_name
66
- m ? m : @new_resource.name
67
- end
68
-
69
- def load_current_resource
70
- @current_resource = Chef::Resource::Package.new(@new_resource.name)
71
- @current_resource.package_name(@new_resource.package_name)
72
- @current_resource.version(nil)
73
-
74
- # get the currently installed version if installed
75
- package_version = nil
76
- if install_check(module_name)
77
- begin
78
- output = shell_out!("#{python_binary_path} -c \"import #{module_name}; print #{module_name}.__version__\"").stdout
79
- package_version = output.strip
80
- rescue
81
- output = shell_out!("#{python_binary_path} -c \"import sys; print sys.path\"", :returns=>[0,1]).stdout
82
-
83
- output_array = output.gsub(/[\[\]]/,'').split(/\s*,\s*/)
84
- package_path = ""
85
-
86
- output_array.each do |entry|
87
- if entry.downcase.include?(@new_resource.package_name)
88
- package_path = entry
89
- end
90
- end
91
-
92
- package_path[/\S\S(.*)\/(.*)-(.*)-py(.*).egg\S/]
93
- package_version = $3
94
- end
95
- end
96
-
97
- if package_version == @new_resource.version
98
- Chef::Log.debug("#{@new_resource} at version #{@new_resource.version}")
99
- @current_resource.version(@new_resource.version)
100
- else
101
- Chef::Log.debug("#{@new_resource} at version #{package_version}")
102
- @current_resource.version(package_version)
103
- end
104
-
105
- @current_resource
106
- end
107
-
108
- def candidate_version
109
- return @candidate_version if @candidate_version
110
-
111
- # do a dry run to get the latest version
112
- result = shell_out!("#{easy_install_binary_path} -n #{@new_resource.package_name}", :returns=>[0,1])
113
- @candidate_version = result.stdout[/(.*)Best match: (.*) (.*)$/, 3]
114
- @candidate_version
115
- end
116
-
117
- def install_package(name, version)
118
- run_command(:command => "#{easy_install_binary_path}#{expand_options(@new_resource.options)} \"#{name}==#{version}\"")
119
- end
120
-
121
- def upgrade_package(name, version)
122
- install_package(name, version)
123
- end
124
-
125
- def remove_package(name, version)
126
- run_command(:command => "#{easy_install_binary_path }#{expand_options(@new_resource.options)} -m #{name}")
127
- end
128
-
129
- def purge_package(name, version)
130
- remove_package(name, version)
131
- end
132
-
133
- end
134
- end
135
- end
136
- end
@@ -1,125 +0,0 @@
1
- #
2
- # Authors:: Bryan McLellan (btm@loftninjas.org)
3
- # Matthew Landauer (matthew@openaustralia.org)
4
- # Copyright:: Copyright (c) 2009 Bryan McLellan, Matthew Landauer
5
- # License:: Apache License, Version 2.0
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
- #
19
-
20
- require 'chef/provider/package'
21
- require 'chef/mixin/shell_out'
22
- require 'chef/resource/package'
23
- require 'chef/mixin/get_source_from_package'
24
-
25
- class Chef
26
- class Provider
27
- class Package
28
- class Freebsd < Chef::Provider::Package
29
- include Chef::Mixin::ShellOut
30
-
31
- include Chef::Mixin::GetSourceFromPackage
32
-
33
- def initialize(*args)
34
- super
35
- @current_resource = Chef::Resource::Package.new(@new_resource.name)
36
- end
37
-
38
- def current_installed_version
39
- pkg_info = shell_out!("pkg_info -E \"#{package_name}*\"", :env => nil, :returns => [0,1])
40
- pkg_info.stdout[/^#{package_name}-(.+)/, 1]
41
- end
42
-
43
- def port_path
44
- case @new_resource.package_name
45
- # When the package name starts with a '/' treat it as the full path to the ports directory
46
- when /^\//
47
- @new_resource.package_name
48
- # Otherwise if the package name contains a '/' not at the start (like 'www/wordpress') treat as a relative
49
- # path from /usr/ports
50
- when /\//
51
- "/usr/ports/#{@new_resource.package_name}"
52
- # Otherwise look up the path to the ports directory using 'whereis'
53
- else
54
- whereis = shell_out!("whereis -s #{@new_resource.package_name}", :env => nil)
55
- unless path = whereis.stdout[/^#{@new_resource.package_name}:\s+(.+)$/, 1]
56
- raise Chef::Exceptions::Package, "Could not find port with the name #{@new_resource.package_name}"
57
- end
58
- path
59
- end
60
- end
61
-
62
- def ports_makefile_variable_value(variable)
63
- make_v = shell_out!("make -V #{variable} -f #{port_path}/Makefile", :env => nil, :returns => [0,1])
64
- make_v.stdout.strip.split($\).first # $\ is the line separator, i.e., newline
65
- end
66
-
67
- def ports_candidate_version
68
- ports_makefile_variable_value("PORTVERSION")
69
- end
70
-
71
- def load_current_resource
72
- @current_resource.package_name(@new_resource.package_name)
73
-
74
- @current_resource.version(current_installed_version)
75
- Chef::Log.debug("#{@new_resource} current version is #{@current_resource.version}") if @current_resource.version
76
-
77
- @candidate_version = ports_candidate_version
78
- Chef::Log.debug("#{@new_resource} ports candidate version is #{@candidate_version}") if @candidate_version
79
-
80
- @current_resource
81
- end
82
-
83
- def latest_link_name
84
- ports_makefile_variable_value("LATEST_LINK")
85
- end
86
-
87
- # The name of the package (without the version number) as understood by pkg_add and pkg_info
88
- def package_name
89
- if ports_makefile_variable_value("PKGNAME") =~ /^(.+)-[^-]+$/
90
- $1
91
- else
92
- raise Chef::Exceptions::Package, "Unexpected form for PKGNAME variable in #{port_path}/Makefile"
93
- end
94
- end
95
-
96
- def install_package(name, version)
97
- unless @current_resource.version
98
- case @new_resource.source
99
- when /^ports$/
100
- shell_out!("make -DBATCH -f #{port_path}/Makefile install", :timeout => 1200, :env => nil).status
101
- when /^http/, /^ftp/
102
- shell_out!("pkg_add -r #{package_name}", :env => { "PACKAGESITE" => @new_resource.source, 'LC_ALL' => nil }).status
103
- Chef::Log.debug("#{@new_resource} installed from: #{@new_resource.source}")
104
- when /^\//
105
- shell_out!("pkg_add #{@new_resource.name}", :env => { "PKG_PATH" => @new_resource.source , 'LC_ALL'=>nil}).status
106
- Chef::Log.debug("#{@new_resource} installed from: #{@new_resource.source}")
107
- else
108
- shell_out!("pkg_add -r #{latest_link_name}", :env => nil).status
109
- end
110
- end
111
- end
112
-
113
- def remove_package(name, version)
114
- # a version is mandatory
115
- if version
116
- shell_out!("pkg_delete #{package_name}-#{version}", :env => nil).status
117
- else
118
- shell_out!("pkg_delete #{package_name}-#{@current_resource.version}", :env => nil).status
119
- end
120
- end
121
-
122
- end
123
- end
124
- end
125
- end
@@ -1,105 +0,0 @@
1
- class Chef
2
- class Provider
3
- class Package
4
- class Macports < Chef::Provider::Package
5
- def load_current_resource
6
- @current_resource = Chef::Resource::Package.new(@new_resource.name)
7
- @current_resource.package_name(@new_resource.package_name)
8
-
9
- @current_resource.version(current_installed_version)
10
- Chef::Log.debug("#{@new_resource} current version is #{@current_resource.version}") if @current_resource.version
11
-
12
- @candidate_version = macports_candidate_version
13
-
14
- if !@new_resource.version and !@candidate_version
15
- raise Chef::Exceptions::Package, "Could not get a candidate version for this package -- #{@new_resource.name} does not seem to be a valid package!"
16
- end
17
-
18
- Chef::Log.debug("#{@new_resource} candidate version is #{@candidate_version}") if @candidate_version
19
-
20
- @current_resource
21
- end
22
-
23
- def current_installed_version
24
- command = "port installed #{@new_resource.package_name}"
25
- output = get_response_from_command(command)
26
-
27
- response = nil
28
- output.each_line do |line|
29
- match = line.match(/^.+ @([^\s]+) \(active\)$/)
30
- response = match[1] if match
31
- end
32
- response
33
- end
34
-
35
- def macports_candidate_version
36
- command = "port info --version #{@new_resource.package_name}"
37
- output = get_response_from_command(command)
38
-
39
- match = output.match(/^version: (.+)$/)
40
-
41
- match ? match[1] : nil
42
- end
43
-
44
- def install_package(name, version)
45
- unless @current_resource.version == version
46
- command = "port#{expand_options(@new_resource.options)} install #{name}"
47
- command << " @#{version}" if version and !version.empty?
48
- run_command_with_systems_locale(
49
- :command => command
50
- )
51
- end
52
- end
53
-
54
- def purge_package(name, version)
55
- command = "port#{expand_options(@new_resource.options)} uninstall #{name}"
56
- command << " @#{version}" if version and !version.empty?
57
- run_command_with_systems_locale(
58
- :command => command
59
- )
60
- end
61
-
62
- def remove_package(name, version)
63
- command = "port#{expand_options(@new_resource.options)} deactivate #{name}"
64
- command << " @#{version}" if version and !version.empty?
65
-
66
- run_command_with_systems_locale(
67
- :command => command
68
- )
69
- end
70
-
71
- def upgrade_package(name, version)
72
- # Saving this to a variable -- weird rSpec behavior
73
- # happens otherwise...
74
- current_version = @current_resource.version
75
-
76
- if current_version.nil? or current_version.empty?
77
- # Macports doesn't like when you upgrade a package
78
- # that hasn't been installed.
79
- install_package(name, version)
80
- elsif current_version != version
81
- run_command_with_systems_locale(
82
- :command => "port#{expand_options(@new_resource.options)} upgrade #{name} @#{version}"
83
- )
84
- end
85
- end
86
-
87
- private
88
- def get_response_from_command(command)
89
- output = nil
90
- status = popen4(command) do |pid, stdin, stdout, stderr|
91
- begin
92
- output = stdout.read
93
- rescue Exception
94
- raise Chef::Exceptions::Package, "Could not read from STDOUT on command: #{command}"
95
- end
96
- end
97
- unless status.exitstatus == 0 || status.exitstatus == 1
98
- raise Chef::Exceptions::Package, "#{command} failed - #{status.insect}!"
99
- end
100
- output
101
- end
102
- end
103
- end
104
- end
105
- end
@@ -1,101 +0,0 @@
1
- #
2
- # Author:: Jan Zimmek (<jan.zimmek@web.de>)
3
- # Copyright:: Copyright (c) 2010 Jan Zimmek
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- require 'chef/provider/package'
20
- require 'chef/mixin/command'
21
- require 'chef/resource/package'
22
-
23
- class Chef
24
- class Provider
25
- class Package
26
- class Pacman < Chef::Provider::Package
27
-
28
- def load_current_resource
29
- @current_resource = Chef::Resource::Package.new(@new_resource.name)
30
- @current_resource.package_name(@new_resource.package_name)
31
-
32
- @current_resource.version(nil)
33
-
34
- Chef::Log.debug("#{@new_resource} checking pacman for #{@new_resource.package_name}")
35
- status = popen4("pacman -Qi #{@new_resource.package_name}") do |pid, stdin, stdout, stderr|
36
- stdout.each do |line|
37
- case line
38
- when /^Version(\s?)*: (.+)$/
39
- Chef::Log.debug("#{@new_resource} current version is #{$2}")
40
- @current_resource.version($2)
41
- end
42
- end
43
- end
44
-
45
- unless status.exitstatus == 0 || status.exitstatus == 1
46
- raise Chef::Exceptions::Package, "pacman failed - #{status.inspect}!"
47
- end
48
-
49
- @current_resource
50
- end
51
-
52
- def candidate_version
53
- return @candidate_version if @candidate_version
54
-
55
- status = popen4("pacman -Ss #{@new_resource.package_name}") do |pid, stdin, stdout, stderr|
56
- stdout.each do |line|
57
- case line
58
- when /^(extra|core|community)\/#{Regexp.escape(@new_resource.package_name)} (.+)$/
59
- # $2 contains a string like "4.4.0-1 (kde kdenetwork)" or "3.10-4 (base)"
60
- # simply split by space and use first token
61
- @candidate_version = $2.split(" ").first
62
- end
63
- end
64
- end
65
-
66
- unless status.exitstatus == 0 || status.exitstatus == 1
67
- raise Chef::Exceptions::Package, "pacman failed - #{status.inspect}!"
68
- end
69
-
70
- unless @candidate_version
71
- raise Chef::Exceptions::Package, "pacman does not have a version of package #{@new_resource.package_name}"
72
- end
73
-
74
- @candidate_version
75
-
76
- end
77
-
78
- def install_package(name, version)
79
- run_command_with_systems_locale(
80
- :command => "pacman --sync --noconfirm --noprogressbar#{expand_options(@new_resource.options)} #{name}"
81
- )
82
- end
83
-
84
- def upgrade_package(name, version)
85
- install_package(name, version)
86
- end
87
-
88
- def remove_package(name, version)
89
- run_command_with_systems_locale(
90
- :command => "pacman --remove --noconfirm --noprogressbar#{expand_options(@new_resource.options)} #{name}"
91
- )
92
- end
93
-
94
- def purge_package(name, version)
95
- remove_package(name, version)
96
- end
97
-
98
- end
99
- end
100
- end
101
- end