{"action":"created","comment":{"url":"https://api.github.com/repos/SUSE/machinery/pulls/comments/37430004","id":37430004,"diff_hunk":"@@ -116,33 +157,40 @@ def clean_up_tmp\n   end\n \n   def set_version\n-    Dir.chdir(Machinery::ROOT) do\n-      Cheetah.run \"sed\", \"-i\", \"s/VERSION.*=.*/VERSION = \\\"#{@release_version}\\\"/\", \"lib/version.rb\"\n+    if File.exist?(\"lib/version.rb\")\n+      Cheetah.run \"sed\", \"-i\", \"s/VERSION.*=.*/VERSION = \\\"#{@options[:version]}\\\"/\",\n+        \"lib/version.rb\"\n+    else\n+      File.write(\"VERSION\", @options[:version])\n     end\n   end\n \n   def generate_specfile\n-    Dir.chdir(Machinery::ROOT) do\n-      erb = ERB.new(File.read(\"machinery.spec.erb\"), nil, \"-\")\n-      env = SpecTemplate.new(@release_version, @gemspec)\n+    erb = ERB.new(File.read(Dir.glob(\"*.spec.erb\").first), nil, \"-\")\n+    if File.exist?(\"#{@options[:package_name]}.gemspec\")\n+      env = SpecTemplate.new(@options[:version], @gemspec)\n+    else\n+      arch = @options[:package_name][/^machinery-helper-(\\w*)$/, 1]\n+      env = OpenStruct.new( { version: @options[:version], arch: arch } )\n+    end\n \n-      File.open(\"package/machinery.spec\", \"w+\") do |spec_file|\n-        spec_file.puts erb.result(env.instance_eval { binding })\n-      end\n+    File.open(\"package/#{@options[:package_name]}.spec\", \"w+\") do |spec_file|\n+      spec_file.puts erb.result(env.instance_eval { binding })\n     end\n   end\n \n   def copy_rpmlintrc\n-    Dir.chdir(Machinery::ROOT) do\n-      FileUtils.cp \"machinery-rpmlintrc\", \"package/machinery-rpmlintrc\"\n+    rpmlint = Dir.glob(\"*-rpmlintrc\").first\n+    if rpmlint\n+      FileUtils.cp rpmlint, \"package/#{@options[:package_name]}-rpmlintrc\"\n     end\n   end\n \n   def generate_changelog\n-    changes = { @release_version => create_rpm_header(@release_version, @release_time, @mail) }\n-    news    = { @release_version => \"\" }\n-    CHANGELOG_FILES.each do |file|\n-      version = @release_version\n+    changes = { @options[:version] => create_rpm_header(@options[:version], @release_time, @mail) }\n+    news    = { @options[:version] => \"\" }","path":"tools/release.rb","position":185,"original_position":185,"commit_id":"aa9d9ef3be1e08ef1abccaa902b269539c81b175","original_commit_id":"aa9d9ef3be1e08ef1abccaa902b269539c81b175","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Unnecessary spacing detected.","created_at":"2015-08-19T15:41:51Z","updated_at":"2015-08-19T15:41:51Z","html_url":"https://github.com/SUSE/machinery/pull/1228#discussion_r37430004","pull_request_url":"https://api.github.com/repos/SUSE/machinery/pulls/1228","_links":{"self":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/comments/37430004"},"html":{"href":"https://github.com/SUSE/machinery/pull/1228#discussion_r37430004"},"pull_request":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1228"}}},"pull_request":{"url":"https://api.github.com/repos/SUSE/machinery/pulls/1228","id":42829855,"html_url":"https://github.com/SUSE/machinery/pull/1228","diff_url":"https://github.com/SUSE/machinery/pull/1228.diff","patch_url":"https://github.com/SUSE/machinery/pull/1228.patch","issue_url":"https://api.github.com/repos/SUSE/machinery/issues/1228","number":1228,"state":"open","locked":false,"title":"Add machinery helper to release script3","user":{"login":"thardeck","id":2063848,"avatar_url":"https://avatars.githubusercontent.com/u/2063848?v=3","gravatar_id":"","url":"https://api.github.com/users/thardeck","html_url":"https://github.com/thardeck","followers_url":"https://api.github.com/users/thardeck/followers","following_url":"https://api.github.com/users/thardeck/following{/other_user}","gists_url":"https://api.github.com/users/thardeck/gists{/gist_id}","starred_url":"https://api.github.com/users/thardeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thardeck/subscriptions","organizations_url":"https://api.github.com/users/thardeck/orgs","repos_url":"https://api.github.com/users/thardeck/repos","events_url":"https://api.github.com/users/thardeck/events{/privacy}","received_events_url":"https://api.github.com/users/thardeck/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-19T15:41:43Z","updated_at":"2015-08-19T15:41:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77ade9c0dc7b4aff1ee2eab4e270abb4f37fd45e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SUSE/machinery/pulls/1228/commits","review_comments_url":"https://api.github.com/repos/SUSE/machinery/pulls/1228/comments","review_comment_url":"https://api.github.com/repos/SUSE/machinery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SUSE/machinery/issues/1228/comments","statuses_url":"https://api.github.com/repos/SUSE/machinery/statuses/aa9d9ef3be1e08ef1abccaa902b269539c81b175","head":{"label":"SUSE:add_machinery_helper_to_release_script3","ref":"add_machinery_helper_to_release_script3","sha":"aa9d9ef3be1e08ef1abccaa902b269539c81b175","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":21424418,"name":"machinery","full_name":"SUSE/machinery","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/machinery","description":"A systems management toolkit for Linux","fork":false,"url":"https://api.github.com/repos/SUSE/machinery","forks_url":"https://api.github.com/repos/SUSE/machinery/forks","keys_url":"https://api.github.com/repos/SUSE/machinery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/machinery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/machinery/teams","hooks_url":"https://api.github.com/repos/SUSE/machinery/hooks","issue_events_url":"https://api.github.com/repos/SUSE/machinery/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/machinery/events","assignees_url":"https://api.github.com/repos/SUSE/machinery/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/machinery/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/machinery/tags","blobs_url":"https://api.github.com/repos/SUSE/machinery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/machinery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/machinery/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/machinery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/machinery/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/machinery/languages","stargazers_url":"https://api.github.com/repos/SUSE/machinery/stargazers","contributors_url":"https://api.github.com/repos/SUSE/machinery/contributors","subscribers_url":"https://api.github.com/repos/SUSE/machinery/subscribers","subscription_url":"https://api.github.com/repos/SUSE/machinery/subscription","commits_url":"https://api.github.com/repos/SUSE/machinery/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/machinery/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/machinery/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/machinery/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/machinery/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/machinery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/machinery/merges","archive_url":"https://api.github.com/repos/SUSE/machinery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/machinery/downloads","issues_url":"https://api.github.com/repos/SUSE/machinery/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/machinery/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/machinery/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/machinery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/machinery/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/machinery/releases{/id}","created_at":"2014-07-02T13:07:04Z","updated_at":"2015-06-12T13:06:40Z","pushed_at":"2015-08-19T15:41:44Z","git_url":"git://github.com/SUSE/machinery.git","ssh_url":"git@github.com:SUSE/machinery.git","clone_url":"https://github.com/SUSE/machinery.git","svn_url":"https://github.com/SUSE/machinery","homepage":"machinery-project.org","size":66851,"stargazers_count":53,"watchers_count":53,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8,"mirror_url":null,"open_issues_count":23,"forks":8,"open_issues":23,"watchers":53,"default_branch":"master"}},"base":{"label":"SUSE:master","ref":"master","sha":"5be0acac68e0413a0f7ef80ad73d5625187df534","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":21424418,"name":"machinery","full_name":"SUSE/machinery","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/machinery","description":"A systems management toolkit for Linux","fork":false,"url":"https://api.github.com/repos/SUSE/machinery","forks_url":"https://api.github.com/repos/SUSE/machinery/forks","keys_url":"https://api.github.com/repos/SUSE/machinery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/machinery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/machinery/teams","hooks_url":"https://api.github.com/repos/SUSE/machinery/hooks","issue_events_url":"https://api.github.com/repos/SUSE/machinery/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/machinery/events","assignees_url":"https://api.github.com/repos/SUSE/machinery/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/machinery/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/machinery/tags","blobs_url":"https://api.github.com/repos/SUSE/machinery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/machinery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/machinery/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/machinery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/machinery/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/machinery/languages","stargazers_url":"https://api.github.com/repos/SUSE/machinery/stargazers","contributors_url":"https://api.github.com/repos/SUSE/machinery/contributors","subscribers_url":"https://api.github.com/repos/SUSE/machinery/subscribers","subscription_url":"https://api.github.com/repos/SUSE/machinery/subscription","commits_url":"https://api.github.com/repos/SUSE/machinery/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/machinery/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/machinery/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/machinery/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/machinery/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/machinery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/machinery/merges","archive_url":"https://api.github.com/repos/SUSE/machinery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/machinery/downloads","issues_url":"https://api.github.com/repos/SUSE/machinery/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/machinery/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/machinery/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/machinery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/machinery/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/machinery/releases{/id}","created_at":"2014-07-02T13:07:04Z","updated_at":"2015-06-12T13:06:40Z","pushed_at":"2015-08-19T15:41:44Z","git_url":"git://github.com/SUSE/machinery.git","ssh_url":"git@github.com:SUSE/machinery.git","clone_url":"https://github.com/SUSE/machinery.git","svn_url":"https://github.com/SUSE/machinery","homepage":"machinery-project.org","size":66851,"stargazers_count":53,"watchers_count":53,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8,"mirror_url":null,"open_issues_count":23,"forks":8,"open_issues":23,"watchers":53,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1228"},"html":{"href":"https://github.com/SUSE/machinery/pull/1228"},"issue":{"href":"https://api.github.com/repos/SUSE/machinery/issues/1228"},"comments":{"href":"https://api.github.com/repos/SUSE/machinery/issues/1228/comments"},"review_comments":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1228/comments"},"review_comment":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1228/commits"},"statuses":{"href":"https://api.github.com/repos/SUSE/machinery/statuses/aa9d9ef3be1e08ef1abccaa902b269539c81b175"}}}}