From b0288e3bb41f5f0aead9d38a98112298eaee5e1c Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Mon, 5 Dec 2016 11:29:45 -0800 Subject: fix yum regexp similarly to rpm regexp in #3985 this is a "nope, aint got time to test this one" PR. this affects a code path that is only for localinstalls and doesn't have any existing tests. i've already exceeded my 5 minute timebox for fixing the problem. i'm more likely to rewrite the yum provider from scratch and shitcan the unit tests in their entirety than to reuse any work that i do here so any time spent on carefully testing this is likely to end up wasted. Signed-off-by: Lamont Granquist --- lib/chef/provider/package/yum.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chef/provider/package/yum.rb b/lib/chef/provider/package/yum.rb index 022fdcae09..8b7d7a5083 100644 --- a/lib/chef/provider/package/yum.rb +++ b/lib/chef/provider/package/yum.rb @@ -197,7 +197,7 @@ class Chef Chef::Log.debug("#{@new_resource} checking rpm status") shell_out_with_timeout!("rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' #{@new_resource.source}", :timeout => Chef::Config[:yum_timeout]).stdout.each_line do |line| case line - when /([\w\d_.-]+)\s([\w\d_.-]+)/ + when /^(\S+)\s(\S+)$/ @current_resource.package_name($1) @new_resource.version($2) end -- cgit v1.2.1