chef 0.10.0.beta.6 → 0.10.0.beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/chef/application.rb +3 -0
- data/lib/chef/application/client.rb +34 -2
- data/lib/chef/checksum.rb +2 -2
- data/lib/chef/checksum_cache.rb +2 -2
- data/lib/chef/client.rb +7 -5
- data/lib/chef/cookbook/remote_file_vendor.rb +1 -1
- data/lib/chef/cookbook/syntax_check.rb +2 -2
- data/lib/chef/cookbook_version.rb +5 -0
- data/lib/chef/data_bag_item.rb +1 -1
- data/lib/chef/environment.rb +31 -9
- data/lib/chef/file_access_control.rb +7 -3
- data/lib/chef/index_queue/indexable.rb +2 -2
- data/lib/chef/knife.rb +1 -1
- data/lib/chef/knife/bootstrap.rb +1 -1
- data/lib/chef/knife/cookbook_site_install.rb +1 -1
- data/lib/chef/knife/cookbook_site_share.rb +2 -2
- data/lib/chef/knife/cookbook_upload.rb +32 -11
- data/lib/chef/knife/core/subcommand_loader.rb +24 -13
- data/lib/chef/knife/core/text_formatter.rb +2 -2
- data/lib/chef/knife/core/ui.rb +1 -1
- data/lib/chef/knife/search.rb +1 -1
- data/lib/chef/knife/ssh.rb +1 -0
- data/lib/chef/mixin/shell_out.rb +2 -2
- data/lib/chef/node.rb +7 -4
- data/lib/chef/provider/cookbook_file.rb +4 -5
- data/lib/chef/provider/cron.rb +3 -3
- data/lib/chef/provider/cron/solaris.rb +7 -7
- data/lib/chef/provider/deploy.rb +52 -29
- data/lib/chef/provider/directory.rb +8 -8
- data/lib/chef/provider/env.rb +8 -8
- data/lib/chef/provider/erl_call.rb +7 -6
- data/lib/chef/provider/execute.rb +7 -2
- data/lib/chef/provider/file.rb +9 -9
- data/lib/chef/provider/git.rb +17 -8
- data/lib/chef/provider/group.rb +6 -6
- data/lib/chef/provider/group/aix.rb +1 -1
- data/lib/chef/provider/group/dscl.rb +2 -2
- data/lib/chef/provider/group/gpasswd.rb +3 -3
- data/lib/chef/provider/group/groupadd.rb +1 -1
- data/lib/chef/provider/group/pw.rb +3 -3
- data/lib/chef/provider/group/usermod.rb +2 -2
- data/lib/chef/provider/group/windows.rb +1 -1
- data/lib/chef/provider/ifconfig.rb +9 -7
- data/lib/chef/provider/link.rb +27 -24
- data/lib/chef/provider/mdadm.rb +10 -10
- data/lib/chef/provider/mount.rb +10 -13
- data/lib/chef/provider/mount/mount.rb +10 -10
- data/lib/chef/provider/mount/windows.rb +4 -3
- data/lib/chef/provider/ohai.rb +2 -1
- data/lib/chef/provider/package.rb +10 -6
- data/lib/chef/provider/package/apt.rb +18 -18
- data/lib/chef/provider/package/dpkg.rb +3 -3
- data/lib/chef/provider/package/easy_install.rb +2 -2
- data/lib/chef/provider/package/freebsd.rb +4 -5
- data/lib/chef/provider/package/macports.rb +2 -2
- data/lib/chef/provider/package/pacman.rb +2 -2
- data/lib/chef/provider/package/portage.rb +1 -1
- data/lib/chef/provider/package/rpm.rb +3 -3
- data/lib/chef/provider/package/rubygems.rb +7 -7
- data/lib/chef/provider/package/solaris.rb +9 -9
- data/lib/chef/provider/package/yum.rb +4 -4
- data/lib/chef/provider/package/zypper.rb +5 -11
- data/lib/chef/provider/remote_directory.rb +15 -14
- data/lib/chef/provider/remote_file.rb +11 -12
- data/lib/chef/provider/route.rb +8 -10
- data/lib/chef/provider/ruby_block.rb +1 -0
- data/lib/chef/provider/service.rb +10 -16
- data/lib/chef/provider/service/debian.rb +1 -1
- data/lib/chef/provider/service/freebsd.rb +16 -18
- data/lib/chef/provider/service/gentoo.rb +2 -3
- data/lib/chef/provider/service/simple.rb +7 -5
- data/lib/chef/provider/service/upstart.rb +8 -8
- data/lib/chef/provider/service/windows.rb +3 -3
- data/lib/chef/provider/subversion.rb +12 -9
- data/lib/chef/provider/template.rb +2 -3
- data/lib/chef/provider/user.rb +13 -14
- data/lib/chef/provider/user/dscl.rb +2 -2
- data/lib/chef/provider/user/pw.rb +4 -4
- data/lib/chef/provider/user/useradd.rb +3 -3
- data/lib/chef/provider/user/windows.rb +3 -3
- data/lib/chef/resource.rb +4 -3
- data/lib/chef/resource/deploy.rb +1 -1
- data/lib/chef/rest/rest_request.rb +2 -2
- data/lib/chef/run_context.rb +1 -1
- data/lib/chef/shell_out.rb +13 -1
- data/lib/chef/solr_query.rb +1 -1
- data/lib/chef/solr_query/solr_http_request.rb +1 -1
- data/lib/chef/tasks/chef_repo.rake +74 -0
- data/lib/chef/version.rb +1 -1
- metadata +2 -2
data/lib/chef/provider/ohai.rb
CHANGED
@@ -43,6 +43,7 @@ class Chef
|
|
43
43
|
elsif @current_resource.version == nil
|
44
44
|
install_version = candidate_version
|
45
45
|
else
|
46
|
+
Chef::Log.debug("#{@new_resource} is already installed - nothing to do")
|
46
47
|
return
|
47
48
|
end
|
48
49
|
|
@@ -50,7 +51,6 @@ class Chef
|
|
50
51
|
raise(Chef::Exceptions::Package, "No version specified, and no candidate version available for #{@new_resource.package_name}")
|
51
52
|
end
|
52
53
|
|
53
|
-
Chef::Log.info("Installing #{@new_resource} version #{install_version}")
|
54
54
|
|
55
55
|
# We need to make sure we handle the preseed file
|
56
56
|
if @new_resource.response_file
|
@@ -61,25 +61,29 @@ class Chef
|
|
61
61
|
if status
|
62
62
|
@new_resource.updated_by_last_action(true)
|
63
63
|
end
|
64
|
+
Chef::Log.info("#{@new_resource} installed version #{install_version}")
|
64
65
|
end
|
65
66
|
|
66
67
|
def action_upgrade
|
67
68
|
if @current_resource.version != candidate_version
|
68
69
|
orig_version = @current_resource.version || "uninstalled"
|
69
|
-
Chef::Log.info("Upgrading #{@new_resource} version from #{orig_version} to #{candidate_version}")
|
70
70
|
status = upgrade_package(@new_resource.package_name, candidate_version)
|
71
71
|
if status
|
72
72
|
@new_resource.updated_by_last_action(true)
|
73
73
|
end
|
74
|
+
Chef::Log.info("#{@new_resource} upgraded from #{orig_version} to #{candidate_version}")
|
75
|
+
else
|
76
|
+
Chef::Log.debug("#{@new_resource} is at the latest version - nothing to do")
|
74
77
|
end
|
75
78
|
end
|
76
79
|
|
77
80
|
def action_remove
|
78
81
|
if removing_package?
|
79
|
-
Chef::Log.info("Removing #{@new_resource}")
|
80
82
|
remove_package(@current_resource.package_name, @new_resource.version)
|
81
83
|
@new_resource.updated_by_last_action(true)
|
84
|
+
Chef::Log.info("#{@new_resource} removed")
|
82
85
|
else
|
86
|
+
Chef::Log.debug("#{@new_resource} package does not exist - nothing to do")
|
83
87
|
end
|
84
88
|
end
|
85
89
|
|
@@ -97,9 +101,9 @@ class Chef
|
|
97
101
|
|
98
102
|
def action_purge
|
99
103
|
if removing_package?
|
100
|
-
Chef::Log.info("Purging #{@new_resource}")
|
101
104
|
purge_package(@current_resource.package_name, @new_resource.version)
|
102
105
|
@new_resource.updated_by_last_action(true)
|
106
|
+
Chef::Log.info("#{@new_resource} purged")
|
103
107
|
end
|
104
108
|
end
|
105
109
|
|
@@ -125,8 +129,8 @@ class Chef
|
|
125
129
|
|
126
130
|
def get_preseed_file(name, version)
|
127
131
|
resource = preseed_resource(name, version)
|
128
|
-
Chef::Log.debug("Fetching preseed file to #{resource.path}")
|
129
132
|
resource.run_action('create')
|
133
|
+
Chef::Log.debug("#{@new_resource} fetched preseed file to #{resource.path}")
|
130
134
|
|
131
135
|
if resource.updated_by_last_action?
|
132
136
|
resource.path
|
@@ -141,7 +145,7 @@ class Chef
|
|
141
145
|
# The full path where the preseed file will be stored
|
142
146
|
cache_seed_to = "#{file_cache_dir}/#{name}-#{version}.seed"
|
143
147
|
|
144
|
-
Chef::Log.debug("
|
148
|
+
Chef::Log.debug("#{@new_resource} fetching preseed file to #{cache_seed_to}")
|
145
149
|
|
146
150
|
remote_file = Chef::Resource::CookbookFile.new(cache_seed_to, run_context)
|
147
151
|
remote_file.cookbook_name = @new_resource.cookbook_name
|
@@ -6,9 +6,9 @@
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
8
8
|
# You may obtain a copy of the License at
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
11
|
+
#
|
12
12
|
# Unless required by applicable law or agreed to in writing, software
|
13
13
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
14
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@@ -23,27 +23,27 @@ require 'chef/resource/package'
|
|
23
23
|
class Chef
|
24
24
|
class Provider
|
25
25
|
class Package
|
26
|
-
class Apt < Chef::Provider::Package
|
27
|
-
|
26
|
+
class Apt < Chef::Provider::Package
|
27
|
+
|
28
28
|
def load_current_resource
|
29
29
|
@current_resource = Chef::Resource::Package.new(@new_resource.name)
|
30
30
|
@current_resource.package_name(@new_resource.package_name)
|
31
|
-
|
32
|
-
Chef::Log.debug("
|
31
|
+
|
32
|
+
Chef::Log.debug("#{@new_resource} checking apt-cache policy")
|
33
33
|
status = popen4("apt-cache policy #{@new_resource.package_name}") do |pid, stdin, stdout, stderr|
|
34
34
|
stdout.each do |line|
|
35
35
|
case line
|
36
36
|
when /^\s{2}Installed: (.+)$/
|
37
37
|
installed_version = $1
|
38
38
|
if installed_version == '(none)'
|
39
|
-
Chef::Log.debug("
|
39
|
+
Chef::Log.debug("#{@new_resource} current version is nil")
|
40
40
|
@current_resource.version(nil)
|
41
41
|
else
|
42
|
-
Chef::Log.debug("
|
42
|
+
Chef::Log.debug("#{@new_resource} current version is #{installed_version}")
|
43
43
|
@current_resource.version(installed_version)
|
44
44
|
end
|
45
45
|
when /^\s{2}Candidate: (.+)$/
|
46
|
-
Chef::Log.debug("
|
46
|
+
Chef::Log.debug("#{@new_resource} candidate version is #{$1}")
|
47
47
|
@candidate_version = $1
|
48
48
|
end
|
49
49
|
end
|
@@ -52,14 +52,14 @@ class Chef
|
|
52
52
|
unless status.exitstatus == 0
|
53
53
|
raise Chef::Exceptions::Package, "apt-cache failed - #{status.inspect}!"
|
54
54
|
end
|
55
|
-
|
55
|
+
|
56
56
|
if @candidate_version == "(none)"
|
57
57
|
raise Chef::Exceptions::Package, "apt does not have a version of package #{@new_resource.package_name}"
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
60
|
@current_resource
|
61
61
|
end
|
62
|
-
|
62
|
+
|
63
63
|
def install_package(name, version)
|
64
64
|
run_command_with_systems_locale(
|
65
65
|
:command => "apt-get -q -y#{expand_options(@new_resource.options)} install #{name}=#{version}",
|
@@ -68,11 +68,11 @@ class Chef
|
|
68
68
|
}
|
69
69
|
)
|
70
70
|
end
|
71
|
-
|
71
|
+
|
72
72
|
def upgrade_package(name, version)
|
73
73
|
install_package(name, version)
|
74
74
|
end
|
75
|
-
|
75
|
+
|
76
76
|
def remove_package(name, version)
|
77
77
|
run_command_with_systems_locale(
|
78
78
|
:command => "apt-get -q -y#{expand_options(@new_resource.options)} remove #{@new_resource.package_name}",
|
@@ -81,7 +81,7 @@ class Chef
|
|
81
81
|
}
|
82
82
|
)
|
83
83
|
end
|
84
|
-
|
84
|
+
|
85
85
|
def purge_package(name, version)
|
86
86
|
run_command_with_systems_locale(
|
87
87
|
:command => "apt-get -q -y#{expand_options(@new_resource.options)} purge #{@new_resource.package_name}",
|
@@ -90,11 +90,11 @@ class Chef
|
|
90
90
|
}
|
91
91
|
)
|
92
92
|
end
|
93
|
-
|
93
|
+
|
94
94
|
def preseed_package(name, version)
|
95
95
|
preseed_file = get_preseed_file(name, version)
|
96
96
|
if preseed_file
|
97
|
-
Chef::Log.info("
|
97
|
+
Chef::Log.info("#{@new_resource} pre-seeding package installation instructions")
|
98
98
|
run_command_with_systems_locale(
|
99
99
|
:command => "debconf-set-selections #{preseed_file}",
|
100
100
|
:environment => {
|
@@ -103,7 +103,7 @@ class Chef
|
|
103
103
|
)
|
104
104
|
end
|
105
105
|
end
|
106
|
-
|
106
|
+
|
107
107
|
end
|
108
108
|
end
|
109
109
|
end
|
@@ -45,7 +45,7 @@ class Chef
|
|
45
45
|
end
|
46
46
|
|
47
47
|
# Get information from the package if supplied
|
48
|
-
Chef::Log.debug("
|
48
|
+
Chef::Log.debug("#{@new_resource} checking dpkg status")
|
49
49
|
status = popen4("dpkg-deb -W #{@new_resource.source}") do |pid, stdin, stdout, stderr|
|
50
50
|
stdout.each_line do |line|
|
51
51
|
if pkginfo = DPKG_INFO.match(line)
|
@@ -58,7 +58,7 @@ class Chef
|
|
58
58
|
|
59
59
|
# Check to see if it is installed
|
60
60
|
package_installed = nil
|
61
|
-
Chef::Log.debug("
|
61
|
+
Chef::Log.debug("#{@new_resource} checking install state")
|
62
62
|
status = popen4("dpkg -s #{@current_resource.package_name}") do |pid, stdin, stdout, stderr|
|
63
63
|
stdout.each_line do |line|
|
64
64
|
case line
|
@@ -66,7 +66,7 @@ class Chef
|
|
66
66
|
package_installed = true
|
67
67
|
when DPKG_VERSION
|
68
68
|
if package_installed
|
69
|
-
Chef::Log.debug("
|
69
|
+
Chef::Log.debug("#{@new_resource} current version is #{$1}")
|
70
70
|
@current_resource.version($1)
|
71
71
|
end
|
72
72
|
end
|
@@ -95,10 +95,10 @@ class Chef
|
|
95
95
|
end
|
96
96
|
|
97
97
|
if package_version == @new_resource.version
|
98
|
-
Chef::Log.debug("#{@new_resource
|
98
|
+
Chef::Log.debug("#{@new_resource} at version #{@new_resource.version}")
|
99
99
|
@current_resource.version(@new_resource.version)
|
100
100
|
else
|
101
|
-
Chef::Log.debug("#{@new_resource
|
101
|
+
Chef::Log.debug("#{@new_resource} at version #{package_version}")
|
102
102
|
@current_resource.version(package_version)
|
103
103
|
end
|
104
104
|
|
@@ -69,10 +69,10 @@ class Chef
|
|
69
69
|
@current_resource.package_name(@new_resource.package_name)
|
70
70
|
|
71
71
|
@current_resource.version(current_installed_version)
|
72
|
-
Chef::Log.debug("
|
72
|
+
Chef::Log.debug("#{@new_resource} current version is #{@current_resource.version}") if @current_resource.version
|
73
73
|
|
74
74
|
@candidate_version = ports_candidate_version
|
75
|
-
Chef::Log.debug("
|
75
|
+
Chef::Log.debug("#{@new_resource} ports candidate version is #{@candidate_version}") if @candidate_version
|
76
76
|
|
77
77
|
@current_resource
|
78
78
|
end
|
@@ -97,13 +97,12 @@ class Chef
|
|
97
97
|
shell_out!("make -DBATCH install", :cwd => port_path, :env => nil).status
|
98
98
|
when /^http/, /^ftp/
|
99
99
|
shell_out!("pkg_add -r #{package_name}", :env => { "PACKAGESITE" => @new_resource.source, 'LC_ALL' => nil }).status
|
100
|
-
Chef::Log.
|
100
|
+
Chef::Log.debug("#{@new_resource} installed from: #{@new_resource.source}")
|
101
101
|
when /^\//
|
102
102
|
shell_out!("pkg_add #{@new_resource.name}", :env => { "PKG_PATH" => @new_resource.source , 'LC_ALL'=>nil}).status
|
103
|
-
Chef::Log.
|
103
|
+
Chef::Log.debug("#{@new_resource} installed from: #{@new_resource.source}")
|
104
104
|
else
|
105
105
|
shell_out!("pkg_add -r #{latest_link_name}", :env => nil).status
|
106
|
-
Chef::Log.info("Installed package #{package_name}")
|
107
106
|
end
|
108
107
|
end
|
109
108
|
end
|
@@ -7,7 +7,7 @@ class Chef
|
|
7
7
|
@current_resource.package_name(@new_resource.package_name)
|
8
8
|
|
9
9
|
@current_resource.version(current_installed_version)
|
10
|
-
Chef::Log.debug("
|
10
|
+
Chef::Log.debug("#{@new_resource} current version is #{@current_resource.version}") if @current_resource.version
|
11
11
|
|
12
12
|
@candidate_version = macports_candidate_version
|
13
13
|
|
@@ -15,7 +15,7 @@ class Chef
|
|
15
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
16
|
end
|
17
17
|
|
18
|
-
Chef::Log.debug("
|
18
|
+
Chef::Log.debug("#{@new_resource} candidate version is #{@candidate_version}") if @candidate_version
|
19
19
|
|
20
20
|
@current_resource
|
21
21
|
end
|
@@ -31,12 +31,12 @@ class Chef
|
|
31
31
|
|
32
32
|
@current_resource.version(nil)
|
33
33
|
|
34
|
-
Chef::Log.debug("
|
34
|
+
Chef::Log.debug("#{@new_resource} checking pacman for #{@new_resource.package_name}")
|
35
35
|
status = popen4("pacman -Qi #{@new_resource.package_name}") do |pid, stdin, stdout, stderr|
|
36
36
|
stdout.each do |line|
|
37
37
|
case line
|
38
38
|
when /^Version(\s?)*: (.+)$/
|
39
|
-
Chef::Log.debug("
|
39
|
+
Chef::Log.debug("#{@new_resource} current version is #{$2}")
|
40
40
|
@current_resource.version($2)
|
41
41
|
end
|
42
42
|
end
|
@@ -46,7 +46,7 @@ class Chef
|
|
46
46
|
raise Chef::Exceptions::Package, "Multiple packages found for #{@new_resource.package_name}: #{atoms.join(" ")}. Specify a category."
|
47
47
|
elsif versions.size == 1
|
48
48
|
@current_resource.version(versions.first.last)
|
49
|
-
Chef::Log.debug("
|
49
|
+
Chef::Log.debug("#{@new_resource} current version #{$1}")
|
50
50
|
end
|
51
51
|
|
52
52
|
@current_resource
|
@@ -34,7 +34,7 @@ class Chef
|
|
34
34
|
raise Chef::Exceptions::Package, "Package #{@new_resource.name} not found: #{@new_resource.source}"
|
35
35
|
end
|
36
36
|
|
37
|
-
Chef::Log.debug("
|
37
|
+
Chef::Log.debug("#{@new_resource} checking rpm status")
|
38
38
|
status = popen4("rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' #{@new_resource.source}") do |pid, stdin, stdout, stderr|
|
39
39
|
stdout.each do |line|
|
40
40
|
case line
|
@@ -50,12 +50,12 @@ class Chef
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
-
Chef::Log.debug("
|
53
|
+
Chef::Log.debug("#{@new_resource} checking install state")
|
54
54
|
status = popen4("rpm -q --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' #{@current_resource.package_name}") do |pid, stdin, stdout, stderr|
|
55
55
|
stdout.each do |line|
|
56
56
|
case line
|
57
57
|
when /([\w\d_.-]+)\s([\w\d_.-]+)/
|
58
|
-
Chef::Log.debug("
|
58
|
+
Chef::Log.debug("#{@new_resource} current version is #{$2}")
|
59
59
|
@current_resource.version($2)
|
60
60
|
end
|
61
61
|
end
|
@@ -100,11 +100,11 @@ class Chef
|
|
100
100
|
def candidate_version_from_file(gem_dependency, source)
|
101
101
|
spec = Gem::Format.from_file_by_path(source).spec
|
102
102
|
if spec.satisfies_requirement?(gem_dependency)
|
103
|
-
logger.debug {"found candidate gem version #{spec.version} from local gem package #{source}"}
|
103
|
+
logger.debug {"#{@new_resource} found candidate gem version #{spec.version} from local gem package #{source}"}
|
104
104
|
spec.version
|
105
105
|
else
|
106
106
|
# This is probably going to end badly...
|
107
|
-
logger.warn { "
|
107
|
+
logger.warn { "#{@new_resource} gem package #{source} does not satisfy the requirements #{gem_dependency.to_s}" }
|
108
108
|
nil
|
109
109
|
end
|
110
110
|
end
|
@@ -133,11 +133,11 @@ class Chef
|
|
133
133
|
spec = spec_with_source && spec_with_source[0]
|
134
134
|
version = spec && spec_with_source[0].version
|
135
135
|
if version
|
136
|
-
logger.debug { "
|
136
|
+
logger.debug { "#{@new_resource} found gem #{spec.name} version #{version} for platform #{spec.platform} from #{spec_with_source[1]}" }
|
137
137
|
version
|
138
138
|
else
|
139
139
|
source_list = sources.compact.empty? ? "[#{Gem.sources.join(', ')}]" : "[#{sources.join(', ')}]"
|
140
|
-
logger.warn { "
|
140
|
+
logger.warn { "#{@new_resource} failed to find gem #{gem_dependency} from #{source_list}" }
|
141
141
|
nil
|
142
142
|
end
|
143
143
|
end
|
@@ -328,16 +328,16 @@ class Chef
|
|
328
328
|
# is the current version
|
329
329
|
if !matching_installed_versions.empty?
|
330
330
|
gemspec = matching_installed_versions.last
|
331
|
-
logger.debug { "
|
331
|
+
logger.debug { "#{@new_resource} found installed gem #{gemspec.name} version #{gemspec.version} matching #{gem_dependency}"}
|
332
332
|
gemspec
|
333
333
|
# If no version matching the requirements exists, the latest installed
|
334
334
|
# version is the current version.
|
335
335
|
elsif !all_installed_versions.empty?
|
336
336
|
gemspec = all_installed_versions.last
|
337
|
-
logger.debug { "
|
337
|
+
logger.debug { "#{@new_resource} newest installed version of gem #{gemspec.name} is #{gemspec.version}" }
|
338
338
|
gemspec
|
339
339
|
else
|
340
|
-
logger.debug { "
|
340
|
+
logger.debug { "#{@new_resource} no installed version found for #{gem_dependency.to_s}"}
|
341
341
|
nil
|
342
342
|
end
|
343
343
|
end
|
@@ -39,7 +39,7 @@ class Chef
|
|
39
39
|
raise Chef::Exceptions::Package, "Package #{@new_resource.name} not found: #{@new_resource.source}"
|
40
40
|
end
|
41
41
|
|
42
|
-
Chef::Log.debug("
|
42
|
+
Chef::Log.debug("#{@new_resource} checking pkg status")
|
43
43
|
status = popen4("pkginfo -l -d #{@new_resource.source} #{@new_resource.package_name}") do |pid, stdin, stdout, stderr|
|
44
44
|
stdout.each do |line|
|
45
45
|
case line
|
@@ -52,12 +52,12 @@ class Chef
|
|
52
52
|
raise Chef::Exceptions::Package, "Source for package #{@new_resource.name} required for action install"
|
53
53
|
end
|
54
54
|
|
55
|
-
Chef::Log.debug("
|
55
|
+
Chef::Log.debug("#{@new_resource} checking install state")
|
56
56
|
status = popen4("pkginfo -l #{@current_resource.package_name}") do |pid, stdin, stdout, stderr|
|
57
57
|
stdout.each do |line|
|
58
58
|
case line
|
59
59
|
when /VERSION:\s+(.+)/
|
60
|
-
Chef::Log.debug("
|
60
|
+
Chef::Log.debug("#{@new_resource} version #{$1} is already installed")
|
61
61
|
@current_resource.version($1)
|
62
62
|
end
|
63
63
|
end
|
@@ -82,7 +82,7 @@ class Chef
|
|
82
82
|
when /VERSION:\s+(.+)/
|
83
83
|
@candidate_version = $1
|
84
84
|
@new_resource.version($1)
|
85
|
-
Chef::Log.debug("
|
85
|
+
Chef::Log.debug("#{@new_resource} setting install candidate version to #{@candidate_version}")
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
@@ -93,17 +93,17 @@ class Chef
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def install_package(name, version)
|
96
|
-
Chef::Log.debug("
|
96
|
+
Chef::Log.debug("#{@new_resource} package install options: #{@new_resource.options}")
|
97
97
|
if @new_resource.options.nil?
|
98
98
|
run_command_with_systems_locale(
|
99
99
|
:command => "pkgadd -n -d #{@new_resource.source} all"
|
100
100
|
)
|
101
|
-
Chef::Log.debug("
|
101
|
+
Chef::Log.debug("#{@new_resource} installed version #{@new_resource.version} from: #{@new_resource.source}")
|
102
102
|
else
|
103
103
|
run_command_with_systems_locale(
|
104
104
|
:command => "pkgadd -n#{expand_options(@new_resource.options)} -d #{@new_resource.source} all"
|
105
105
|
)
|
106
|
-
Chef::Log.debug("
|
106
|
+
Chef::Log.debug("#{@new_resource} installed version #{@new_resource.version} from: #{@new_resource.source}")
|
107
107
|
end
|
108
108
|
end
|
109
109
|
|
@@ -112,12 +112,12 @@ class Chef
|
|
112
112
|
run_command_with_systems_locale(
|
113
113
|
:command => "pkgrm -n #{name}"
|
114
114
|
)
|
115
|
-
Chef::Log.debug("
|
115
|
+
Chef::Log.debug("#{@new_resource} removed version #{@new_resource.version}")
|
116
116
|
else
|
117
117
|
run_command_with_systems_locale(
|
118
118
|
:command => "pkgrm -n#{expand_options(@new_resource.options)} #{name}"
|
119
119
|
)
|
120
|
-
Chef::Log.debug("
|
120
|
+
Chef::Log.debug("#{@new_resource} removed version #{@new_resource.version}")
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|