{"action":"created","comment":{"url":"https://api.github.com/repos/jsilhan/richdeps-docker/pulls/comments/44651207","id":44651207,"diff_hunk":"@@ -1,108 +1,229 @@\n #!/usr/bin/python -tt\n \n from behave import *\n-import os, sys, subprocess, glob\n+import os\n+import subprocess\n+import glob\n+import re\n \n DNF_FLAGS = ['-y', '--disablerepo=*', '--nogpgcheck']\n RPM_INSTALL_FLAGS = ['-Uvh']\n RPM_ERASE_FLAGS = ['-e']\n \n+\n def _left_decorator(item):\n-  \" Removed packages \"\n-  return u'-' + item\n+    \"\"\" Removed packages \"\"\"\n+    return u'-' + item\n+\n \n def _right_decorator(item):\n-  \" Installed packages \"\n-  return u'+' + item\n+    \"\"\" Installed packages \"\"\"\n+    return u'+' + item\n+\n \n def find_pkg(pkg):\n-  \" Find the package file in the repository \"\n-  candidates = glob.glob('/repo/'+pkg+'*.rpm')\n-  if len(candidates) == 0:\n-    print(\"No candidates for: '{0}'\".format(pkg))\n-  assert len(candidates) == 1\n-  return candidates[0]\n+    \"\"\" Find the package file in the repository \"\"\"\n+    candidates = glob.glob('/repo/' + pkg + '*.rpm')\n+    if len(candidates) == 0:\n+        print(\"No candidates for: '{0}'\".format(pkg))\n+    assert len(candidates) == 1\n+    return candidates[0]\n+\n \n def decorate_rpm_packages(pkgs):\n-  \" Converts package names like TestA, TestB into absolute paths \"\n-  return [find_pkg(p) for p in pkgs]\n+    \"\"\" Converts package names like TestA, TestB into absolute paths \"\"\"\n+    return [find_pkg(p) for p in pkgs]\n+\n \n def get_package_list():\n-  \" Gets all installed packages in the system \"\n-  pkgstr = subprocess.check_output(['rpm', '-qa', '--queryformat', '%{NAME}\\n'])\n-  return pkgstr.splitlines()\n+    \"\"\" Gets all installed packages in the system \"\"\"\n+    pkgstr = subprocess.check_output(['rpm', '-qa', '--queryformat', '%{NAME}\\n'])\n+    return pkgstr.splitlines()\n+\n+\n+def get_package_version_list():\n+    \"\"\" Gets all installed packages in the system with version\"\"\"\n+    pkgverstr = subprocess.check_output(['rpm', '-qa', '--queryformat', '%{NAME}-%{VERSION}-%{RELEASE}\\n'])\n+    return pkgverstr.splitlines()\n+\n+\n+def get_package_dnf_version_list():\n+    \"\"\" Gets all installed packages in the system with version to check that dnf has same data about installed packages\"\"\"\n+    pkgverstr = subprocess.check_output(['dnf', 'repoquery', '--installed', '-C', '--queryformat', '%{name}.%{version}.%{release}\\n'])\n+    pkgverstr = pkgverstr.splitlines()\n+    return pkgverstr[1:]","path":"features/steps/test_behave.py","position":70,"original_position":70,"commit_id":"10814e7247a081d68deae32f390ad72313954445","original_commit_id":"10814e7247a081d68deae32f390ad72313954445","user":{"login":"jsilhan","id":5243763,"avatar_url":"https://avatars.githubusercontent.com/u/5243763?v=3","gravatar_id":"","url":"https://api.github.com/users/jsilhan","html_url":"https://github.com/jsilhan","followers_url":"https://api.github.com/users/jsilhan/followers","following_url":"https://api.github.com/users/jsilhan/following{/other_user}","gists_url":"https://api.github.com/users/jsilhan/gists{/gist_id}","starred_url":"https://api.github.com/users/jsilhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsilhan/subscriptions","organizations_url":"https://api.github.com/users/jsilhan/orgs","repos_url":"https://api.github.com/users/jsilhan/repos","events_url":"https://api.github.com/users/jsilhan/events{/privacy}","received_events_url":"https://api.github.com/users/jsilhan/received_events","type":"User","site_admin":false},"body":"this looks hacky (probably because of metadata information), add `-q` to the command instead, please","created_at":"2015-11-12T12:27:48Z","updated_at":"2015-11-12T12:27:48Z","html_url":"https://github.com/jsilhan/richdeps-docker/pull/2#discussion_r44651207","pull_request_url":"https://api.github.com/repos/jsilhan/richdeps-docker/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/jsilhan/richdeps-docker/pulls/comments/44651207"},"html":{"href":"https://github.com/jsilhan/richdeps-docker/pull/2#discussion_r44651207"},"pull_request":{"href":"https://api.github.com/repos/jsilhan/richdeps-docker/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/jsilhan/richdeps-docker/pulls/2","id":50504387,"html_url":"https://github.com/jsilhan/richdeps-docker/pull/2","diff_url":"https://github.com/jsilhan/richdeps-docker/pull/2.diff","patch_url":"https://github.com/jsilhan/richdeps-docker/pull/2.patch","issue_url":"https://api.github.com/repos/jsilhan/richdeps-docker/issues/2","number":2,"state":"open","locked":false,"title":"Jmracek","user":{"login":"j-mracek","id":12737303,"avatar_url":"https://avatars.githubusercontent.com/u/12737303?v=3","gravatar_id":"","url":"https://api.github.com/users/j-mracek","html_url":"https://github.com/j-mracek","followers_url":"https://api.github.com/users/j-mracek/followers","following_url":"https://api.github.com/users/j-mracek/following{/other_user}","gists_url":"https://api.github.com/users/j-mracek/gists{/gist_id}","starred_url":"https://api.github.com/users/j-mracek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j-mracek/subscriptions","organizations_url":"https://api.github.com/users/j-mracek/orgs","repos_url":"https://api.github.com/users/j-mracek/repos","events_url":"https://api.github.com/users/j-mracek/events{/privacy}","received_events_url":"https://api.github.com/users/j-mracek/received_events","type":"User","site_admin":false},"body":"Applied proposed changes from last review","created_at":"2015-11-12T12:21:38Z","updated_at":"2015-11-12T12:27:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8291a74f1f2a97c3ac7bc071017cedaa1726513d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jsilhan/richdeps-docker/pulls/2/commits","review_comments_url":"https://api.github.com/repos/jsilhan/richdeps-docker/pulls/2/comments","review_comment_url":"https://api.github.com/repos/jsilhan/richdeps-docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jsilhan/richdeps-docker/issues/2/comments","statuses_url":"https://api.github.com/repos/jsilhan/richdeps-docker/statuses/10814e7247a081d68deae32f390ad72313954445","head":{"label":"j-mracek:jmracek","ref":"jmracek","sha":"10814e7247a081d68deae32f390ad72313954445","user":{"login":"j-mracek","id":12737303,"avatar_url":"https://avatars.githubusercontent.com/u/12737303?v=3","gravatar_id":"","url":"https://api.github.com/users/j-mracek","html_url":"https://github.com/j-mracek","followers_url":"https://api.github.com/users/j-mracek/followers","following_url":"https://api.github.com/users/j-mracek/following{/other_user}","gists_url":"https://api.github.com/users/j-mracek/gists{/gist_id}","starred_url":"https://api.github.com/users/j-mracek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j-mracek/subscriptions","organizations_url":"https://api.github.com/users/j-mracek/orgs","repos_url":"https://api.github.com/users/j-mracek/repos","events_url":"https://api.github.com/users/j-mracek/events{/privacy}","received_events_url":"https://api.github.com/users/j-mracek/received_events","type":"User","site_admin":false},"repo":{"id":46050627,"name":"richdeps-docker","full_name":"j-mracek/richdeps-docker","owner":{"login":"j-mracek","id":12737303,"avatar_url":"https://avatars.githubusercontent.com/u/12737303?v=3","gravatar_id":"","url":"https://api.github.com/users/j-mracek","html_url":"https://github.com/j-mracek","followers_url":"https://api.github.com/users/j-mracek/followers","following_url":"https://api.github.com/users/j-mracek/following{/other_user}","gists_url":"https://api.github.com/users/j-mracek/gists{/gist_id}","starred_url":"https://api.github.com/users/j-mracek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j-mracek/subscriptions","organizations_url":"https://api.github.com/users/j-mracek/orgs","repos_url":"https://api.github.com/users/j-mracek/repos","events_url":"https://api.github.com/users/j-mracek/events{/privacy}","received_events_url":"https://api.github.com/users/j-mracek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/j-mracek/richdeps-docker","description":"Docker images for testing rich dependencies in DNF/RPM","fork":true,"url":"https://api.github.com/repos/j-mracek/richdeps-docker","forks_url":"https://api.github.com/repos/j-mracek/richdeps-docker/forks","keys_url":"https://api.github.com/repos/j-mracek/richdeps-docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/j-mracek/richdeps-docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/j-mracek/richdeps-docker/teams","hooks_url":"https://api.github.com/repos/j-mracek/richdeps-docker/hooks","issue_events_url":"https://api.github.com/repos/j-mracek/richdeps-docker/issues/events{/number}","events_url":"https://api.github.com/repos/j-mracek/richdeps-docker/events","assignees_url":"https://api.github.com/repos/j-mracek/richdeps-docker/assignees{/user}","branches_url":"https://api.github.com/repos/j-mracek/richdeps-docker/branches{/branch}","tags_url":"https://api.github.com/repos/j-mracek/richdeps-docker/tags","blobs_url":"https://api.github.com/repos/j-mracek/richdeps-docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/j-mracek/richdeps-docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/j-mracek/richdeps-docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/j-mracek/richdeps-docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/j-mracek/richdeps-docker/statuses/{sha}","languages_url":"https://api.github.com/repos/j-mracek/richdeps-docker/languages","stargazers_url":"https://api.github.com/repos/j-mracek/richdeps-docker/stargazers","contributors_url":"https://api.github.com/repos/j-mracek/richdeps-docker/contributors","subscribers_url":"https://api.github.com/repos/j-mracek/richdeps-docker/subscribers","subscription_url":"https://api.github.com/repos/j-mracek/richdeps-docker/subscription","commits_url":"https://api.github.com/repos/j-mracek/richdeps-docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/j-mracek/richdeps-docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/j-mracek/richdeps-docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/j-mracek/richdeps-docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/j-mracek/richdeps-docker/contents/{+path}","compare_url":"https://api.github.com/repos/j-mracek/richdeps-docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/j-mracek/richdeps-docker/merges","archive_url":"https://api.github.com/repos/j-mracek/richdeps-docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/j-mracek/richdeps-docker/downloads","issues_url":"https://api.github.com/repos/j-mracek/richdeps-docker/issues{/number}","pulls_url":"https://api.github.com/repos/j-mracek/richdeps-docker/pulls{/number}","milestones_url":"https://api.github.com/repos/j-mracek/richdeps-docker/milestones{/number}","notifications_url":"https://api.github.com/repos/j-mracek/richdeps-docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/j-mracek/richdeps-docker/labels{/name}","releases_url":"https://api.github.com/repos/j-mracek/richdeps-docker/releases{/id}","created_at":"2015-11-12T12:12:03Z","updated_at":"2015-11-12T12:12:03Z","pushed_at":"2015-11-12T12:19:48Z","git_url":"git://github.com/j-mracek/richdeps-docker.git","ssh_url":"git@github.com:j-mracek/richdeps-docker.git","clone_url":"https://github.com/j-mracek/richdeps-docker.git","svn_url":"https://github.com/j-mracek/richdeps-docker","homepage":null,"size":15811,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"jsilhan:jmracek","ref":"jmracek","sha":"97184bb4927228d4edbb55a354706f1eaec6c92e","user":{"login":"jsilhan","id":5243763,"avatar_url":"https://avatars.githubusercontent.com/u/5243763?v=3","gravatar_id":"","url":"https://api.github.com/users/jsilhan","html_url":"https://github.com/jsilhan","followers_url":"https://api.github.com/users/jsilhan/followers","following_url":"https://api.github.com/users/jsilhan/following{/other_user}","gists_url":"https://api.github.com/users/jsilhan/gists{/gist_id}","starred_url":"https://api.github.com/users/jsilhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsilhan/subscriptions","organizations_url":"https://api.github.com/users/jsilhan/orgs","repos_url":"https://api.github.com/users/jsilhan/repos","events_url":"https://api.github.com/users/jsilhan/events{/privacy}","received_events_url":"https://api.github.com/users/jsilhan/received_events","type":"User","site_admin":false},"repo":{"id":45253475,"name":"richdeps-docker","full_name":"jsilhan/richdeps-docker","owner":{"login":"jsilhan","id":5243763,"avatar_url":"https://avatars.githubusercontent.com/u/5243763?v=3","gravatar_id":"","url":"https://api.github.com/users/jsilhan","html_url":"https://github.com/jsilhan","followers_url":"https://api.github.com/users/jsilhan/followers","following_url":"https://api.github.com/users/jsilhan/following{/other_user}","gists_url":"https://api.github.com/users/jsilhan/gists{/gist_id}","starred_url":"https://api.github.com/users/jsilhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsilhan/subscriptions","organizations_url":"https://api.github.com/users/jsilhan/orgs","repos_url":"https://api.github.com/users/jsilhan/repos","events_url":"https://api.github.com/users/jsilhan/events{/privacy}","received_events_url":"https://api.github.com/users/jsilhan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jsilhan/richdeps-docker","description":"Docker images for testing rich dependencies in DNF/RPM","fork":true,"url":"https://api.github.com/repos/jsilhan/richdeps-docker","forks_url":"https://api.github.com/repos/jsilhan/richdeps-docker/forks","keys_url":"https://api.github.com/repos/jsilhan/richdeps-docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jsilhan/richdeps-docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jsilhan/richdeps-docker/teams","hooks_url":"https://api.github.com/repos/jsilhan/richdeps-docker/hooks","issue_events_url":"https://api.github.com/repos/jsilhan/richdeps-docker/issues/events{/number}","events_url":"https://api.github.com/repos/jsilhan/richdeps-docker/events","assignees_url":"https://api.github.com/repos/jsilhan/richdeps-docker/assignees{/user}","branches_url":"https://api.github.com/repos/jsilhan/richdeps-docker/branches{/branch}","tags_url":"https://api.github.com/repos/jsilhan/richdeps-docker/tags","blobs_url":"https://api.github.com/repos/jsilhan/richdeps-docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jsilhan/richdeps-docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jsilhan/richdeps-docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/jsilhan/richdeps-docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jsilhan/richdeps-docker/statuses/{sha}","languages_url":"https://api.github.com/repos/jsilhan/richdeps-docker/languages","stargazers_url":"https://api.github.com/repos/jsilhan/richdeps-docker/stargazers","contributors_url":"https://api.github.com/repos/jsilhan/richdeps-docker/contributors","subscribers_url":"https://api.github.com/repos/jsilhan/richdeps-docker/subscribers","subscription_url":"https://api.github.com/repos/jsilhan/richdeps-docker/subscription","commits_url":"https://api.github.com/repos/jsilhan/richdeps-docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/jsilhan/richdeps-docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/jsilhan/richdeps-docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/jsilhan/richdeps-docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/jsilhan/richdeps-docker/contents/{+path}","compare_url":"https://api.github.com/repos/jsilhan/richdeps-docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jsilhan/richdeps-docker/merges","archive_url":"https://api.github.com/repos/jsilhan/richdeps-docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jsilhan/richdeps-docker/downloads","issues_url":"https://api.github.com/repos/jsilhan/richdeps-docker/issues{/number}","pulls_url":"https://api.github.com/repos/jsilhan/richdeps-docker/pulls{/number}","milestones_url":"https://api.github.com/repos/jsilhan/richdeps-docker/milestones{/number}","notifications_url":"https://api.github.com/repos/jsilhan/richdeps-docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jsilhan/richdeps-docker/labels{/name}","releases_url":"https://api.github.com/repos/jsilhan/richdeps-docker/releases{/id}","created_at":"2015-10-30T13:47:08Z","updated_at":"2015-10-30T13:47:08Z","pushed_at":"2015-11-12T12:21:38Z","git_url":"git://github.com/jsilhan/richdeps-docker.git","ssh_url":"git@github.com:jsilhan/richdeps-docker.git","clone_url":"https://github.com/jsilhan/richdeps-docker.git","svn_url":"https://github.com/jsilhan/richdeps-docker","homepage":null,"size":15811,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jsilhan/richdeps-docker/pulls/2"},"html":{"href":"https://github.com/jsilhan/richdeps-docker/pull/2"},"issue":{"href":"https://api.github.com/repos/jsilhan/richdeps-docker/issues/2"},"comments":{"href":"https://api.github.com/repos/jsilhan/richdeps-docker/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/jsilhan/richdeps-docker/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/jsilhan/richdeps-docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jsilhan/richdeps-docker/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/jsilhan/richdeps-docker/statuses/10814e7247a081d68deae32f390ad72313954445"}}}}