{"action":"created","comment":{"url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/pulls/comments/79307822","id":79307822,"diff_hunk":"@@ -84,59 +91,185 @@ check_status()\n   fi\n }\n \n-CURRENTPATH=`pwd`\n-DEVELOPER=`xcode-select -print-path`\n-IOS_MIN_SDK_VERSION=\"7.0\"\n-TVOS_MIN_SDK_VERSION=\"9.0\"\n-LOG_VERBOSE=\"$1\" # Options: verbose (full output) or verbose-on-error (echo last 500 logged lines when error occurs)\n+# Init optional command line vars\n+ARCHS=\"\"\n+CONFIG_ENABLE_EC_NISTP_64_GCC_128=\"\"\n+IOS_SDKVERSION=\"\"\n+PARALLEL=\"\"\n+LOG_VERBOSE=\"\"\n+TVOS_SDKVERSION=\"\"\n+VERSION=\"\"\n+\n+# Process command line arguments\n+for i in \"$@\"\n+do\n+case $i in\n+  --archs=*)\n+    ARCHS=\"${i#*=}\"\n+    shift\n+    ;;\n+  --ec-nistp-64-gcc-128)\n+    CONFIG_ENABLE_EC_NISTP_64_GCC_128=\"true\"\n+    ;;\n+  -h|--help)\n+    echo_help\n+    exit\n+    ;;\n+  --ios-sdk=*)\n+    IOS_SDKVERSION=\"${i#*=}\"\n+    shift\n+    ;;\n+  --noparallel)\n+    PARALLEL=\"false\"\n+    shift\n+    ;;\n+  --tvos-sdk=*)\n+    TVOS_SDKVERSION=\"${i#*=}\"\n+    shift\n+    ;;\n+  -v|--verbose)\n+    LOG_VERBOSE=\"verbose\"\n+    ;;\n+  --verbose-on-error)\n+    LOG_VERBOSE=\"verbose-on-error\"\n+    ;;\n+  --version=*)\n+    VERSION=\"${i#*=}\"\n+    shift\n+    ;;\n+  *)\n+    echo \"Unknown argument: ${i}\"\n+    ;;\n+esac\n+done\n+\n+# Preprocess/validate OpenSSL version\n+if [ -n \"${VERSION}\" ]; then\n+  # Verify version number format. Expected: dot notation\n+  if [[ ! \"${VERSION}\" =~ ^[0-9]+\\.[0-9]+\\.[0-9]+[a-z]*$ ]]; then\n+    echo \"Unknown version number format. Examples: 1.0.2, 1.0.2h\"\n+    exit 1\n+  fi\n+\n+# Default OpenSSL version\n+else\n+  # Default branch or user provided (in latter case verify number format)\n+  # For future use (when adding 1.1.0), so the user can select a default branch\n+  BRANCH=\"${DEFAULTBRANCH}\"\n+\n+  # Determine latest version of selected branch\n+  echo \"Checking latest version of ${BRANCH} branch on GitHub...\"\n+  GITHUB_VERSION=$(curl ${CURL_OPTIONS} -Ls https://github.com/openssl/openssl/releases.atom | grep \"<title>OpenSSL_${BRANCH//./_}\" | head -1 | sed -E \"s|^.*title>OpenSSL_(${BRANCH//./_}[a-z]*)</title.*$|\\1|g\")\n+\n+  # Verify result\n+  if [ -z \"${GITHUB_VERSION}\" ]; then\n+    echo \"Could not determine latest version, please check https://github.com/openssl/openssl/releases and use --version option\"\n+    exit 1\n+  fi\n+\n+  VERSION=\"${GITHUB_VERSION//_/.}\"\n+fi\n+\n+# Set GITHUB_VERSION (version with underscores instead of dots)\n+GITHUB_VERSION=\"${VERSION//./_}\"\n+\n+# Determine SDK versions\n+if [ ! -n \"${IOS_SDKVERSION}\" ]; then\n+  IOS_SDKVERSION=$(xcrun -sdk iphoneos --show-sdk-version)\n+fi\n+if [ ! -n \"${TVOS_SDKVERSION}\" ]; then\n+  TVOS_SDKVERSION=$(xcrun -sdk appletvos --show-sdk-version)\n+fi\n+\n+# Set default for ARCHS if not specified\n+if [ ! -n \"${ARCHS}\" ]; then\n+  ARCHS=\"x86_64 i386 arm64 armv7s armv7 tv_x86_64 tv_arm64\"\n+fi\n \n # Determine number of cores for (parallel) build\n BUILD_THREADS=1\n if [ \"${PARALLEL}\" != \"false\" ]; then\n   BUILD_THREADS=$(sysctl hw.ncpu | awk '{print $2}')\n fi\n \n-if [ ! -d \"$DEVELOPER\" ]; then\n-  echo \"xcode path is not set correctly $DEVELOPER does not exist\"\n+# Write files relative to script location and validate directory\n+CURRENTPATH=$(cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd)\n+case \"${CURRENTPATH}\" in\n+  *\\ * )\n+    echo \"Your path contains whitespaces, which is not supported by 'make install'.\"\n+    exit 1\n+  ;;\n+esac\n+if [[ \"${CURRENTPATH}\" == \"/\" || \"${CURRENTPATH}\" == \"/usr\" || \"${CURRENTPATH}\" == \"/usr/local\" ]]; then","path":"build-libssl.sh","position":184,"original_position":184,"commit_id":"98738414bb8ecdc9e1484214bf38986aa0075757","original_commit_id":"98738414bb8ecdc9e1484214bf38986aa0075757","user":{"login":"oneton","id":13542481,"avatar_url":"https://avatars.githubusercontent.com/u/13542481?v=3","gravatar_id":"","url":"https://api.github.com/users/oneton","html_url":"https://github.com/oneton","followers_url":"https://api.github.com/users/oneton/followers","following_url":"https://api.github.com/users/oneton/following{/other_user}","gists_url":"https://api.github.com/users/oneton/gists{/gist_id}","starred_url":"https://api.github.com/users/oneton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oneton/subscriptions","organizations_url":"https://api.github.com/users/oneton/orgs","repos_url":"https://api.github.com/users/oneton/repos","events_url":"https://api.github.com/users/oneton/events{/privacy}","received_events_url":"https://api.github.com/users/oneton/received_events","type":"User","site_admin":false},"body":"Maybe I'm a little paranoid here, since no-one should run this script from such directories and/or with root rights.\r\nBut... a little later on, I'm cleaning up directories with very generic names (bin, lib, src). I don't want to be the guy that broke someone's OS.","created_at":"2016-09-18T15:04:44Z","updated_at":"2016-09-18T15:04:44Z","html_url":"https://github.com/x2on/OpenSSL-for-iPhone/pull/116#discussion_r79307822","pull_request_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/pulls/116","_links":{"self":{"href":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/pulls/comments/79307822"},"html":{"href":"https://github.com/x2on/OpenSSL-for-iPhone/pull/116#discussion_r79307822"},"pull_request":{"href":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/pulls/116"}}},"pull_request":{"url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/pulls/116","id":85711570,"html_url":"https://github.com/x2on/OpenSSL-for-iPhone/pull/116","diff_url":"https://github.com/x2on/OpenSSL-for-iPhone/pull/116.diff","patch_url":"https://github.com/x2on/OpenSSL-for-iPhone/pull/116.patch","issue_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/issues/116","number":116,"state":"open","locked":false,"title":"Specify build configuration with command line parameters","user":{"login":"oneton","id":13542481,"avatar_url":"https://avatars.githubusercontent.com/u/13542481?v=3","gravatar_id":"","url":"https://api.github.com/users/oneton","html_url":"https://github.com/oneton","followers_url":"https://api.github.com/users/oneton/followers","following_url":"https://api.github.com/users/oneton/following{/other_user}","gists_url":"https://api.github.com/users/oneton/gists{/gist_id}","starred_url":"https://api.github.com/users/oneton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oneton/subscriptions","organizations_url":"https://api.github.com/users/oneton/orgs","repos_url":"https://api.github.com/users/oneton/repos","events_url":"https://api.github.com/users/oneton/events{/privacy}","received_events_url":"https://api.github.com/users/oneton/received_events","type":"User","site_admin":false},"body":"- Added help message\r\n- Command line arguments processing\r\n- Retrieve latest version from 1.0.2 branch in case no version is specified\r\n- Use script location as working dir\r\n- Add summary of build options\r\n- Clean up directories before build\r\n\r\nAlso updated Travis config to run make with single job.\r\n\r\nWhen no version number is provided, the script will now automatically build the latest version in the 1.0.2 branch.","created_at":"2016-09-18T14:21:41Z","updated_at":"2016-09-18T15:04:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f5903af18040ad464181b919bbaf402e35376a64","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/pulls/116/commits","review_comments_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/pulls/116/comments","review_comment_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/pulls/comments{/number}","comments_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/issues/116/comments","statuses_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/statuses/98738414bb8ecdc9e1484214bf38986aa0075757","head":{"label":"oneton:1.0.2-command-line","ref":"1.0.2-command-line","sha":"98738414bb8ecdc9e1484214bf38986aa0075757","user":{"login":"oneton","id":13542481,"avatar_url":"https://avatars.githubusercontent.com/u/13542481?v=3","gravatar_id":"","url":"https://api.github.com/users/oneton","html_url":"https://github.com/oneton","followers_url":"https://api.github.com/users/oneton/followers","following_url":"https://api.github.com/users/oneton/following{/other_user}","gists_url":"https://api.github.com/users/oneton/gists{/gist_id}","starred_url":"https://api.github.com/users/oneton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oneton/subscriptions","organizations_url":"https://api.github.com/users/oneton/orgs","repos_url":"https://api.github.com/users/oneton/repos","events_url":"https://api.github.com/users/oneton/events{/privacy}","received_events_url":"https://api.github.com/users/oneton/received_events","type":"User","site_admin":false},"repo":{"id":56987683,"name":"OpenSSL-for-iPhone","full_name":"oneton/OpenSSL-for-iPhone","owner":{"login":"oneton","id":13542481,"avatar_url":"https://avatars.githubusercontent.com/u/13542481?v=3","gravatar_id":"","url":"https://api.github.com/users/oneton","html_url":"https://github.com/oneton","followers_url":"https://api.github.com/users/oneton/followers","following_url":"https://api.github.com/users/oneton/following{/other_user}","gists_url":"https://api.github.com/users/oneton/gists{/gist_id}","starred_url":"https://api.github.com/users/oneton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oneton/subscriptions","organizations_url":"https://api.github.com/users/oneton/orgs","repos_url":"https://api.github.com/users/oneton/repos","events_url":"https://api.github.com/users/oneton/events{/privacy}","received_events_url":"https://api.github.com/users/oneton/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oneton/OpenSSL-for-iPhone","description":"A script for compiling OpenSSL 1.1.0 for iOS Devices (iPhone, iPad, iPod Touch, AppleTV)","fork":true,"url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone","forks_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/forks","keys_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/teams","hooks_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/hooks","issue_events_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/issues/events{/number}","events_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/events","assignees_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/assignees{/user}","branches_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/branches{/branch}","tags_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/tags","blobs_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/git/refs{/sha}","trees_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/statuses/{sha}","languages_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/languages","stargazers_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/stargazers","contributors_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/contributors","subscribers_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/subscribers","subscription_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/subscription","commits_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/commits{/sha}","git_commits_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/git/commits{/sha}","comments_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/comments{/number}","issue_comment_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/issues/comments{/number}","contents_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/contents/{+path}","compare_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/merges","archive_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/downloads","issues_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/issues{/number}","pulls_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/pulls{/number}","milestones_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/milestones{/number}","notifications_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/labels{/name}","releases_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/releases{/id}","deployments_url":"https://api.github.com/repos/oneton/OpenSSL-for-iPhone/deployments","created_at":"2016-04-24T18:31:02Z","updated_at":"2016-04-24T18:47:45Z","pushed_at":"2016-09-18T14:15:51Z","git_url":"git://github.com/oneton/OpenSSL-for-iPhone.git","ssh_url":"git@github.com:oneton/OpenSSL-for-iPhone.git","clone_url":"https://github.com/oneton/OpenSSL-for-iPhone.git","svn_url":"https://github.com/oneton/OpenSSL-for-iPhone","homepage":"http://www.x2on.de","size":7349,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"x2on:master","ref":"master","sha":"24500d89b9619882c1ab1b0e6ccbd5771690b9b6","user":{"login":"x2on","id":195724,"avatar_url":"https://avatars.githubusercontent.com/u/195724?v=3","gravatar_id":"","url":"https://api.github.com/users/x2on","html_url":"https://github.com/x2on","followers_url":"https://api.github.com/users/x2on/followers","following_url":"https://api.github.com/users/x2on/following{/other_user}","gists_url":"https://api.github.com/users/x2on/gists{/gist_id}","starred_url":"https://api.github.com/users/x2on/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/x2on/subscriptions","organizations_url":"https://api.github.com/users/x2on/orgs","repos_url":"https://api.github.com/users/x2on/repos","events_url":"https://api.github.com/users/x2on/events{/privacy}","received_events_url":"https://api.github.com/users/x2on/received_events","type":"User","site_admin":false},"repo":{"id":502238,"name":"OpenSSL-for-iPhone","full_name":"x2on/OpenSSL-for-iPhone","owner":{"login":"x2on","id":195724,"avatar_url":"https://avatars.githubusercontent.com/u/195724?v=3","gravatar_id":"","url":"https://api.github.com/users/x2on","html_url":"https://github.com/x2on","followers_url":"https://api.github.com/users/x2on/followers","following_url":"https://api.github.com/users/x2on/following{/other_user}","gists_url":"https://api.github.com/users/x2on/gists{/gist_id}","starred_url":"https://api.github.com/users/x2on/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/x2on/subscriptions","organizations_url":"https://api.github.com/users/x2on/orgs","repos_url":"https://api.github.com/users/x2on/repos","events_url":"https://api.github.com/users/x2on/events{/privacy}","received_events_url":"https://api.github.com/users/x2on/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/x2on/OpenSSL-for-iPhone","description":"A script for compiling OpenSSL for iOS Devices (iPhone, iPad, iPod Touch, AppleTV)","fork":false,"url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone","forks_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/forks","keys_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/teams","hooks_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/hooks","issue_events_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/issues/events{/number}","events_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/events","assignees_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/assignees{/user}","branches_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/branches{/branch}","tags_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/tags","blobs_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/git/refs{/sha}","trees_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/statuses/{sha}","languages_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/languages","stargazers_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/stargazers","contributors_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/contributors","subscribers_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/subscribers","subscription_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/subscription","commits_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/commits{/sha}","git_commits_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/git/commits{/sha}","comments_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/comments{/number}","issue_comment_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/issues/comments{/number}","contents_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/contents/{+path}","compare_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/merges","archive_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/downloads","issues_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/issues{/number}","pulls_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/pulls{/number}","milestones_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/milestones{/number}","notifications_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/labels{/name}","releases_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/releases{/id}","deployments_url":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/deployments","created_at":"2010-02-04T13:57:05Z","updated_at":"2016-09-18T05:15:37Z","pushed_at":"2016-09-18T14:21:41Z","git_url":"git://github.com/x2on/OpenSSL-for-iPhone.git","ssh_url":"git@github.com:x2on/OpenSSL-for-iPhone.git","clone_url":"https://github.com/x2on/OpenSSL-for-iPhone.git","svn_url":"https://github.com/x2on/OpenSSL-for-iPhone","homepage":"http://www.x2on.de","size":7437,"stargazers_count":1123,"watchers_count":1123,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":375,"mirror_url":null,"open_issues_count":3,"forks":375,"open_issues":3,"watchers":1123,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/pulls/116"},"html":{"href":"https://github.com/x2on/OpenSSL-for-iPhone/pull/116"},"issue":{"href":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/issues/116"},"comments":{"href":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/issues/116/comments"},"review_comments":{"href":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/pulls/116/comments"},"review_comment":{"href":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/pulls/116/commits"},"statuses":{"href":"https://api.github.com/repos/x2on/OpenSSL-for-iPhone/statuses/98738414bb8ecdc9e1484214bf38986aa0075757"}}}}
{"actor":{"display_login":"oneton"}}