{"action":"created","comment":{"url":"https://api.github.com/repos/openSUSE/zypper/pulls/comments/212927008","pull_request_review_id":149652870,"id":212927008,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjkyNzAwOA==","diff_hunk":"@@ -488,6 +491,61 @@ namespace {\n     return false;\n   }\n \n+  bool checkRequiredCapabilities ( Zypper & zypper, GlobalOptions &gopts_r )\n+  {\n+    switch ( zypper.command().toEnum() ) {\n+      case ZypperCommand::UPDATE_e:\n+      case ZypperCommand::INSTALL_e:\n+      case ZypperCommand::SRC_INSTALL_e:\n+      case ZypperCommand::PATCH_e:\n+      case ZypperCommand::DIST_UPGRADE_e:\n+      case ZypperCommand::INSTALL_NEW_RECOMMENDS_e:\n+      case ZypperCommand::VERIFY_e:\n+      case ZypperCommand::REMOVE_e:\n+      case ZypperCommand::ADD_REPO_e:\n+      case ZypperCommand::REMOVE_REPO_e:\n+      case ZypperCommand::MODIFY_REPO_e:\n+      case ZypperCommand::RENAME_REPO_e:\n+      case ZypperCommand::ADD_SERVICE_e:\n+      case ZypperCommand::REMOVE_SERVICE_e:\n+      case ZypperCommand::MODIFY_SERVICE_e: {\n+\n+        if ( zypper.cOpts().count(\"dry-run\") )\n+          return true;\n+\n+        struct statfs fsinfo;\n+        memset( &fsinfo, 0, sizeof(struct statfs) );\n+\n+        int err = 0;\n+        do {\n+          err = statfs( gopts_r.root_dir.c_str(), &fsinfo );\n+        } while ( err == -1 && errno == EINTR );\n+\n+        if ( !err ) {\n+          if ( fsinfo.f_flags & ST_RDONLY ) {\n+\n+            bool isTransactionalServer = ( fsinfo.f_type == BTRFS_SUPER_MAGIC && PathInfo( \"/usr/sbin/transactional-update\" ).isFile() );\n+\n+            str::Str msg;\n+            if ( isTransactionalServer && !gopts_r.changedRoot ) {\n+              msg << str::Format(_(\"This is a transactional-server, please use transactional-update to update or modify the system.\"));\n+            } else {\n+              msg << str::Format(_(\"The target filesystem is mounted as read-only. Please make sure the target filesystem is writeable.\"));\n+            }\n+            zypper.out().errorPar( msg );\n+            return false;\n+          }\n+        } else {\n+          MIL << \"Checking if \" << gopts_r.root_dir << \" is mounted read only failed with errno : \" << errno << std::endl;","path":"src/Zypper.cc","position":59,"original_position":59,"commit_id":"2d1a88915b52f855d8586845ea3ae0b08290aef7","original_commit_id":"2d1a88915b52f855d8586845ea3ae0b08290aef7","user":{"login":"bzeller","id":3079829,"node_id":"MDQ6VXNlcjMwNzk4Mjk=","avatar_url":"https://avatars1.githubusercontent.com/u/3079829?v=4","gravatar_id":"","url":"https://api.github.com/users/bzeller","html_url":"https://github.com/bzeller","followers_url":"https://api.github.com/users/bzeller/followers","following_url":"https://api.github.com/users/bzeller/following{/other_user}","gists_url":"https://api.github.com/users/bzeller/gists{/gist_id}","starred_url":"https://api.github.com/users/bzeller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzeller/subscriptions","organizations_url":"https://api.github.com/users/bzeller/orgs","repos_url":"https://api.github.com/users/bzeller/repos","events_url":"https://api.github.com/users/bzeller/events{/privacy}","received_events_url":"https://api.github.com/users/bzeller/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2018-08-27T10:04:31Z","updated_at":"2018-08-27T10:04:31Z","html_url":"https://github.com/openSUSE/zypper/pull/201#discussion_r212927008","pull_request_url":"https://api.github.com/repos/openSUSE/zypper/pulls/201","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openSUSE/zypper/pulls/comments/212927008"},"html":{"href":"https://github.com/openSUSE/zypper/pull/201#discussion_r212927008"},"pull_request":{"href":"https://api.github.com/repos/openSUSE/zypper/pulls/201"}},"in_reply_to_id":212918289},"pull_request":{"url":"https://api.github.com/repos/openSUSE/zypper/pulls/201","id":210727386,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwNzI3Mzg2","html_url":"https://github.com/openSUSE/zypper/pull/201","diff_url":"https://github.com/openSUSE/zypper/pull/201.diff","patch_url":"https://github.com/openSUSE/zypper/pull/201.patch","issue_url":"https://api.github.com/repos/openSUSE/zypper/issues/201","number":201,"state":"open","locked":false,"title":"Detect read only filesystem on system modifying operations (fixes #199)","user":{"login":"bzeller","id":3079829,"node_id":"MDQ6VXNlcjMwNzk4Mjk=","avatar_url":"https://avatars1.githubusercontent.com/u/3079829?v=4","gravatar_id":"","url":"https://api.github.com/users/bzeller","html_url":"https://github.com/bzeller","followers_url":"https://api.github.com/users/bzeller/followers","following_url":"https://api.github.com/users/bzeller/following{/other_user}","gists_url":"https://api.github.com/users/bzeller/gists{/gist_id}","starred_url":"https://api.github.com/users/bzeller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzeller/subscriptions","organizations_url":"https://api.github.com/users/bzeller/orgs","repos_url":"https://api.github.com/users/bzeller/repos","events_url":"https://api.github.com/users/bzeller/events{/privacy}","received_events_url":"https://api.github.com/users/bzeller/received_events","type":"User","site_admin":false},"body":"This patch auto detects if the target filesystem is read only and if it is a transactional server. Zypper will exit directly and print a error message. ","created_at":"2018-08-24T12:33:13Z","updated_at":"2018-08-27T10:04:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a99c219e228cdbb432a8c7315326b3d0765878e4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openSUSE/zypper/pulls/201/commits","review_comments_url":"https://api.github.com/repos/openSUSE/zypper/pulls/201/comments","review_comment_url":"https://api.github.com/repos/openSUSE/zypper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openSUSE/zypper/issues/201/comments","statuses_url":"https://api.github.com/repos/openSUSE/zypper/statuses/2d1a88915b52f855d8586845ea3ae0b08290aef7","head":{"label":"bzeller:issue-github-199","ref":"issue-github-199","sha":"2d1a88915b52f855d8586845ea3ae0b08290aef7","user":{"login":"bzeller","id":3079829,"node_id":"MDQ6VXNlcjMwNzk4Mjk=","avatar_url":"https://avatars1.githubusercontent.com/u/3079829?v=4","gravatar_id":"","url":"https://api.github.com/users/bzeller","html_url":"https://github.com/bzeller","followers_url":"https://api.github.com/users/bzeller/followers","following_url":"https://api.github.com/users/bzeller/following{/other_user}","gists_url":"https://api.github.com/users/bzeller/gists{/gist_id}","starred_url":"https://api.github.com/users/bzeller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzeller/subscriptions","organizations_url":"https://api.github.com/users/bzeller/orgs","repos_url":"https://api.github.com/users/bzeller/repos","events_url":"https://api.github.com/users/bzeller/events{/privacy}","received_events_url":"https://api.github.com/users/bzeller/received_events","type":"User","site_admin":false},"repo":{"id":122510691,"node_id":"MDEwOlJlcG9zaXRvcnkxMjI1MTA2OTE=","name":"zypper","full_name":"bzeller/zypper","owner":{"login":"bzeller","id":3079829,"node_id":"MDQ6VXNlcjMwNzk4Mjk=","avatar_url":"https://avatars1.githubusercontent.com/u/3079829?v=4","gravatar_id":"","url":"https://api.github.com/users/bzeller","html_url":"https://github.com/bzeller","followers_url":"https://api.github.com/users/bzeller/followers","following_url":"https://api.github.com/users/bzeller/following{/other_user}","gists_url":"https://api.github.com/users/bzeller/gists{/gist_id}","starred_url":"https://api.github.com/users/bzeller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzeller/subscriptions","organizations_url":"https://api.github.com/users/bzeller/orgs","repos_url":"https://api.github.com/users/bzeller/repos","events_url":"https://api.github.com/users/bzeller/events{/privacy}","received_events_url":"https://api.github.com/users/bzeller/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bzeller/zypper","description":"World's most powerful command line package manager","fork":true,"url":"https://api.github.com/repos/bzeller/zypper","forks_url":"https://api.github.com/repos/bzeller/zypper/forks","keys_url":"https://api.github.com/repos/bzeller/zypper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bzeller/zypper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bzeller/zypper/teams","hooks_url":"https://api.github.com/repos/bzeller/zypper/hooks","issue_events_url":"https://api.github.com/repos/bzeller/zypper/issues/events{/number}","events_url":"https://api.github.com/repos/bzeller/zypper/events","assignees_url":"https://api.github.com/repos/bzeller/zypper/assignees{/user}","branches_url":"https://api.github.com/repos/bzeller/zypper/branches{/branch}","tags_url":"https://api.github.com/repos/bzeller/zypper/tags","blobs_url":"https://api.github.com/repos/bzeller/zypper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bzeller/zypper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bzeller/zypper/git/refs{/sha}","trees_url":"https://api.github.com/repos/bzeller/zypper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bzeller/zypper/statuses/{sha}","languages_url":"https://api.github.com/repos/bzeller/zypper/languages","stargazers_url":"https://api.github.com/repos/bzeller/zypper/stargazers","contributors_url":"https://api.github.com/repos/bzeller/zypper/contributors","subscribers_url":"https://api.github.com/repos/bzeller/zypper/subscribers","subscription_url":"https://api.github.com/repos/bzeller/zypper/subscription","commits_url":"https://api.github.com/repos/bzeller/zypper/commits{/sha}","git_commits_url":"https://api.github.com/repos/bzeller/zypper/git/commits{/sha}","comments_url":"https://api.github.com/repos/bzeller/zypper/comments{/number}","issue_comment_url":"https://api.github.com/repos/bzeller/zypper/issues/comments{/number}","contents_url":"https://api.github.com/repos/bzeller/zypper/contents/{+path}","compare_url":"https://api.github.com/repos/bzeller/zypper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bzeller/zypper/merges","archive_url":"https://api.github.com/repos/bzeller/zypper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bzeller/zypper/downloads","issues_url":"https://api.github.com/repos/bzeller/zypper/issues{/number}","pulls_url":"https://api.github.com/repos/bzeller/zypper/pulls{/number}","milestones_url":"https://api.github.com/repos/bzeller/zypper/milestones{/number}","notifications_url":"https://api.github.com/repos/bzeller/zypper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bzeller/zypper/labels{/name}","releases_url":"https://api.github.com/repos/bzeller/zypper/releases{/id}","deployments_url":"https://api.github.com/repos/bzeller/zypper/deployments","created_at":"2018-02-22T17:21:45Z","updated_at":"2018-08-22T11:21:55Z","pushed_at":"2018-08-27T08:09:17Z","git_url":"git://github.com/bzeller/zypper.git","ssh_url":"git@github.com:bzeller/zypper.git","clone_url":"https://github.com/bzeller/zypper.git","svn_url":"https://github.com/bzeller/zypper","homepage":"http://en.opensuse.org/Portal:Zypper","size":443377,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openSUSE:master","ref":"master","sha":"0561ccca25092eaa893c7d2ab53c430585dd713d","user":{"login":"openSUSE","id":623819,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMzgxOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/623819?v=4","gravatar_id":"","url":"https://api.github.com/users/openSUSE","html_url":"https://github.com/openSUSE","followers_url":"https://api.github.com/users/openSUSE/followers","following_url":"https://api.github.com/users/openSUSE/following{/other_user}","gists_url":"https://api.github.com/users/openSUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/openSUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openSUSE/subscriptions","organizations_url":"https://api.github.com/users/openSUSE/orgs","repos_url":"https://api.github.com/users/openSUSE/repos","events_url":"https://api.github.com/users/openSUSE/events{/privacy}","received_events_url":"https://api.github.com/users/openSUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":2123340,"node_id":"MDEwOlJlcG9zaXRvcnkyMTIzMzQw","name":"zypper","full_name":"openSUSE/zypper","owner":{"login":"openSUSE","id":623819,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMzgxOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/623819?v=4","gravatar_id":"","url":"https://api.github.com/users/openSUSE","html_url":"https://github.com/openSUSE","followers_url":"https://api.github.com/users/openSUSE/followers","following_url":"https://api.github.com/users/openSUSE/following{/other_user}","gists_url":"https://api.github.com/users/openSUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/openSUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openSUSE/subscriptions","organizations_url":"https://api.github.com/users/openSUSE/orgs","repos_url":"https://api.github.com/users/openSUSE/repos","events_url":"https://api.github.com/users/openSUSE/events{/privacy}","received_events_url":"https://api.github.com/users/openSUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openSUSE/zypper","description":"World's most powerful command line package manager","fork":false,"url":"https://api.github.com/repos/openSUSE/zypper","forks_url":"https://api.github.com/repos/openSUSE/zypper/forks","keys_url":"https://api.github.com/repos/openSUSE/zypper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openSUSE/zypper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openSUSE/zypper/teams","hooks_url":"https://api.github.com/repos/openSUSE/zypper/hooks","issue_events_url":"https://api.github.com/repos/openSUSE/zypper/issues/events{/number}","events_url":"https://api.github.com/repos/openSUSE/zypper/events","assignees_url":"https://api.github.com/repos/openSUSE/zypper/assignees{/user}","branches_url":"https://api.github.com/repos/openSUSE/zypper/branches{/branch}","tags_url":"https://api.github.com/repos/openSUSE/zypper/tags","blobs_url":"https://api.github.com/repos/openSUSE/zypper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openSUSE/zypper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openSUSE/zypper/git/refs{/sha}","trees_url":"https://api.github.com/repos/openSUSE/zypper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openSUSE/zypper/statuses/{sha}","languages_url":"https://api.github.com/repos/openSUSE/zypper/languages","stargazers_url":"https://api.github.com/repos/openSUSE/zypper/stargazers","contributors_url":"https://api.github.com/repos/openSUSE/zypper/contributors","subscribers_url":"https://api.github.com/repos/openSUSE/zypper/subscribers","subscription_url":"https://api.github.com/repos/openSUSE/zypper/subscription","commits_url":"https://api.github.com/repos/openSUSE/zypper/commits{/sha}","git_commits_url":"https://api.github.com/repos/openSUSE/zypper/git/commits{/sha}","comments_url":"https://api.github.com/repos/openSUSE/zypper/comments{/number}","issue_comment_url":"https://api.github.com/repos/openSUSE/zypper/issues/comments{/number}","contents_url":"https://api.github.com/repos/openSUSE/zypper/contents/{+path}","compare_url":"https://api.github.com/repos/openSUSE/zypper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openSUSE/zypper/merges","archive_url":"https://api.github.com/repos/openSUSE/zypper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openSUSE/zypper/downloads","issues_url":"https://api.github.com/repos/openSUSE/zypper/issues{/number}","pulls_url":"https://api.github.com/repos/openSUSE/zypper/pulls{/number}","milestones_url":"https://api.github.com/repos/openSUSE/zypper/milestones{/number}","notifications_url":"https://api.github.com/repos/openSUSE/zypper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openSUSE/zypper/labels{/name}","releases_url":"https://api.github.com/repos/openSUSE/zypper/releases{/id}","deployments_url":"https://api.github.com/repos/openSUSE/zypper/deployments","created_at":"2011-07-29T10:21:40Z","updated_at":"2018-08-27T09:13:17Z","pushed_at":"2018-08-27T09:50:14Z","git_url":"git://github.com/openSUSE/zypper.git","ssh_url":"git@github.com:openSUSE/zypper.git","clone_url":"https://github.com/openSUSE/zypper.git","svn_url":"https://github.com/openSUSE/zypper","homepage":"http://en.opensuse.org/Portal:Zypper","size":448286,"stargazers_count":122,"watchers_count":122,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":50,"mirror_url":null,"archived":false,"open_issues_count":44,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":50,"open_issues":44,"watchers":122,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openSUSE/zypper/pulls/201"},"html":{"href":"https://github.com/openSUSE/zypper/pull/201"},"issue":{"href":"https://api.github.com/repos/openSUSE/zypper/issues/201"},"comments":{"href":"https://api.github.com/repos/openSUSE/zypper/issues/201/comments"},"review_comments":{"href":"https://api.github.com/repos/openSUSE/zypper/pulls/201/comments"},"review_comment":{"href":"https://api.github.com/repos/openSUSE/zypper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openSUSE/zypper/pulls/201/commits"},"statuses":{"href":"https://api.github.com/repos/openSUSE/zypper/statuses/2d1a88915b52f855d8586845ea3ae0b08290aef7"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bzeller"}}