{"action":"created","comment":{"url":"https://api.github.com/repos/chef/chef/pulls/comments/26732602","id":26732602,"diff_hunk":"@@ -84,19 +90,28 @@ def installed_version\n \n         def candidate_version\n           @candidate_version ||= begin\n-            version_string  = ''\n-            version_string += \"-#{version}\" if @new_resource.version\n-            pkg_info = shell_out!(\"pkg_info -I \\\"#{@new_resource.package_name}#{version_string}\\\"\", :env => nil, :returns => [0,1])\n-            if parts = @new_resource.package_name.match(/^(.+?)--(.+)/)\n-              result = pkg_info.stdout[/^#{Regexp.escape(parts[1])}-(.+?)\\s/, 1]\n+            results = []\n+            shell_out!(\"pkg_info -I \\\"#{@new_resource.package_name}#{version_string}\\\"\", :env => nil, :returns => [0,1]).stdout.each_line do |line|\n+              results << line[/^#{Regexp.escape(@new_resource.package_name)}-(.+?)\\s/, 1]\n+            end\n+            results = results.reject(&:nil?)\n+            Chef::Log.debug(\"candidate versions of '#{@new_resource.package_name}' are '#{results}'\")\n+            case results.length\n+            when 0\n+              []\n+            when 1\n+              results[0]\n             else\n-              result = pkg_info.stdout[/^#{Regexp.escape(@new_resource.package_name)}-(.+?)\\s/, 1]\n+              raise Chef::Exceptions::Package, \"#{new_resource.name} has multiple matching candidates. You must specify a version\" if results.length > 1","path":"lib/chef/provider/package/openbsd.rb","position":64,"original_position":64,"commit_id":"1d5b950bac6ba6860e2acc292ed3f81887e542c9","original_commit_id":"1d5b950bac6ba6860e2acc292ed3f81887e542c9","user":{"login":"jdmundrawala","id":27443,"avatar_url":"https://avatars.githubusercontent.com/u/27443?v=3","gravatar_id":"","url":"https://api.github.com/users/jdmundrawala","html_url":"https://github.com/jdmundrawala","followers_url":"https://api.github.com/users/jdmundrawala/followers","following_url":"https://api.github.com/users/jdmundrawala/following{/other_user}","gists_url":"https://api.github.com/users/jdmundrawala/gists{/gist_id}","starred_url":"https://api.github.com/users/jdmundrawala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdmundrawala/subscriptions","organizations_url":"https://api.github.com/users/jdmundrawala/orgs","repos_url":"https://api.github.com/users/jdmundrawala/repos","events_url":"https://api.github.com/users/jdmundrawala/events{/privacy}","received_events_url":"https://api.github.com/users/jdmundrawala/received_events","type":"User","site_admin":false},"body":"i see the mistake i've made, i removed some of the the code that did stuff with stems:\r\nhttp://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/pkg_add.1?query=pkg_add&arch=i386\r\n\r\nso the right way to define this would be\r\n```ruby\r\npackage 'vim--no_x11'\r\n```","created_at":"2015-03-19T06:45:14Z","updated_at":"2015-03-19T06:45:14Z","html_url":"https://github.com/chef/chef/pull/3109#discussion_r26732602","pull_request_url":"https://api.github.com/repos/chef/chef/pulls/3109","_links":{"self":{"href":"https://api.github.com/repos/chef/chef/pulls/comments/26732602"},"html":{"href":"https://github.com/chef/chef/pull/3109#discussion_r26732602"},"pull_request":{"href":"https://api.github.com/repos/chef/chef/pulls/3109"}}},"pull_request":{"url":"https://api.github.com/repos/chef/chef/pulls/3109","id":31496037,"html_url":"https://github.com/chef/chef/pull/3109","diff_url":"https://github.com/chef/chef/pull/3109.diff","patch_url":"https://github.com/chef/chef/pull/3109.patch","issue_url":"https://api.github.com/repos/chef/chef/issues/3109","number":3109,"state":"open","locked":false,"title":"Fix openbsd package provider","user":{"login":"jdmundrawala","id":27443,"avatar_url":"https://avatars.githubusercontent.com/u/27443?v=3","gravatar_id":"","url":"https://api.github.com/users/jdmundrawala","html_url":"https://github.com/jdmundrawala","followers_url":"https://api.github.com/users/jdmundrawala/followers","following_url":"https://api.github.com/users/jdmundrawala/following{/other_user}","gists_url":"https://api.github.com/users/jdmundrawala/gists{/gist_id}","starred_url":"https://api.github.com/users/jdmundrawala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdmundrawala/subscriptions","organizations_url":"https://api.github.com/users/jdmundrawala/orgs","repos_url":"https://api.github.com/users/jdmundrawala/repos","events_url":"https://api.github.com/users/jdmundrawala/events{/privacy}","received_events_url":"https://api.github.com/users/jdmundrawala/received_events","type":"User","site_admin":false},"body":"This provider was broken in just the right ways when  it was merged that it sort of worked. There were references to methods that didn't exist that just happened not to get called ever.\r\n\r\nSince we just released this, and it does not work as is, I'm going to change a few things:\r\n- I've simplified the candidate_version search...I didn't quite understand what the original was wanting to do\r\n\r\n- This package provider had a weird usage for source (completely inconsistent with the rest of our package providers), and it was not happy with @jaymzh's patch https://github.com/jaymzh/chef/commit/1f380f9f180f39581f2e124061af1ee927a23e0c. I've decided to explicitly make `source` unsupported for this provider\r\n\r\n- It now correctly deals with multiple valid candidates by failing the run instead of picking one\r\n\r\ncc @chef/client-core ","created_at":"2015-03-19T05:14:15Z","updated_at":"2015-03-19T06:45:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"257eb0b18093c8d93c49a408d95be71dc5e71aba","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chef/chef/pulls/3109/commits","review_comments_url":"https://api.github.com/repos/chef/chef/pulls/3109/comments","review_comment_url":"https://api.github.com/repos/chef/chef/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chef/chef/issues/3109/comments","statuses_url":"https://api.github.com/repos/chef/chef/statuses/1d5b950bac6ba6860e2acc292ed3f81887e542c9","head":{"label":"chef:jdm/openbsd","ref":"jdm/openbsd","sha":"1d5b950bac6ba6860e2acc292ed3f81887e542c9","user":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"repo":{"id":108278,"name":"chef","full_name":"chef/chef","owner":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef/chef","description":"A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.","fork":false,"url":"https://api.github.com/repos/chef/chef","forks_url":"https://api.github.com/repos/chef/chef/forks","keys_url":"https://api.github.com/repos/chef/chef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/chef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/chef/teams","hooks_url":"https://api.github.com/repos/chef/chef/hooks","issue_events_url":"https://api.github.com/repos/chef/chef/issues/events{/number}","events_url":"https://api.github.com/repos/chef/chef/events","assignees_url":"https://api.github.com/repos/chef/chef/assignees{/user}","branches_url":"https://api.github.com/repos/chef/chef/branches{/branch}","tags_url":"https://api.github.com/repos/chef/chef/tags","blobs_url":"https://api.github.com/repos/chef/chef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/chef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/chef/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/chef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/chef/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/chef/languages","stargazers_url":"https://api.github.com/repos/chef/chef/stargazers","contributors_url":"https://api.github.com/repos/chef/chef/contributors","subscribers_url":"https://api.github.com/repos/chef/chef/subscribers","subscription_url":"https://api.github.com/repos/chef/chef/subscription","commits_url":"https://api.github.com/repos/chef/chef/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/chef/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/chef/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/chef/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/chef/contents/{+path}","compare_url":"https://api.github.com/repos/chef/chef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/chef/merges","archive_url":"https://api.github.com/repos/chef/chef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/chef/downloads","issues_url":"https://api.github.com/repos/chef/chef/issues{/number}","pulls_url":"https://api.github.com/repos/chef/chef/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/chef/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/chef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/chef/labels{/name}","releases_url":"https://api.github.com/repos/chef/chef/releases{/id}","created_at":"2009-01-15T20:40:48Z","updated_at":"2015-03-19T01:18:16Z","pushed_at":"2015-03-19T05:07:08Z","git_url":"git://github.com/chef/chef.git","ssh_url":"git@github.com:chef/chef.git","clone_url":"https://github.com/chef/chef.git","svn_url":"https://github.com/chef/chef","homepage":"http://www.chef.io/chef/","size":163333,"stargazers_count":3435,"watchers_count":3435,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1387,"mirror_url":null,"open_issues_count":392,"forks":1387,"open_issues":392,"watchers":3435,"default_branch":"master"}},"base":{"label":"chef:master","ref":"master","sha":"56c6e6474416946d65dfa306edd89f076d5b3b7d","user":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"repo":{"id":108278,"name":"chef","full_name":"chef/chef","owner":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef/chef","description":"A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.","fork":false,"url":"https://api.github.com/repos/chef/chef","forks_url":"https://api.github.com/repos/chef/chef/forks","keys_url":"https://api.github.com/repos/chef/chef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/chef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/chef/teams","hooks_url":"https://api.github.com/repos/chef/chef/hooks","issue_events_url":"https://api.github.com/repos/chef/chef/issues/events{/number}","events_url":"https://api.github.com/repos/chef/chef/events","assignees_url":"https://api.github.com/repos/chef/chef/assignees{/user}","branches_url":"https://api.github.com/repos/chef/chef/branches{/branch}","tags_url":"https://api.github.com/repos/chef/chef/tags","blobs_url":"https://api.github.com/repos/chef/chef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/chef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/chef/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/chef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/chef/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/chef/languages","stargazers_url":"https://api.github.com/repos/chef/chef/stargazers","contributors_url":"https://api.github.com/repos/chef/chef/contributors","subscribers_url":"https://api.github.com/repos/chef/chef/subscribers","subscription_url":"https://api.github.com/repos/chef/chef/subscription","commits_url":"https://api.github.com/repos/chef/chef/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/chef/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/chef/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/chef/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/chef/contents/{+path}","compare_url":"https://api.github.com/repos/chef/chef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/chef/merges","archive_url":"https://api.github.com/repos/chef/chef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/chef/downloads","issues_url":"https://api.github.com/repos/chef/chef/issues{/number}","pulls_url":"https://api.github.com/repos/chef/chef/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/chef/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/chef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/chef/labels{/name}","releases_url":"https://api.github.com/repos/chef/chef/releases{/id}","created_at":"2009-01-15T20:40:48Z","updated_at":"2015-03-19T01:18:16Z","pushed_at":"2015-03-19T05:07:08Z","git_url":"git://github.com/chef/chef.git","ssh_url":"git@github.com:chef/chef.git","clone_url":"https://github.com/chef/chef.git","svn_url":"https://github.com/chef/chef","homepage":"http://www.chef.io/chef/","size":163333,"stargazers_count":3435,"watchers_count":3435,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1387,"mirror_url":null,"open_issues_count":392,"forks":1387,"open_issues":392,"watchers":3435,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chef/chef/pulls/3109"},"html":{"href":"https://github.com/chef/chef/pull/3109"},"issue":{"href":"https://api.github.com/repos/chef/chef/issues/3109"},"comments":{"href":"https://api.github.com/repos/chef/chef/issues/3109/comments"},"review_comments":{"href":"https://api.github.com/repos/chef/chef/pulls/3109/comments"},"review_comment":{"href":"https://api.github.com/repos/chef/chef/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chef/chef/pulls/3109/commits"},"statuses":{"href":"https://api.github.com/repos/chef/chef/statuses/1d5b950bac6ba6860e2acc292ed3f81887e542c9"}}}}