{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/19172","labels_url":"https://api.github.com/repos/saltstack/salt/issues/19172/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/19172/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/19172/events","html_url":"https://github.com/saltstack/salt/issues/19172","id":52618567,"number":19172,"title":"in the presence of bug yumpkg check_db","user":{"login":"Jiaion","id":451960,"avatar_url":"https://avatars.githubusercontent.com/u/451960?v=3","gravatar_id":"","url":"https://api.github.com/users/Jiaion","html_url":"https://github.com/Jiaion","followers_url":"https://api.github.com/users/Jiaion/followers","following_url":"https://api.github.com/users/Jiaion/following{/other_user}","gists_url":"https://api.github.com/users/Jiaion/gists{/gist_id}","starred_url":"https://api.github.com/users/Jiaion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jiaion/subscriptions","organizations_url":"https://api.github.com/users/Jiaion/orgs","repos_url":"https://api.github.com/users/Jiaion/repos","events_url":"https://api.github.com/users/Jiaion/events{/privacy}","received_events_url":"https://api.github.com/users/Jiaion/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Info%20Needed","name":"Info Needed","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/37","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/37/labels","id":343741,"number":37,"title":"Blocked","description":"Issues which are blocked in some way, whether they need further discussion, clarification, justification, or are blocked for some other reason.","creator":{"login":"basepi","id":702318,"avatar_url":"https://avatars.githubusercontent.com/u/702318?v=3","gravatar_id":"","url":"https://api.github.com/users/basepi","html_url":"https://github.com/basepi","followers_url":"https://api.github.com/users/basepi/followers","following_url":"https://api.github.com/users/basepi/following{/other_user}","gists_url":"https://api.github.com/users/basepi/gists{/gist_id}","starred_url":"https://api.github.com/users/basepi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basepi/subscriptions","organizations_url":"https://api.github.com/users/basepi/orgs","repos_url":"https://api.github.com/users/basepi/repos","events_url":"https://api.github.com/users/basepi/events{/privacy}","received_events_url":"https://api.github.com/users/basepi/received_events","type":"User","site_admin":false},"open_issues":205,"closed_issues":412,"state":"open","created_at":"2013-05-28T22:24:12Z","updated_at":"2015-01-29T17:22:29Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2014-12-22T04:13:06Z","updated_at":"2015-01-30T14:59:06Z","closed_at":null,"body":"522 is not a desired line avail data structure, so that the front of _repoquery wasteful。\r\navail is [name.arch,.....]。\r\n\r\nIn the case of the specified branch, check_db also unavailable\r\n\r\n```\r\n 513             try:\r\n 514                 name, arch = line.split('_|-')\r\n 515             except ValueError:\r\n 516                 continue\r\n 517             avail.append(normalize_name('.'.join((name, arch))))\r\n 518         __context__['pkg._avail'] = avail\r\n 519 \r\n 520     ret = {}\r\n 521     for name in names:\r\n 522         ret.setdefault(name, {})['found'] = name in avail                                                                                \r\n 523         if not ret[name]['found']:\r\n```\r\n\r\nHere is my fix。\r\n\r\n```\r\n@@ -552,9 +552,17 @@ def check_db(*names, **kwargs):\r\n     normalize = kwargs.pop('normalize') if kwargs.get('normalize') else False\r\n     repo_arg = _get_repo_options(**kwargs)\r\n     exclude_arg = _get_excludes_option(**kwargs)\r\n+    branch_arg = _get_branch_option(**kwargs)\r\n+\r\n     repoquery_base = \\\r\n         '{0} {1} --all --quiet --whatprovides'.format(repo_arg, exclude_arg)\r\n \r\n+    deplist_base = ' '.join(['yum {repo_arg} deplist --quiet {branch_arg}'.format(repo_arg=repo_arg,\r\n+                                                                                  branch_arg = branch_arg,\r\n+                                                                                 ),\r\n+                             '{0!r}',]\r\n+                            )\r\n+\r\n     if 'pkg._avail' in __context__:\r\n         avail = __context__['pkg._avail']\r\n     else:\r\n@@ -569,10 +577,11 @@ def check_db(*names, **kwargs):\r\n                 name, arch = line.split('_|-')\r\n             except ValueError:\r\n                 continue\r\n-            if normalize:\r\n-                avail.append(normalize_name('.'.join((name, arch))))\r\n-            else:\r\n-                avail.append('.'.join((name, arch)))\r\n+            #if normalize:\r\n+                #avail.append(normalize_name('.'.join((name, arch))))\r\n+            #else:\r\n+                #avail.append('.'.join((name, arch)))\r\n+            avail.append(name)\r\n         __context__['pkg._avail'] = avail\r\n \r\n     ret = {}\r\n@@ -588,6 +597,11 @@ def check_db(*names, **kwargs):\r\n                 ret[name]['found'] = True\r\n             else:\r\n                 ret[name]['suggestions'] = provides\r\n+\r\n+        if not ret[name]['found'] and kwargs.get('branch'):\r\n+            ret[name]['found'] = bool(\r\n+                __salt__['cmd.run'](deplist_base.format(name))\r\n+                )\r\n     return ret\r\n ```"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/72213334","html_url":"https://github.com/saltstack/salt/issues/19172#issuecomment-72213334","issue_url":"https://api.github.com/repos/saltstack/salt/issues/19172","id":72213334,"user":{"login":"Jiaion","id":451960,"avatar_url":"https://avatars.githubusercontent.com/u/451960?v=3","gravatar_id":"","url":"https://api.github.com/users/Jiaion","html_url":"https://github.com/Jiaion","followers_url":"https://api.github.com/users/Jiaion/followers","following_url":"https://api.github.com/users/Jiaion/following{/other_user}","gists_url":"https://api.github.com/users/Jiaion/gists{/gist_id}","starred_url":"https://api.github.com/users/Jiaion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jiaion/subscriptions","organizations_url":"https://api.github.com/users/Jiaion/orgs","repos_url":"https://api.github.com/users/Jiaion/repos","events_url":"https://api.github.com/users/Jiaion/events{/privacy}","received_events_url":"https://api.github.com/users/Jiaion/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T14:59:06Z","updated_at":"2015-01-30T14:59:06Z","body":"@terminalmage\r\nThe Bug in the latest version already exists。"}}