{"action":"created","comment":{"url":"https://api.github.com/repos/coreos/mantle/pulls/comments/39704027","id":39704027,"diff_hunk":"@@ -151,3 +153,40 @@ func DownloadSDK(version string) error {\n \ttarURL := TarballURL(version)\n \treturn DownloadSignedFile(tarFile, tarURL)\n }\n+\n+// UpdateSignedFile will download will replace the local file if the\n+// published signature doesn't match the local copy\n+func UpdateSignedFile(file, url string) error {\n+\tsigFile := file + \".sig\"\n+\tsigURL := url + \".sig\"\n+\n+\t// get local sig\n+\tlocalSig := []byte{}\n+\tif _, err := os.Stat(sigFile); err == nil {\n+\t\tlocalSig, err = ioutil.ReadFile(sigFile)\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\t}\n+\n+\t// overwrite local sig with latest","path":"sdk/download.go","position":31,"original_position":31,"commit_id":"7adeca804569200c82069ecd70fce0ba51028bed","original_commit_id":"7adeca804569200c82069ecd70fce0ba51028bed","user":{"login":"marineam","id":153640,"avatar_url":"https://avatars.githubusercontent.com/u/153640?v=3","gravatar_id":"","url":"https://api.github.com/users/marineam","html_url":"https://github.com/marineam","followers_url":"https://api.github.com/users/marineam/followers","following_url":"https://api.github.com/users/marineam/following{/other_user}","gists_url":"https://api.github.com/users/marineam/gists{/gist_id}","starred_url":"https://api.github.com/users/marineam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marineam/subscriptions","organizations_url":"https://api.github.com/users/marineam/orgs","repos_url":"https://api.github.com/users/marineam/repos","events_url":"https://api.github.com/users/marineam/events{/privacy}","received_events_url":"https://api.github.com/users/marineam/received_events","type":"User","site_admin":false},"body":"I'd be inclined to add a `UpdateFile` which downloads to memory or a temp file and only replaces the original if it changed. Not a big deal but it feels cleaner to not be needlessly changing the inode/mtime.","created_at":"2015-09-17T01:25:03Z","updated_at":"2015-09-17T01:25:03Z","html_url":"https://github.com/coreos/mantle/pull/109#discussion_r39704027","pull_request_url":"https://api.github.com/repos/coreos/mantle/pulls/109","_links":{"self":{"href":"https://api.github.com/repos/coreos/mantle/pulls/comments/39704027"},"html":{"href":"https://github.com/coreos/mantle/pull/109#discussion_r39704027"},"pull_request":{"href":"https://api.github.com/repos/coreos/mantle/pulls/109"}}},"pull_request":{"url":"https://api.github.com/repos/coreos/mantle/pulls/109","id":45242074,"html_url":"https://github.com/coreos/mantle/pull/109","diff_url":"https://github.com/coreos/mantle/pull/109.diff","patch_url":"https://github.com/coreos/mantle/pull/109.patch","issue_url":"https://api.github.com/repos/coreos/mantle/issues/109","number":109,"state":"open","locked":false,"title":"Downloadimage","user":{"login":"pbx0","id":10945781,"avatar_url":"https://avatars.githubusercontent.com/u/10945781?v=3","gravatar_id":"","url":"https://api.github.com/users/pbx0","html_url":"https://github.com/pbx0","followers_url":"https://api.github.com/users/pbx0/followers","following_url":"https://api.github.com/users/pbx0/following{/other_user}","gists_url":"https://api.github.com/users/pbx0/gists{/gist_id}","starred_url":"https://api.github.com/users/pbx0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbx0/subscriptions","organizations_url":"https://api.github.com/users/pbx0/orgs","repos_url":"https://api.github.com/users/pbx0/repos","events_url":"https://api.github.com/users/pbx0/events{/privacy}","received_events_url":"https://api.github.com/users/pbx0/received_events","type":"User","site_admin":false},"body":"Adds a download image command to cork. This is intended to replace curling the image down each time kola runs. Now the image is verified and only updated if its different form the local copy.","created_at":"2015-09-17T01:06:20Z","updated_at":"2015-09-17T01:25:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b3d33e77a6ca2c1e46c850805f5c55190fe6be0c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/coreos/mantle/pulls/109/commits","review_comments_url":"https://api.github.com/repos/coreos/mantle/pulls/109/comments","review_comment_url":"https://api.github.com/repos/coreos/mantle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coreos/mantle/issues/109/comments","statuses_url":"https://api.github.com/repos/coreos/mantle/statuses/7adeca804569200c82069ecd70fce0ba51028bed","head":{"label":"pbx0:downloadimage","ref":"downloadimage","sha":"7adeca804569200c82069ecd70fce0ba51028bed","user":{"login":"pbx0","id":10945781,"avatar_url":"https://avatars.githubusercontent.com/u/10945781?v=3","gravatar_id":"","url":"https://api.github.com/users/pbx0","html_url":"https://github.com/pbx0","followers_url":"https://api.github.com/users/pbx0/followers","following_url":"https://api.github.com/users/pbx0/following{/other_user}","gists_url":"https://api.github.com/users/pbx0/gists{/gist_id}","starred_url":"https://api.github.com/users/pbx0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbx0/subscriptions","organizations_url":"https://api.github.com/users/pbx0/orgs","repos_url":"https://api.github.com/users/pbx0/repos","events_url":"https://api.github.com/users/pbx0/events{/privacy}","received_events_url":"https://api.github.com/users/pbx0/received_events","type":"User","site_admin":false},"repo":{"id":31443603,"name":"mantle","full_name":"pbx0/mantle","owner":{"login":"pbx0","id":10945781,"avatar_url":"https://avatars.githubusercontent.com/u/10945781?v=3","gravatar_id":"","url":"https://api.github.com/users/pbx0","html_url":"https://github.com/pbx0","followers_url":"https://api.github.com/users/pbx0/followers","following_url":"https://api.github.com/users/pbx0/following{/other_user}","gists_url":"https://api.github.com/users/pbx0/gists{/gist_id}","starred_url":"https://api.github.com/users/pbx0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbx0/subscriptions","organizations_url":"https://api.github.com/users/pbx0/orgs","repos_url":"https://api.github.com/users/pbx0/repos","events_url":"https://api.github.com/users/pbx0/events{/privacy}","received_events_url":"https://api.github.com/users/pbx0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pbx0/mantle","description":"Mantle: Gluing CoreOS together","fork":true,"url":"https://api.github.com/repos/pbx0/mantle","forks_url":"https://api.github.com/repos/pbx0/mantle/forks","keys_url":"https://api.github.com/repos/pbx0/mantle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pbx0/mantle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pbx0/mantle/teams","hooks_url":"https://api.github.com/repos/pbx0/mantle/hooks","issue_events_url":"https://api.github.com/repos/pbx0/mantle/issues/events{/number}","events_url":"https://api.github.com/repos/pbx0/mantle/events","assignees_url":"https://api.github.com/repos/pbx0/mantle/assignees{/user}","branches_url":"https://api.github.com/repos/pbx0/mantle/branches{/branch}","tags_url":"https://api.github.com/repos/pbx0/mantle/tags","blobs_url":"https://api.github.com/repos/pbx0/mantle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pbx0/mantle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pbx0/mantle/git/refs{/sha}","trees_url":"https://api.github.com/repos/pbx0/mantle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pbx0/mantle/statuses/{sha}","languages_url":"https://api.github.com/repos/pbx0/mantle/languages","stargazers_url":"https://api.github.com/repos/pbx0/mantle/stargazers","contributors_url":"https://api.github.com/repos/pbx0/mantle/contributors","subscribers_url":"https://api.github.com/repos/pbx0/mantle/subscribers","subscription_url":"https://api.github.com/repos/pbx0/mantle/subscription","commits_url":"https://api.github.com/repos/pbx0/mantle/commits{/sha}","git_commits_url":"https://api.github.com/repos/pbx0/mantle/git/commits{/sha}","comments_url":"https://api.github.com/repos/pbx0/mantle/comments{/number}","issue_comment_url":"https://api.github.com/repos/pbx0/mantle/issues/comments{/number}","contents_url":"https://api.github.com/repos/pbx0/mantle/contents/{+path}","compare_url":"https://api.github.com/repos/pbx0/mantle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pbx0/mantle/merges","archive_url":"https://api.github.com/repos/pbx0/mantle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pbx0/mantle/downloads","issues_url":"https://api.github.com/repos/pbx0/mantle/issues{/number}","pulls_url":"https://api.github.com/repos/pbx0/mantle/pulls{/number}","milestones_url":"https://api.github.com/repos/pbx0/mantle/milestones{/number}","notifications_url":"https://api.github.com/repos/pbx0/mantle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pbx0/mantle/labels{/name}","releases_url":"https://api.github.com/repos/pbx0/mantle/releases{/id}","created_at":"2015-02-27T23:22:32Z","updated_at":"2015-02-27T23:22:32Z","pushed_at":"2015-09-17T01:05:09Z","git_url":"git://github.com/pbx0/mantle.git","ssh_url":"git@github.com:pbx0/mantle.git","clone_url":"https://github.com/pbx0/mantle.git","svn_url":"https://github.com/pbx0/mantle","homepage":"","size":6838,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"coreos:master","ref":"master","sha":"2a2072c9f6627439522e77af3776a332dea6c699","user":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"repo":{"id":27562362,"name":"mantle","full_name":"coreos/mantle","owner":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coreos/mantle","description":"Mantle: Gluing CoreOS together","fork":false,"url":"https://api.github.com/repos/coreos/mantle","forks_url":"https://api.github.com/repos/coreos/mantle/forks","keys_url":"https://api.github.com/repos/coreos/mantle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coreos/mantle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coreos/mantle/teams","hooks_url":"https://api.github.com/repos/coreos/mantle/hooks","issue_events_url":"https://api.github.com/repos/coreos/mantle/issues/events{/number}","events_url":"https://api.github.com/repos/coreos/mantle/events","assignees_url":"https://api.github.com/repos/coreos/mantle/assignees{/user}","branches_url":"https://api.github.com/repos/coreos/mantle/branches{/branch}","tags_url":"https://api.github.com/repos/coreos/mantle/tags","blobs_url":"https://api.github.com/repos/coreos/mantle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coreos/mantle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coreos/mantle/git/refs{/sha}","trees_url":"https://api.github.com/repos/coreos/mantle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coreos/mantle/statuses/{sha}","languages_url":"https://api.github.com/repos/coreos/mantle/languages","stargazers_url":"https://api.github.com/repos/coreos/mantle/stargazers","contributors_url":"https://api.github.com/repos/coreos/mantle/contributors","subscribers_url":"https://api.github.com/repos/coreos/mantle/subscribers","subscription_url":"https://api.github.com/repos/coreos/mantle/subscription","commits_url":"https://api.github.com/repos/coreos/mantle/commits{/sha}","git_commits_url":"https://api.github.com/repos/coreos/mantle/git/commits{/sha}","comments_url":"https://api.github.com/repos/coreos/mantle/comments{/number}","issue_comment_url":"https://api.github.com/repos/coreos/mantle/issues/comments{/number}","contents_url":"https://api.github.com/repos/coreos/mantle/contents/{+path}","compare_url":"https://api.github.com/repos/coreos/mantle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coreos/mantle/merges","archive_url":"https://api.github.com/repos/coreos/mantle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coreos/mantle/downloads","issues_url":"https://api.github.com/repos/coreos/mantle/issues{/number}","pulls_url":"https://api.github.com/repos/coreos/mantle/pulls{/number}","milestones_url":"https://api.github.com/repos/coreos/mantle/milestones{/number}","notifications_url":"https://api.github.com/repos/coreos/mantle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coreos/mantle/labels{/name}","releases_url":"https://api.github.com/repos/coreos/mantle/releases{/id}","created_at":"2014-12-04T22:09:02Z","updated_at":"2015-08-09T23:23:29Z","pushed_at":"2015-09-17T01:06:20Z","git_url":"git://github.com/coreos/mantle.git","ssh_url":"git@github.com:coreos/mantle.git","clone_url":"https://github.com/coreos/mantle.git","svn_url":"https://github.com/coreos/mantle","homepage":"","size":13652,"stargazers_count":10,"watchers_count":10,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":14,"forks":6,"open_issues":14,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coreos/mantle/pulls/109"},"html":{"href":"https://github.com/coreos/mantle/pull/109"},"issue":{"href":"https://api.github.com/repos/coreos/mantle/issues/109"},"comments":{"href":"https://api.github.com/repos/coreos/mantle/issues/109/comments"},"review_comments":{"href":"https://api.github.com/repos/coreos/mantle/pulls/109/comments"},"review_comment":{"href":"https://api.github.com/repos/coreos/mantle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coreos/mantle/pulls/109/commits"},"statuses":{"href":"https://api.github.com/repos/coreos/mantle/statuses/7adeca804569200c82069ecd70fce0ba51028bed"}}}}