diff options
author | Ryan Cragun <me@ryan.ec> | 2014-06-25 15:35:13 -0500 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2014-08-07 09:21:08 -0700 |
commit | 0561d743ed3edb039a62b0fb7ace89388e463c85 (patch) | |
tree | 6c4abc8879b01a681c3ad2245dd46b5bba58ac78 /lib/chef/provider/package/rpm.rb | |
parent | a4462d6dedd46d7ee1b80874b42742682008c1e5 (diff) | |
download | chef-0561d743ed3edb039a62b0fb7ace89388e463c85.tar.gz |
Don't detect pacakage name as version when the RPM isn't installed
Diffstat (limited to 'lib/chef/provider/package/rpm.rb')
-rw-r--r-- | lib/chef/provider/package/rpm.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/provider/package/rpm.rb b/lib/chef/provider/package/rpm.rb index 9cfd6bb010..bbb561bd15 100644 --- a/lib/chef/provider/package/rpm.rb +++ b/lib/chef/provider/package/rpm.rb @@ -60,7 +60,7 @@ class Chef status = popen4("rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' #{@new_resource.source}") do |pid, stdin, stdout, stderr| stdout.each do |line| case line - when /([\w\d+_.-]+)\s([\w\d_.-]+)/ + when /^([\w\d+_.-]+)\s([\w\d_.-]+)$/ @current_resource.package_name($1) @new_resource.version($2) @candidate_version = $2 @@ -78,7 +78,7 @@ class Chef @rpm_status = popen4("rpm -q --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' #{@current_resource.package_name}") do |pid, stdin, stdout, stderr| stdout.each do |line| case line - when /([\w\d+_.-]+)\s([\w\d_.-]+)/ + when /^([\w\d+_.-]+)\s([\w\d_.-]+)$/ Chef::Log.debug("#{@new_resource} current version is #{$2}") @current_resource.version($2) end |