{"action":"created","comment":{"url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/pulls/comments/74922507","id":74922507,"diff_hunk":"@@ -265,38 +275,29 @@ def _checkout_from_git_rootfs(directory, mx_version):\n     )\n \n \n-def fix_mono_config_and_get_env(dot_local_location, mono_lib_dir):\n+def _get_env_with_monolib(mono_lib_dir):\n     env = dict(os.environ)\n-    env['LD_LIBRARY_PATH'] = mono_lib_dir\n-\n-    if not os.path.isfile(os.path.join(mono_lib_dir, 'libgdiplus.so')):\n+    env['LD_LIBRARY_PATH'] = mono_lib_dir + '/lib'\n+    if not os.path.isfile(os.path.join(mono_lib_dir + '/lib/', 'libgdiplus.so')):\n         raise Exception('libgdiplus.so not found in dir %s' % mono_lib_dir)\n-\n-    subprocess.check_call([\n-        'sed',\n-        '-i',\n-        's|/app/vendor/mono/lib/libgdiplus.so|%s|g' % os.path.join(\n-            mono_lib_dir, 'libgdiplus.so'\n-        ),\n-        os.path.join(_get_mono_path(dot_local_location), 'etc/mono/config'),\n-    ])\n-    subprocess.check_call([\n-        'sed',\n-        '-i',\n-        's|/usr/lib/libMonoPosixHelper.so|%s|g' % os.path.join(\n-            mono_lib_dir, 'libMonoPosixHelper.so'\n-        ),\n-        os.path.join(_get_mono_path(dot_local_location), 'etc/mono/config'),\n-    ])\n     return env\n \n \n-def _get_mono_path(dot_local_location):\n+def _detect_mono_version():\n+    if os.environ.get('FORCED_MONO4_VERSION'):\n+        logging.warning('Using forced mono version')\n+        target = 'mono-4.4.1.0'\n+    else:\n+        target = 'mono-3.10.0'\n+    logging.info('Selecting Mono Runtime: ' + target)\n+    return target\n+\n+\n+def _get_mono_path(directory, mono_version):\n     return get_existing_directory_or_raise([\n-        os.path.join(dot_local_location, 'mono'),\n-        '/opt/mono-3.10.0',\n-        '/usr/local/share/mono-3.10.0',\n-        '/tmp/mono',\n+        os.path.join(directory, mono_version),\n+        '/opt/' + mono_version,","path":"lib/buildpackutil.py","position":120,"original_position":120,"commit_id":"892514e6f4086820cf6b4cee8de58ecef1b0749c","original_commit_id":"892514e6f4086820cf6b4cee8de58ecef1b0749c","user":{"login":"djvdorp","id":827540,"avatar_url":"https://avatars.githubusercontent.com/u/827540?v=3","gravatar_id":"","url":"https://api.github.com/users/djvdorp","html_url":"https://github.com/djvdorp","followers_url":"https://api.github.com/users/djvdorp/followers","following_url":"https://api.github.com/users/djvdorp/following{/other_user}","gists_url":"https://api.github.com/users/djvdorp/gists{/gist_id}","starred_url":"https://api.github.com/users/djvdorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djvdorp/subscriptions","organizations_url":"https://api.github.com/users/djvdorp/orgs","repos_url":"https://api.github.com/users/djvdorp/repos","events_url":"https://api.github.com/users/djvdorp/events{/privacy}","received_events_url":"https://api.github.com/users/djvdorp/received_events","type":"User","site_admin":false},"body":"Why not also use `os.path.join` here, for this one and the next one?","created_at":"2016-08-16T12:16:47Z","updated_at":"2016-08-16T12:16:47Z","html_url":"https://github.com/mendix/cf-mendix-buildpack/pull/43#discussion_r74922507","pull_request_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/pulls/43","_links":{"self":{"href":"https://api.github.com/repos/mendix/cf-mendix-buildpack/pulls/comments/74922507"},"html":{"href":"https://github.com/mendix/cf-mendix-buildpack/pull/43#discussion_r74922507"},"pull_request":{"href":"https://api.github.com/repos/mendix/cf-mendix-buildpack/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/pulls/43","id":81120095,"html_url":"https://github.com/mendix/cf-mendix-buildpack/pull/43","diff_url":"https://github.com/mendix/cf-mendix-buildpack/pull/43.diff","patch_url":"https://github.com/mendix/cf-mendix-buildpack/pull/43.patch","issue_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/issues/43","number":43,"state":"open","locked":false,"title":"S864950 dual mono version support","user":{"login":"RaphaelAudet","id":1086433,"avatar_url":"https://avatars.githubusercontent.com/u/1086433?v=3","gravatar_id":"","url":"https://api.github.com/users/RaphaelAudet","html_url":"https://github.com/RaphaelAudet","followers_url":"https://api.github.com/users/RaphaelAudet/followers","following_url":"https://api.github.com/users/RaphaelAudet/following{/other_user}","gists_url":"https://api.github.com/users/RaphaelAudet/gists{/gist_id}","starred_url":"https://api.github.com/users/RaphaelAudet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaphaelAudet/subscriptions","organizations_url":"https://api.github.com/users/RaphaelAudet/orgs","repos_url":"https://api.github.com/users/RaphaelAudet/repos","events_url":"https://api.github.com/users/RaphaelAudet/events{/privacy}","received_events_url":"https://api.github.com/users/RaphaelAudet/received_events","type":"User","site_admin":false},"body":"Hello Dear Maintainers\r\n\r\nThis pull request will change behavior while looking for the mono package. It will look for mono 3 or mono 4 based on the environment variable **FORCED_MONO4_VERSION**\r\n```cf set-env application FORCED_MONO4_VERSION true```\r\nBy default, mono 3 will be used.\r\n\r\nIf mono is not found in expected location on the rootfs (/opt/mono-3.10.0 or /opt/mono-4.4.1.0), the buildpack will download the missing mono package from mendix cdn.\r\n\r\n The buildpack no longer updated the following libraries :\r\n- libMonoPosixHelper.so\r\n- libgdiplus.so\r\n- libgdiplus.so.0\r\n- libgdiplus.so.0.0.0\r\n- libgif.so.4\r\n- libgif.so.4.1\r\n- libgif.so.4.1.6\r\n\r\nThese packaged version of mono on mendix cdn have been patched. ","created_at":"2016-08-12T13:37:11Z","updated_at":"2016-08-16T12:16:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dea900dd79a21e1dcecfef7f124c8a80bae89cd6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/pulls/43/commits","review_comments_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/pulls/43/comments","review_comment_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/issues/43/comments","statuses_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/statuses/892514e6f4086820cf6b4cee8de58ecef1b0749c","head":{"label":"mendix:S864950_dual_mono_version_support","ref":"S864950_dual_mono_version_support","sha":"892514e6f4086820cf6b4cee8de58ecef1b0749c","user":{"login":"mendix","id":133443,"avatar_url":"https://avatars.githubusercontent.com/u/133443?v=3","gravatar_id":"","url":"https://api.github.com/users/mendix","html_url":"https://github.com/mendix","followers_url":"https://api.github.com/users/mendix/followers","following_url":"https://api.github.com/users/mendix/following{/other_user}","gists_url":"https://api.github.com/users/mendix/gists{/gist_id}","starred_url":"https://api.github.com/users/mendix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mendix/subscriptions","organizations_url":"https://api.github.com/users/mendix/orgs","repos_url":"https://api.github.com/users/mendix/repos","events_url":"https://api.github.com/users/mendix/events{/privacy}","received_events_url":"https://api.github.com/users/mendix/received_events","type":"Organization","site_admin":false},"repo":{"id":19174281,"name":"cf-mendix-buildpack","full_name":"mendix/cf-mendix-buildpack","owner":{"login":"mendix","id":133443,"avatar_url":"https://avatars.githubusercontent.com/u/133443?v=3","gravatar_id":"","url":"https://api.github.com/users/mendix","html_url":"https://github.com/mendix","followers_url":"https://api.github.com/users/mendix/followers","following_url":"https://api.github.com/users/mendix/following{/other_user}","gists_url":"https://api.github.com/users/mendix/gists{/gist_id}","starred_url":"https://api.github.com/users/mendix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mendix/subscriptions","organizations_url":"https://api.github.com/users/mendix/orgs","repos_url":"https://api.github.com/users/mendix/repos","events_url":"https://api.github.com/users/mendix/events{/privacy}","received_events_url":"https://api.github.com/users/mendix/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mendix/cf-mendix-buildpack","description":"Run Mendix in Cloud Foundry","fork":false,"url":"https://api.github.com/repos/mendix/cf-mendix-buildpack","forks_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/forks","keys_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/teams","hooks_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/hooks","issue_events_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/issues/events{/number}","events_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/events","assignees_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/assignees{/user}","branches_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/branches{/branch}","tags_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/tags","blobs_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/statuses/{sha}","languages_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/languages","stargazers_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/stargazers","contributors_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/contributors","subscribers_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/subscribers","subscription_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/subscription","commits_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/contents/{+path}","compare_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/merges","archive_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/downloads","issues_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/issues{/number}","pulls_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/pulls{/number}","milestones_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/milestones{/number}","notifications_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/labels{/name}","releases_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/releases{/id}","deployments_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/deployments","created_at":"2014-04-26T09:53:49Z","updated_at":"2016-07-17T13:10:36Z","pushed_at":"2016-08-12T13:37:11Z","git_url":"git://github.com/mendix/cf-mendix-buildpack.git","ssh_url":"git@github.com:mendix/cf-mendix-buildpack.git","clone_url":"https://github.com/mendix/cf-mendix-buildpack.git","svn_url":"https://github.com/mendix/cf-mendix-buildpack","homepage":"","size":22779,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":8,"default_branch":"master"}},"base":{"label":"mendix:master","ref":"master","sha":"c002a2e4a698068f3111aa6c3e9f907dbd0ffb04","user":{"login":"mendix","id":133443,"avatar_url":"https://avatars.githubusercontent.com/u/133443?v=3","gravatar_id":"","url":"https://api.github.com/users/mendix","html_url":"https://github.com/mendix","followers_url":"https://api.github.com/users/mendix/followers","following_url":"https://api.github.com/users/mendix/following{/other_user}","gists_url":"https://api.github.com/users/mendix/gists{/gist_id}","starred_url":"https://api.github.com/users/mendix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mendix/subscriptions","organizations_url":"https://api.github.com/users/mendix/orgs","repos_url":"https://api.github.com/users/mendix/repos","events_url":"https://api.github.com/users/mendix/events{/privacy}","received_events_url":"https://api.github.com/users/mendix/received_events","type":"Organization","site_admin":false},"repo":{"id":19174281,"name":"cf-mendix-buildpack","full_name":"mendix/cf-mendix-buildpack","owner":{"login":"mendix","id":133443,"avatar_url":"https://avatars.githubusercontent.com/u/133443?v=3","gravatar_id":"","url":"https://api.github.com/users/mendix","html_url":"https://github.com/mendix","followers_url":"https://api.github.com/users/mendix/followers","following_url":"https://api.github.com/users/mendix/following{/other_user}","gists_url":"https://api.github.com/users/mendix/gists{/gist_id}","starred_url":"https://api.github.com/users/mendix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mendix/subscriptions","organizations_url":"https://api.github.com/users/mendix/orgs","repos_url":"https://api.github.com/users/mendix/repos","events_url":"https://api.github.com/users/mendix/events{/privacy}","received_events_url":"https://api.github.com/users/mendix/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mendix/cf-mendix-buildpack","description":"Run Mendix in Cloud Foundry","fork":false,"url":"https://api.github.com/repos/mendix/cf-mendix-buildpack","forks_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/forks","keys_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/teams","hooks_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/hooks","issue_events_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/issues/events{/number}","events_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/events","assignees_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/assignees{/user}","branches_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/branches{/branch}","tags_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/tags","blobs_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/statuses/{sha}","languages_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/languages","stargazers_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/stargazers","contributors_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/contributors","subscribers_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/subscribers","subscription_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/subscription","commits_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/contents/{+path}","compare_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/merges","archive_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/downloads","issues_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/issues{/number}","pulls_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/pulls{/number}","milestones_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/milestones{/number}","notifications_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/labels{/name}","releases_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/releases{/id}","deployments_url":"https://api.github.com/repos/mendix/cf-mendix-buildpack/deployments","created_at":"2014-04-26T09:53:49Z","updated_at":"2016-07-17T13:10:36Z","pushed_at":"2016-08-12T13:37:11Z","git_url":"git://github.com/mendix/cf-mendix-buildpack.git","ssh_url":"git@github.com:mendix/cf-mendix-buildpack.git","clone_url":"https://github.com/mendix/cf-mendix-buildpack.git","svn_url":"https://github.com/mendix/cf-mendix-buildpack","homepage":"","size":22779,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mendix/cf-mendix-buildpack/pulls/43"},"html":{"href":"https://github.com/mendix/cf-mendix-buildpack/pull/43"},"issue":{"href":"https://api.github.com/repos/mendix/cf-mendix-buildpack/issues/43"},"comments":{"href":"https://api.github.com/repos/mendix/cf-mendix-buildpack/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/mendix/cf-mendix-buildpack/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/mendix/cf-mendix-buildpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mendix/cf-mendix-buildpack/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/mendix/cf-mendix-buildpack/statuses/892514e6f4086820cf6b4cee8de58ecef1b0749c"}}}}
{"actor":{"display_login":"djvdorp"}}