{"action":"created","comment":{"url":"https://api.github.com/repos/crowbar/crowbar/pulls/comments/23759620","id":23759620,"diff_hunk":"@@ -500,47 +524,70 @@ check_repo_content () {\n     fi\n }\n \n-check_repo_product () {\n-    repo=\"$1\" expected_summary=\"$2\" create_if_missing=\"$3\"\n-    products_xml=/srv/tftpboot/repos/$repo/repodata/products.xml\n-    if ! grep -q \"<summary>$2</summary>\" $products_xml; then\n-        if skip_check_for_repo \"$repo\"; then\n-            echo \"Ignoring failed repo check for $repo due to \\$REPOS_SKIP_CHECKS ($products_xml is missing summary '$expected_summary')\"\n-            if [ ! -d /srv/tftpboot/repos/$repo -a \"x$create_if_missing\" != \"xfalse\" ]; then\n-                echo \"Creating repo skeleton to make AutoYaST happy.\"\n-                mkdir /srv/tftpboot/repos/$repo\n-                /usr/bin/createrepo /srv/tftpboot/repos/$repo\n-            fi\n-            return 0\n-        fi\n-        die \"$repo does not contain the right repository ($products_xml is missing summary '$expected_summary')\"\n+check_repo_key () {\n+    version=\"$1\" repo=\"$2\"\n+    repomd_key=/srv/tftpboot/suse-$version/repos/$repo/repodata/repomd.xml.key\n+    if [ ! -f $repomd_key ]; then\n+      die \"$repo ($version) does not seem to be signed\"\n+    else\n+      case \"`md5sum $repomd_key | awk '{print $1}'`\" in\n+        a0857768a900ae6bb1e6c8af62460ce3|b2740847428d13d201642ca9cf89bec7)\n+          # SLE11 keys\n+          ;;\n+        9a62177e1c6852d48453ed3909956d6b)\n+          # SLE12 key\n+          ;;\n+        6e2920076653964b7de9d6d0421955bb)\n+          # Devel:Cloud key\n+          ;;\n+        *)\n+          die \"$repo ($version) does not seem to be signed with the right key\"\n+          ;;\n+      esac\n     fi\n }\n \n-# FIXME: repos that we cannot check yet:\n-#   SP3-Updates is lacking products.xml\n-#   Cloud: we don't have the final md5\n-REPOS_SKIP_CHECKS+=\" Cloud SLES11-SP3-Updates SUSE-Cloud-5-Pool SUSE-Cloud-5-Updates\"\n+check_repo_tag () {\n+    tag=\"$1\" version=\"$2\" repo=\"$3\" expected=\"$4\" create_if_missing=\"$5\"\n \n-# HAE add-on should remain optional for now\n-REPOS_SKIP_CHECKS+=\" SLE11-HAE-SP3-Pool SLE11-HAE-SP3-Updates\"\n+    repo_dir=/srv/tftpboot/suse-$version/repos/$repo\n \n-# Storage should remain optional for now\n-REPOS_SKIP_CHECKS+=\" SUSE-Enterprise-Storage-1.0-Pool SUSE-Enterprise-Storage-1.0-Updates\"\n+    case \"$tag\" in\n+      summary)\n+        xml=$repo_dir/repodata/products.xml\n+        ;;\n+      repo)\n+        xml=$repo_dir/repodata/repomd.xml\n+        ;;\n+      *)\n+        die \"Internal error: unknown tag $tag for check_repo_tag\"\n+        ;;\n+     esac\n \n-MEDIA=/srv/tftpboot/suse-11.3/install\n+    ignore_failure=1\n+    skip_check_for_repo \"$repo\" || ignore_failure=0","path":"releases/development/master/extra/install-chef-suse.sh","position":145,"original_position":145,"commit_id":"f026107188c374363b59370facc1ec1f30241fbc","original_commit_id":"f026107188c374363b59370facc1ec1f30241fbc","user":{"login":"vuntz","id":1758783,"avatar_url":"https://avatars.githubusercontent.com/u/1758783?v=3","gravatar_id":"","url":"https://api.github.com/users/vuntz","html_url":"https://github.com/vuntz","followers_url":"https://api.github.com/users/vuntz/followers","following_url":"https://api.github.com/users/vuntz/following{/other_user}","gists_url":"https://api.github.com/users/vuntz/gists{/gist_id}","starred_url":"https://api.github.com/users/vuntz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuntz/subscriptions","organizations_url":"https://api.github.com/users/vuntz/orgs","repos_url":"https://api.github.com/users/vuntz/repos","events_url":"https://api.github.com/users/vuntz/events{/privacy}","received_events_url":"https://api.github.com/users/vuntz/received_events","type":"User","site_admin":false},"body":"It's just that I use `0` and `1` as booleans, not as `shell exit codes interpreted for tests`. So I think it's correct, although possibly confusing.","created_at":"2015-01-29T10:50:26Z","updated_at":"2015-01-29T10:50:26Z","html_url":"https://github.com/crowbar/crowbar/pull/2081#discussion_r23759620","pull_request_url":"https://api.github.com/repos/crowbar/crowbar/pulls/2081","_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar/pulls/comments/23759620"},"html":{"href":"https://github.com/crowbar/crowbar/pull/2081#discussion_r23759620"},"pull_request":{"href":"https://api.github.com/repos/crowbar/crowbar/pulls/2081"}}},"pull_request":{"url":"https://api.github.com/repos/crowbar/crowbar/pulls/2081","id":28260664,"html_url":"https://github.com/crowbar/crowbar/pull/2081","diff_url":"https://github.com/crowbar/crowbar/pull/2081.diff","patch_url":"https://github.com/crowbar/crowbar/pull/2081.patch","issue_url":"https://api.github.com/repos/crowbar/crowbar/issues/2081","number":2081,"state":"open","locked":false,"title":"Rework checks for repos","user":{"login":"vuntz","id":1758783,"avatar_url":"https://avatars.githubusercontent.com/u/1758783?v=3","gravatar_id":"","url":"https://api.github.com/users/vuntz","html_url":"https://github.com/vuntz","followers_url":"https://api.github.com/users/vuntz/followers","following_url":"https://api.github.com/users/vuntz/following{/other_user}","gists_url":"https://api.github.com/users/vuntz/gists{/gist_id}","starred_url":"https://api.github.com/users/vuntz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuntz/subscriptions","organizations_url":"https://api.github.com/users/vuntz/orgs","repos_url":"https://api.github.com/users/vuntz/repos","events_url":"https://api.github.com/users/vuntz/events{/privacy}","received_events_url":"https://api.github.com/users/vuntz/received_events","type":"User","site_admin":false},"body":"The checks are a bit more solid:\r\n - we don't always check for the product, but also for some other tag\r\n - we also check for the key signing the repo\r\n - there are more checks for SLE12\r\n\r\nThis comes on top of https://github.com/crowbar/crowbar/pull/2080 (so patches from this PR are included here for now).","created_at":"2015-01-29T08:19:05Z","updated_at":"2015-01-29T10:50:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"46177e0cc3f488ff8bfdec98c869885915fd8a5d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crowbar/crowbar/pulls/2081/commits","review_comments_url":"https://api.github.com/repos/crowbar/crowbar/pulls/2081/comments","review_comment_url":"https://api.github.com/repos/crowbar/crowbar/pulls/comments/{number}","comments_url":"https://api.github.com/repos/crowbar/crowbar/issues/2081/comments","statuses_url":"https://api.github.com/repos/crowbar/crowbar/statuses/f026107188c374363b59370facc1ec1f30241fbc","head":{"label":"vuntz:repos-versioned-subdir-fix-checks","ref":"repos-versioned-subdir-fix-checks","sha":"f026107188c374363b59370facc1ec1f30241fbc","user":{"login":"vuntz","id":1758783,"avatar_url":"https://avatars.githubusercontent.com/u/1758783?v=3","gravatar_id":"","url":"https://api.github.com/users/vuntz","html_url":"https://github.com/vuntz","followers_url":"https://api.github.com/users/vuntz/followers","following_url":"https://api.github.com/users/vuntz/following{/other_user}","gists_url":"https://api.github.com/users/vuntz/gists{/gist_id}","starred_url":"https://api.github.com/users/vuntz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuntz/subscriptions","organizations_url":"https://api.github.com/users/vuntz/orgs","repos_url":"https://api.github.com/users/vuntz/repos","events_url":"https://api.github.com/users/vuntz/events{/privacy}","received_events_url":"https://api.github.com/users/vuntz/received_events","type":"User","site_admin":false},"repo":{"id":10238607,"name":"crowbar","full_name":"vuntz/crowbar","owner":{"login":"vuntz","id":1758783,"avatar_url":"https://avatars.githubusercontent.com/u/1758783?v=3","gravatar_id":"","url":"https://api.github.com/users/vuntz","html_url":"https://github.com/vuntz","followers_url":"https://api.github.com/users/vuntz/followers","following_url":"https://api.github.com/users/vuntz/following{/other_user}","gists_url":"https://api.github.com/users/vuntz/gists{/gist_id}","starred_url":"https://api.github.com/users/vuntz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuntz/subscriptions","organizations_url":"https://api.github.com/users/vuntz/orgs","repos_url":"https://api.github.com/users/vuntz/repos","events_url":"https://api.github.com/users/vuntz/events{/privacy}","received_events_url":"https://api.github.com/users/vuntz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vuntz/crowbar","description":"Cloud Installer (originated by Dell)","fork":true,"url":"https://api.github.com/repos/vuntz/crowbar","forks_url":"https://api.github.com/repos/vuntz/crowbar/forks","keys_url":"https://api.github.com/repos/vuntz/crowbar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vuntz/crowbar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vuntz/crowbar/teams","hooks_url":"https://api.github.com/repos/vuntz/crowbar/hooks","issue_events_url":"https://api.github.com/repos/vuntz/crowbar/issues/events{/number}","events_url":"https://api.github.com/repos/vuntz/crowbar/events","assignees_url":"https://api.github.com/repos/vuntz/crowbar/assignees{/user}","branches_url":"https://api.github.com/repos/vuntz/crowbar/branches{/branch}","tags_url":"https://api.github.com/repos/vuntz/crowbar/tags","blobs_url":"https://api.github.com/repos/vuntz/crowbar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vuntz/crowbar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vuntz/crowbar/git/refs{/sha}","trees_url":"https://api.github.com/repos/vuntz/crowbar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vuntz/crowbar/statuses/{sha}","languages_url":"https://api.github.com/repos/vuntz/crowbar/languages","stargazers_url":"https://api.github.com/repos/vuntz/crowbar/stargazers","contributors_url":"https://api.github.com/repos/vuntz/crowbar/contributors","subscribers_url":"https://api.github.com/repos/vuntz/crowbar/subscribers","subscription_url":"https://api.github.com/repos/vuntz/crowbar/subscription","commits_url":"https://api.github.com/repos/vuntz/crowbar/commits{/sha}","git_commits_url":"https://api.github.com/repos/vuntz/crowbar/git/commits{/sha}","comments_url":"https://api.github.com/repos/vuntz/crowbar/comments{/number}","issue_comment_url":"https://api.github.com/repos/vuntz/crowbar/issues/comments/{number}","contents_url":"https://api.github.com/repos/vuntz/crowbar/contents/{+path}","compare_url":"https://api.github.com/repos/vuntz/crowbar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vuntz/crowbar/merges","archive_url":"https://api.github.com/repos/vuntz/crowbar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vuntz/crowbar/downloads","issues_url":"https://api.github.com/repos/vuntz/crowbar/issues{/number}","pulls_url":"https://api.github.com/repos/vuntz/crowbar/pulls{/number}","milestones_url":"https://api.github.com/repos/vuntz/crowbar/milestones{/number}","notifications_url":"https://api.github.com/repos/vuntz/crowbar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vuntz/crowbar/labels{/name}","releases_url":"https://api.github.com/repos/vuntz/crowbar/releases{/id}","created_at":"2013-05-23T07:47:58Z","updated_at":"2014-02-26T11:44:17Z","pushed_at":"2015-01-29T08:36:38Z","git_url":"git://github.com/vuntz/crowbar.git","ssh_url":"git@github.com:vuntz/crowbar.git","clone_url":"https://github.com/vuntz/crowbar.git","svn_url":"https://github.com/vuntz/crowbar","homepage":"https://github.com/crowbar/crowbar/wiki","size":39470,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"crowbar:master","ref":"master","sha":"bbd526f52bfaca23d457cbaffeca943651d7b1be","user":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"repo":{"id":2040151,"name":"crowbar","full_name":"crowbar/crowbar","owner":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crowbar/crowbar","description":"Cloud Operations Platform","fork":false,"url":"https://api.github.com/repos/crowbar/crowbar","forks_url":"https://api.github.com/repos/crowbar/crowbar/forks","keys_url":"https://api.github.com/repos/crowbar/crowbar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crowbar/crowbar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crowbar/crowbar/teams","hooks_url":"https://api.github.com/repos/crowbar/crowbar/hooks","issue_events_url":"https://api.github.com/repos/crowbar/crowbar/issues/events{/number}","events_url":"https://api.github.com/repos/crowbar/crowbar/events","assignees_url":"https://api.github.com/repos/crowbar/crowbar/assignees{/user}","branches_url":"https://api.github.com/repos/crowbar/crowbar/branches{/branch}","tags_url":"https://api.github.com/repos/crowbar/crowbar/tags","blobs_url":"https://api.github.com/repos/crowbar/crowbar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crowbar/crowbar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crowbar/crowbar/git/refs{/sha}","trees_url":"https://api.github.com/repos/crowbar/crowbar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crowbar/crowbar/statuses/{sha}","languages_url":"https://api.github.com/repos/crowbar/crowbar/languages","stargazers_url":"https://api.github.com/repos/crowbar/crowbar/stargazers","contributors_url":"https://api.github.com/repos/crowbar/crowbar/contributors","subscribers_url":"https://api.github.com/repos/crowbar/crowbar/subscribers","subscription_url":"https://api.github.com/repos/crowbar/crowbar/subscription","commits_url":"https://api.github.com/repos/crowbar/crowbar/commits{/sha}","git_commits_url":"https://api.github.com/repos/crowbar/crowbar/git/commits{/sha}","comments_url":"https://api.github.com/repos/crowbar/crowbar/comments{/number}","issue_comment_url":"https://api.github.com/repos/crowbar/crowbar/issues/comments/{number}","contents_url":"https://api.github.com/repos/crowbar/crowbar/contents/{+path}","compare_url":"https://api.github.com/repos/crowbar/crowbar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crowbar/crowbar/merges","archive_url":"https://api.github.com/repos/crowbar/crowbar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crowbar/crowbar/downloads","issues_url":"https://api.github.com/repos/crowbar/crowbar/issues{/number}","pulls_url":"https://api.github.com/repos/crowbar/crowbar/pulls{/number}","milestones_url":"https://api.github.com/repos/crowbar/crowbar/milestones{/number}","notifications_url":"https://api.github.com/repos/crowbar/crowbar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crowbar/crowbar/labels{/name}","releases_url":"https://api.github.com/repos/crowbar/crowbar/releases{/id}","created_at":"2011-07-13T05:02:51Z","updated_at":"2015-01-29T02:17:27Z","pushed_at":"2015-01-21T07:01:22Z","git_url":"git://github.com/crowbar/crowbar.git","ssh_url":"git@github.com:crowbar/crowbar.git","clone_url":"https://github.com/crowbar/crowbar.git","svn_url":"https://github.com/crowbar/crowbar","homepage":"https://github.com/crowbar/crowbar","size":53107,"stargazers_count":680,"watchers_count":680,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":283,"mirror_url":null,"open_issues_count":60,"forks":283,"open_issues":60,"watchers":680,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar/pulls/2081"},"html":{"href":"https://github.com/crowbar/crowbar/pull/2081"},"issue":{"href":"https://api.github.com/repos/crowbar/crowbar/issues/2081"},"comments":{"href":"https://api.github.com/repos/crowbar/crowbar/issues/2081/comments"},"review_comments":{"href":"https://api.github.com/repos/crowbar/crowbar/pulls/2081/comments"},"review_comment":{"href":"https://api.github.com/repos/crowbar/crowbar/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/crowbar/crowbar/pulls/2081/commits"},"statuses":{"href":"https://api.github.com/repos/crowbar/crowbar/statuses/f026107188c374363b59370facc1ec1f30241fbc"}}}}