{"action":"created","comment":{"url":"https://api.github.com/repos/TheTorProject/lepidopter/pulls/comments/65101107","id":65101107,"diff_hunk":"@@ -1,33 +1,53 @@\n #!/bin/bash\n+set -e\n \n source lepidopter-fh/etc/default/lepidopter\n source conf/lepidopter-image.conf\n \n-# Set preferred compression method. currently zip and xz supported\n-compression_method=( zip xz )\n image_file=\"lepidopter-${LEPIDOPTER_BUILD}-${ARCH}.img\"\n \n function usage() {\n     echo \"usage: setup.sh [options]\"\n     echo \"with no options the script installs the dependencies and builds\" \\\n             \"lepidopter image\"\n-    echo \"-c, --compress compress lepidopter image\"\n+    echo \"-c compress lepidopter image with xz or zip compression (eg. -c xz)\"\n+    echo \"-t create a torrent file of the image and the digests\"\n }\n \n-while [ $# -ne 0 ]; do\n-    case $1 in\n-        -c | --compress)        shift\n-                                compression=1\n-                                ;;\n-        -h | --help )           usage\n-                                exit\n-                                ;;\n-        * )                     usage\n-                                exit 1\n+while getopts \"c:ht\" opt; do\n+    case $opt in\n+      c)\n+        compression_method+=(\"$OPTARG\")\n+        ;;\n+      t)\n+        build_torrent=true\n+        ;;\n+      h)\n+        usage\n+        exit 1\n+        ;;\n+     \\?)\n+        echo \"Invalid option: -$OPTARG\" >&2\n+        usage\n+        exit 1\n+        ;;\n+      :)\n+        echo \"Option -$OPTARG requires an argument.\" >&2\n+        usage\n+        exit 1\n     esac\n-    shift\n done\n \n+# Create a torrent of the xz image file\n+mk_torrent() {\n+apt-get install -y mktorrent bittornado\n+cd images && \\\n+mktorrent -a 'udp://tracker.torrent.eu.org:451' \\\n+          -a 'udp://tracker.coppersurfer.tk:6969' \\\n+          -n ${image_file:-4} SHA* ${image_file}.xz","path":"scripts/setup.sh","position":61,"original_position":61,"commit_id":"58bad168dab342af75d3f8b0088a96c0dd954719","original_commit_id":"84b481472fbb33cba015c608723b536fb7497f96","user":{"login":"anadahz","id":4969544,"avatar_url":"https://avatars.githubusercontent.com/u/4969544?v=3","gravatar_id":"","url":"https://api.github.com/users/anadahz","html_url":"https://github.com/anadahz","followers_url":"https://api.github.com/users/anadahz/followers","following_url":"https://api.github.com/users/anadahz/following{/other_user}","gists_url":"https://api.github.com/users/anadahz/gists{/gist_id}","starred_url":"https://api.github.com/users/anadahz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anadahz/subscriptions","organizations_url":"https://api.github.com/users/anadahz/orgs","repos_url":"https://api.github.com/users/anadahz/repos","events_url":"https://api.github.com/users/anadahz/events{/privacy}","received_events_url":"https://api.github.com/users/anadahz/received_events","type":"User","site_admin":false},"body":"@bassosimone No it will not and this is expected since a user may run the build script to compress the image and at another point create a torrent file.\r\nMost of these options are relevant to the maintainer of the Lepidopter release as it's not of any benefit to a user i.e to create a torrent of the Lepidopter image.","created_at":"2016-05-30T19:26:18Z","updated_at":"2016-05-30T19:26:18Z","html_url":"https://github.com/TheTorProject/lepidopter/pull/33#discussion_r65101107","pull_request_url":"https://api.github.com/repos/TheTorProject/lepidopter/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/TheTorProject/lepidopter/pulls/comments/65101107"},"html":{"href":"https://github.com/TheTorProject/lepidopter/pull/33#discussion_r65101107"},"pull_request":{"href":"https://api.github.com/repos/TheTorProject/lepidopter/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/TheTorProject/lepidopter/pulls/33","id":71853778,"html_url":"https://github.com/TheTorProject/lepidopter/pull/33","diff_url":"https://github.com/TheTorProject/lepidopter/pull/33.diff","patch_url":"https://github.com/TheTorProject/lepidopter/pull/33.patch","issue_url":"https://api.github.com/repos/TheTorProject/lepidopter/issues/33","number":33,"state":"open","locked":false,"title":"Add support for torrent, support multiple options","user":{"login":"anadahz","id":4969544,"avatar_url":"https://avatars.githubusercontent.com/u/4969544?v=3","gravatar_id":"","url":"https://api.github.com/users/anadahz","html_url":"https://github.com/anadahz","followers_url":"https://api.github.com/users/anadahz/followers","following_url":"https://api.github.com/users/anadahz/following{/other_user}","gists_url":"https://api.github.com/users/anadahz/gists{/gist_id}","starred_url":"https://api.github.com/users/anadahz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anadahz/subscriptions","organizations_url":"https://api.github.com/users/anadahz/orgs","repos_url":"https://api.github.com/users/anadahz/repos","events_url":"https://api.github.com/users/anadahz/events{/privacy}","received_events_url":"https://api.github.com/users/anadahz/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-30T05:20:56Z","updated_at":"2016-05-30T19:26:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c5b740840532915e93b91cc7c59b68b10eab5ab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TheTorProject/lepidopter/pulls/33/commits","review_comments_url":"https://api.github.com/repos/TheTorProject/lepidopter/pulls/33/comments","review_comment_url":"https://api.github.com/repos/TheTorProject/lepidopter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TheTorProject/lepidopter/issues/33/comments","statuses_url":"https://api.github.com/repos/TheTorProject/lepidopter/statuses/58bad168dab342af75d3f8b0088a96c0dd954719","head":{"label":"TheTorProject:feature/mktorrent","ref":"feature/mktorrent","sha":"58bad168dab342af75d3f8b0088a96c0dd954719","user":{"login":"TheTorProject","id":3301912,"avatar_url":"https://avatars.githubusercontent.com/u/3301912?v=3","gravatar_id":"","url":"https://api.github.com/users/TheTorProject","html_url":"https://github.com/TheTorProject","followers_url":"https://api.github.com/users/TheTorProject/followers","following_url":"https://api.github.com/users/TheTorProject/following{/other_user}","gists_url":"https://api.github.com/users/TheTorProject/gists{/gist_id}","starred_url":"https://api.github.com/users/TheTorProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheTorProject/subscriptions","organizations_url":"https://api.github.com/users/TheTorProject/orgs","repos_url":"https://api.github.com/users/TheTorProject/repos","events_url":"https://api.github.com/users/TheTorProject/events{/privacy}","received_events_url":"https://api.github.com/users/TheTorProject/received_events","type":"Organization","site_admin":false},"repo":{"id":19427255,"name":"lepidopter","full_name":"TheTorProject/lepidopter","owner":{"login":"TheTorProject","id":3301912,"avatar_url":"https://avatars.githubusercontent.com/u/3301912?v=3","gravatar_id":"","url":"https://api.github.com/users/TheTorProject","html_url":"https://github.com/TheTorProject","followers_url":"https://api.github.com/users/TheTorProject/followers","following_url":"https://api.github.com/users/TheTorProject/following{/other_user}","gists_url":"https://api.github.com/users/TheTorProject/gists{/gist_id}","starred_url":"https://api.github.com/users/TheTorProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheTorProject/subscriptions","organizations_url":"https://api.github.com/users/TheTorProject/orgs","repos_url":"https://api.github.com/users/TheTorProject/repos","events_url":"https://api.github.com/users/TheTorProject/events{/privacy}","received_events_url":"https://api.github.com/users/TheTorProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TheTorProject/lepidopter","description":"lepidopter: raspberry pi image for conducting OONI network measurements","fork":false,"url":"https://api.github.com/repos/TheTorProject/lepidopter","forks_url":"https://api.github.com/repos/TheTorProject/lepidopter/forks","keys_url":"https://api.github.com/repos/TheTorProject/lepidopter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TheTorProject/lepidopter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TheTorProject/lepidopter/teams","hooks_url":"https://api.github.com/repos/TheTorProject/lepidopter/hooks","issue_events_url":"https://api.github.com/repos/TheTorProject/lepidopter/issues/events{/number}","events_url":"https://api.github.com/repos/TheTorProject/lepidopter/events","assignees_url":"https://api.github.com/repos/TheTorProject/lepidopter/assignees{/user}","branches_url":"https://api.github.com/repos/TheTorProject/lepidopter/branches{/branch}","tags_url":"https://api.github.com/repos/TheTorProject/lepidopter/tags","blobs_url":"https://api.github.com/repos/TheTorProject/lepidopter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TheTorProject/lepidopter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TheTorProject/lepidopter/git/refs{/sha}","trees_url":"https://api.github.com/repos/TheTorProject/lepidopter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TheTorProject/lepidopter/statuses/{sha}","languages_url":"https://api.github.com/repos/TheTorProject/lepidopter/languages","stargazers_url":"https://api.github.com/repos/TheTorProject/lepidopter/stargazers","contributors_url":"https://api.github.com/repos/TheTorProject/lepidopter/contributors","subscribers_url":"https://api.github.com/repos/TheTorProject/lepidopter/subscribers","subscription_url":"https://api.github.com/repos/TheTorProject/lepidopter/subscription","commits_url":"https://api.github.com/repos/TheTorProject/lepidopter/commits{/sha}","git_commits_url":"https://api.github.com/repos/TheTorProject/lepidopter/git/commits{/sha}","comments_url":"https://api.github.com/repos/TheTorProject/lepidopter/comments{/number}","issue_comment_url":"https://api.github.com/repos/TheTorProject/lepidopter/issues/comments{/number}","contents_url":"https://api.github.com/repos/TheTorProject/lepidopter/contents/{+path}","compare_url":"https://api.github.com/repos/TheTorProject/lepidopter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TheTorProject/lepidopter/merges","archive_url":"https://api.github.com/repos/TheTorProject/lepidopter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TheTorProject/lepidopter/downloads","issues_url":"https://api.github.com/repos/TheTorProject/lepidopter/issues{/number}","pulls_url":"https://api.github.com/repos/TheTorProject/lepidopter/pulls{/number}","milestones_url":"https://api.github.com/repos/TheTorProject/lepidopter/milestones{/number}","notifications_url":"https://api.github.com/repos/TheTorProject/lepidopter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TheTorProject/lepidopter/labels{/name}","releases_url":"https://api.github.com/repos/TheTorProject/lepidopter/releases{/id}","deployments_url":"https://api.github.com/repos/TheTorProject/lepidopter/deployments","created_at":"2014-05-04T13:40:26Z","updated_at":"2016-04-12T14:49:46Z","pushed_at":"2016-05-30T14:43:32Z","git_url":"git://github.com/TheTorProject/lepidopter.git","ssh_url":"git@github.com:TheTorProject/lepidopter.git","clone_url":"https://github.com/TheTorProject/lepidopter.git","svn_url":"https://github.com/TheTorProject/lepidopter","homepage":"https://ooni.torproject.org/","size":129,"stargazers_count":15,"watchers_count":15,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":15,"default_branch":"master"}},"base":{"label":"TheTorProject:master","ref":"master","sha":"5cb8b2eb76769ec8f6725a71329030f9f00d7442","user":{"login":"TheTorProject","id":3301912,"avatar_url":"https://avatars.githubusercontent.com/u/3301912?v=3","gravatar_id":"","url":"https://api.github.com/users/TheTorProject","html_url":"https://github.com/TheTorProject","followers_url":"https://api.github.com/users/TheTorProject/followers","following_url":"https://api.github.com/users/TheTorProject/following{/other_user}","gists_url":"https://api.github.com/users/TheTorProject/gists{/gist_id}","starred_url":"https://api.github.com/users/TheTorProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheTorProject/subscriptions","organizations_url":"https://api.github.com/users/TheTorProject/orgs","repos_url":"https://api.github.com/users/TheTorProject/repos","events_url":"https://api.github.com/users/TheTorProject/events{/privacy}","received_events_url":"https://api.github.com/users/TheTorProject/received_events","type":"Organization","site_admin":false},"repo":{"id":19427255,"name":"lepidopter","full_name":"TheTorProject/lepidopter","owner":{"login":"TheTorProject","id":3301912,"avatar_url":"https://avatars.githubusercontent.com/u/3301912?v=3","gravatar_id":"","url":"https://api.github.com/users/TheTorProject","html_url":"https://github.com/TheTorProject","followers_url":"https://api.github.com/users/TheTorProject/followers","following_url":"https://api.github.com/users/TheTorProject/following{/other_user}","gists_url":"https://api.github.com/users/TheTorProject/gists{/gist_id}","starred_url":"https://api.github.com/users/TheTorProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheTorProject/subscriptions","organizations_url":"https://api.github.com/users/TheTorProject/orgs","repos_url":"https://api.github.com/users/TheTorProject/repos","events_url":"https://api.github.com/users/TheTorProject/events{/privacy}","received_events_url":"https://api.github.com/users/TheTorProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TheTorProject/lepidopter","description":"lepidopter: raspberry pi image for conducting OONI network measurements","fork":false,"url":"https://api.github.com/repos/TheTorProject/lepidopter","forks_url":"https://api.github.com/repos/TheTorProject/lepidopter/forks","keys_url":"https://api.github.com/repos/TheTorProject/lepidopter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TheTorProject/lepidopter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TheTorProject/lepidopter/teams","hooks_url":"https://api.github.com/repos/TheTorProject/lepidopter/hooks","issue_events_url":"https://api.github.com/repos/TheTorProject/lepidopter/issues/events{/number}","events_url":"https://api.github.com/repos/TheTorProject/lepidopter/events","assignees_url":"https://api.github.com/repos/TheTorProject/lepidopter/assignees{/user}","branches_url":"https://api.github.com/repos/TheTorProject/lepidopter/branches{/branch}","tags_url":"https://api.github.com/repos/TheTorProject/lepidopter/tags","blobs_url":"https://api.github.com/repos/TheTorProject/lepidopter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TheTorProject/lepidopter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TheTorProject/lepidopter/git/refs{/sha}","trees_url":"https://api.github.com/repos/TheTorProject/lepidopter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TheTorProject/lepidopter/statuses/{sha}","languages_url":"https://api.github.com/repos/TheTorProject/lepidopter/languages","stargazers_url":"https://api.github.com/repos/TheTorProject/lepidopter/stargazers","contributors_url":"https://api.github.com/repos/TheTorProject/lepidopter/contributors","subscribers_url":"https://api.github.com/repos/TheTorProject/lepidopter/subscribers","subscription_url":"https://api.github.com/repos/TheTorProject/lepidopter/subscription","commits_url":"https://api.github.com/repos/TheTorProject/lepidopter/commits{/sha}","git_commits_url":"https://api.github.com/repos/TheTorProject/lepidopter/git/commits{/sha}","comments_url":"https://api.github.com/repos/TheTorProject/lepidopter/comments{/number}","issue_comment_url":"https://api.github.com/repos/TheTorProject/lepidopter/issues/comments{/number}","contents_url":"https://api.github.com/repos/TheTorProject/lepidopter/contents/{+path}","compare_url":"https://api.github.com/repos/TheTorProject/lepidopter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TheTorProject/lepidopter/merges","archive_url":"https://api.github.com/repos/TheTorProject/lepidopter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TheTorProject/lepidopter/downloads","issues_url":"https://api.github.com/repos/TheTorProject/lepidopter/issues{/number}","pulls_url":"https://api.github.com/repos/TheTorProject/lepidopter/pulls{/number}","milestones_url":"https://api.github.com/repos/TheTorProject/lepidopter/milestones{/number}","notifications_url":"https://api.github.com/repos/TheTorProject/lepidopter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TheTorProject/lepidopter/labels{/name}","releases_url":"https://api.github.com/repos/TheTorProject/lepidopter/releases{/id}","deployments_url":"https://api.github.com/repos/TheTorProject/lepidopter/deployments","created_at":"2014-05-04T13:40:26Z","updated_at":"2016-04-12T14:49:46Z","pushed_at":"2016-05-30T14:43:32Z","git_url":"git://github.com/TheTorProject/lepidopter.git","ssh_url":"git@github.com:TheTorProject/lepidopter.git","clone_url":"https://github.com/TheTorProject/lepidopter.git","svn_url":"https://github.com/TheTorProject/lepidopter","homepage":"https://ooni.torproject.org/","size":129,"stargazers_count":15,"watchers_count":15,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TheTorProject/lepidopter/pulls/33"},"html":{"href":"https://github.com/TheTorProject/lepidopter/pull/33"},"issue":{"href":"https://api.github.com/repos/TheTorProject/lepidopter/issues/33"},"comments":{"href":"https://api.github.com/repos/TheTorProject/lepidopter/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/TheTorProject/lepidopter/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/TheTorProject/lepidopter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TheTorProject/lepidopter/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/TheTorProject/lepidopter/statuses/58bad168dab342af75d3f8b0088a96c0dd954719"}}}}
{"actor":{"display_login":"anadahz"}}