)]}'
{"install_rally.sh":[{"author":{"_account_id":7428,"name":"Yaroslav Lobankov","email":"lobankovyv@gmail.com","username":"ylobankov"},"change_message_id":"cb455ecde2ed9996d1eefd0e7e7c5316ad14c470","unresolved":false,"context_lines":[{"line_number":280,"context_line":"    local download_url\u003d$(echo \"${pkg_json}\"\\"},{"line_number":281,"context_line":"        | grep url\\\": | grep tar.gz | tail -1 | tr -d \\\"\\ ,\\ | cut -c 5-150)"},{"line_number":282,"context_line":"    if [ -n \"${download_url}\" ]; then"},{"line_number":283,"context_line":"\tdownload $(basename \"${download_url}\") \"${download_url}\""},{"line_number":284,"context_line":"    else"},{"line_number":285,"context_line":"        die ${EX_PROTOCOL} \"Package \u0027${pkg}\u0027 not found on PyPI!\" \u003c\u003c__EOF__"},{"line_number":286,"context_line":"Unable to download package \u0027${pkg}\u0027 from PyPI."}],"source_content_type":"text/x-sh","patch_set":1,"id":"1a122d0e_f50f62dd","line":283,"updated":"2016-04-29 15:34:26.000000000","message":"Could you please put 4 spaces here to make it like this?\n\n\n   if [ -n \"${download_url}\" ]; then\n       download $(basename \"${download_url}\") \"${download_url}\"","commit_id":"51dd0db379d2aad652f2f9d693b056fa23c62938"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"8ce820eb2538008c29badcd5ed229193f51e3bb8","unresolved":false,"context_lines":[{"line_number":280,"context_line":"    local download_url\u003d$(echo \"${pkg_json}\"\\"},{"line_number":281,"context_line":"        | grep url\\\": | grep tar.gz | tail -1 | tr -d \\\"\\ ,\\ | cut -c 5-150)"},{"line_number":282,"context_line":"    if [ -n \"${download_url}\" ]; then"},{"line_number":283,"context_line":"\tdownload $(basename \"${download_url}\") \"${download_url}\""},{"line_number":284,"context_line":"    else"},{"line_number":285,"context_line":"        die ${EX_PROTOCOL} \"Package \u0027${pkg}\u0027 not found on PyPI!\" \u003c\u003c__EOF__"},{"line_number":286,"context_line":"Unable to download package \u0027${pkg}\u0027 from PyPI."}],"source_content_type":"text/x-sh","patch_set":1,"id":"1a122d0e_d5efc684","line":283,"in_reply_to":"1a122d0e_f50f62dd","updated":"2016-04-29 15:40:26.000000000","message":"Done","commit_id":"51dd0db379d2aad652f2f9d693b056fa23c62938"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"16e896bc14a50f1bd43dbc63163d78c4e05ec359","unresolved":false,"context_lines":[{"line_number":278,"context_line":"    local pkg\u003d${1}"},{"line_number":279,"context_line":"    local pkg_json\u003d$(download - \"http://pypi.python.org/pypi/${pkg}/json/\")"},{"line_number":280,"context_line":"    local download_url\u003d$(echo \"${pkg_json}\"\\"},{"line_number":281,"context_line":"        | grep url\\\": | grep tar.gz | tail -1 | tr -d \\\"\\ ,\\ | cut -c 5-150)"},{"line_number":282,"context_line":"    if [ -n \"${download_url}\" ]; then"},{"line_number":283,"context_line":"        download $(basename \"${download_url}\") \"${download_url}\""},{"line_number":284,"context_line":"    else"}],"source_content_type":"text/x-sh","patch_set":2,"id":"1a122d0e_30ce085a","line":281,"updated":"2016-04-29 15:57:27.000000000","message":"This \u0027cut\u0027 command looks really dangerous to me. It\u0027ll fail again if, for instance, setuptools 20.10.10 is released, since the length of the URL will change. I think this would be better:\n\n    local download_url\u003d$(download - \"https://pypi.python.org/pypi/$pkg/json\" | sed -n \u0027/url.:.*\\.tar\\.gz/ { s/^[[:space:]]*\"url\": \\?\"\\(.*\\)\",\\?/\\1/; p; }\u0027 | tail -n 1)","commit_id":"adf134321907fd0c022645a946814e21650bf188"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"443dcd3742ce75cfa6f33163fcbfa8e1392caccc","unresolved":false,"context_lines":[{"line_number":278,"context_line":"    local pkg\u003d${1}"},{"line_number":279,"context_line":"    local pkg_json\u003d$(download - \"http://pypi.python.org/pypi/${pkg}/json/\")"},{"line_number":280,"context_line":"    local download_url\u003d$(echo \"${pkg_json}\"\\"},{"line_number":281,"context_line":"        | grep url\\\": | grep tar.gz | tail -1 | tr -d \\\"\\ ,\\ | cut -c 5-150)"},{"line_number":282,"context_line":"    if [ -n \"${download_url}\" ]; then"},{"line_number":283,"context_line":"        download $(basename \"${download_url}\") \"${download_url}\""},{"line_number":284,"context_line":"    else"}],"source_content_type":"text/x-sh","patch_set":2,"id":"1a122d0e_dbd41521","line":281,"in_reply_to":"1a122d0e_30ce085a","updated":"2016-04-29 16:10:49.000000000","message":"\"150\" in \"cut -c 5-150\" is more than enough, even 140 is more than enough","commit_id":"adf134321907fd0c022645a946814e21650bf188"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"2c61578dd5037dd9cff7957579c7b9f694ba32ac","unresolved":false,"context_lines":[{"line_number":278,"context_line":"    local pkg\u003d${1}"},{"line_number":279,"context_line":"    local pkg_json\u003d$(download - \"http://pypi.python.org/pypi/${pkg}/json/\")"},{"line_number":280,"context_line":"    local download_url\u003d$(echo \"${pkg_json}\"\\"},{"line_number":281,"context_line":"        | grep url\\\": | grep tar.gz | tail -1 | tr -d \\\"\\ ,\\ | cut -c 5-150)"},{"line_number":282,"context_line":"    if [ -n \"${download_url}\" ]; then"},{"line_number":283,"context_line":"        download $(basename \"${download_url}\") \"${download_url}\""},{"line_number":284,"context_line":"    else"}],"source_content_type":"text/x-sh","patch_set":2,"id":"1a122d0e_cb904799","line":281,"in_reply_to":"1a122d0e_4af28c9c","updated":"2016-05-04 15:58:42.000000000","message":"There are three proposals at this point; the one using sed is unambiguously the worst. We should be using a real JSON parser here, full stop, even if it takes more characters to do it right.","commit_id":"adf134321907fd0c022645a946814e21650bf188"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"05279de954c7ca3986d362c1e2acb0b4a9f565a5","unresolved":false,"context_lines":[{"line_number":278,"context_line":"    local pkg\u003d${1}"},{"line_number":279,"context_line":"    local pkg_json\u003d$(download - \"http://pypi.python.org/pypi/${pkg}/json/\")"},{"line_number":280,"context_line":"    local download_url\u003d$(echo \"${pkg_json}\"\\"},{"line_number":281,"context_line":"        | grep url\\\": | grep tar.gz | tail -1 | tr -d \\\"\\ ,\\ | cut -c 5-150)"},{"line_number":282,"context_line":"    if [ -n \"${download_url}\" ]; then"},{"line_number":283,"context_line":"        download $(basename \"${download_url}\") \"${download_url}\""},{"line_number":284,"context_line":"    else"}],"source_content_type":"text/x-sh","patch_set":2,"id":"1a122d0e_fbabd185","line":281,"in_reply_to":"1a122d0e_dbd41521","updated":"2016-04-29 16:12:26.000000000","message":"Oh, I see what\u0027s happening here. This is still deeply inefficient and hard to read.","commit_id":"adf134321907fd0c022645a946814e21650bf188"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"f610a5c728af817be6dc204bb1523aa76b80d3ac","unresolved":false,"context_lines":[{"line_number":278,"context_line":"    local pkg\u003d${1}"},{"line_number":279,"context_line":"    local pkg_json\u003d$(download - \"http://pypi.python.org/pypi/${pkg}/json/\")"},{"line_number":280,"context_line":"    local download_url\u003d$(echo \"${pkg_json}\"\\"},{"line_number":281,"context_line":"        | grep url\\\": | grep tar.gz | tail -1 | tr -d \\\"\\ ,\\ | cut -c 5-150)"},{"line_number":282,"context_line":"    if [ -n \"${download_url}\" ]; then"},{"line_number":283,"context_line":"        download $(basename \"${download_url}\") \"${download_url}\""},{"line_number":284,"context_line":"    else"}],"source_content_type":"text/x-sh","patch_set":2,"id":"1a122d0e_e2b678f8","line":281,"in_reply_to":"1a122d0e_dc0ec18b","updated":"2016-04-30 03:35:13.000000000","message":"That seems a bit heavyweight, but I like the approach of calling out to python, which we can guarantee is installed at this point in the installer. Parsing JSON with sed is nearly as bad as parsing it with this long pipeline, so replacing either approach with a proper JSON parser is a definite improvement (and much less likely to break in the future). This seems to work:\n\n    curl https://pypi.python.org/pypi/setuptools/json | python -c \u0027import sys,json;i\u003djson.load(sys.stdin);print([p[\"url\"] for p in i[\"releases\"][i[\"info\"][\"version\"]] if p[\"python_version\"] \u003d\u003d \"source\"][0])\u0027\n\nOr, if we don\u0027t like Python one-liners (which isn\u0027t unreasonable), a helper script along the lines of what Steve suggested makes sense to me.\n\nObviously we want to fix this quickly, but there\u0027s no shame in fixing it properly so it doesn\u0027t break again.","commit_id":"adf134321907fd0c022645a946814e21650bf188"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"73bd3b76fe5f0133360c7e9b1c76794262adc789","unresolved":false,"context_lines":[{"line_number":278,"context_line":"    local pkg\u003d${1}"},{"line_number":279,"context_line":"    local pkg_json\u003d$(download - \"http://pypi.python.org/pypi/${pkg}/json/\")"},{"line_number":280,"context_line":"    local download_url\u003d$(echo \"${pkg_json}\"\\"},{"line_number":281,"context_line":"        | grep url\\\": | grep tar.gz | tail -1 | tr -d \\\"\\ ,\\ | cut -c 5-150)"},{"line_number":282,"context_line":"    if [ -n \"${download_url}\" ]; then"},{"line_number":283,"context_line":"        download $(basename \"${download_url}\") \"${download_url}\""},{"line_number":284,"context_line":"    else"}],"source_content_type":"text/x-sh","patch_set":2,"id":"1a122d0e_4d115d53","line":281,"in_reply_to":"1a122d0e_e2b678f8","updated":"2016-04-30 04:54:58.000000000","message":"Normally not a fan of one-liners but that one is pretty straightforward in the context of a bash script and doesn\u0027t stress the brain all that much.","commit_id":"adf134321907fd0c022645a946814e21650bf188"},{"author":{"_account_id":12395,"name":"Roman Vasylets","email":"pomeo92@gmail.com","username":"rvasilets"},"change_message_id":"b57b90e699ee4855b1a6ac47c91024060266a63a","unresolved":false,"context_lines":[{"line_number":278,"context_line":"    local pkg\u003d${1}"},{"line_number":279,"context_line":"    local pkg_json\u003d$(download - \"http://pypi.python.org/pypi/${pkg}/json/\")"},{"line_number":280,"context_line":"    local download_url\u003d$(echo \"${pkg_json}\"\\"},{"line_number":281,"context_line":"        | grep url\\\": | grep tar.gz | tail -1 | tr -d \\\"\\ ,\\ | cut -c 5-150)"},{"line_number":282,"context_line":"    if [ -n \"${download_url}\" ]; then"},{"line_number":283,"context_line":"        download $(basename \"${download_url}\") \"${download_url}\""},{"line_number":284,"context_line":"    else"}],"source_content_type":"text/x-sh","patch_set":2,"id":"1a122d0e_ef06661a","line":281,"in_reply_to":"1a122d0e_fbabd185","updated":"2016-04-29 21:19:28.000000000","message":"We have broken gates, but you are writing about not readable code. Broken gates, Carl! https://i.ytimg.com/vi/8K6k7CsQ-d8/maxresdefault.jpg And now they will be broken during the whole holidays(","commit_id":"adf134321907fd0c022645a946814e21650bf188"},{"author":{"_account_id":9234,"name":"Steve Heyman","email":"steve@heyman.com","username":"hockeynut"},"change_message_id":"b1f1692b22946cc3a2938d160fb6eb6c83c45ac0","unresolved":false,"context_lines":[{"line_number":278,"context_line":"    local pkg\u003d${1}"},{"line_number":279,"context_line":"    local pkg_json\u003d$(download - \"http://pypi.python.org/pypi/${pkg}/json/\")"},{"line_number":280,"context_line":"    local download_url\u003d$(echo \"${pkg_json}\"\\"},{"line_number":281,"context_line":"        | grep url\\\": | grep tar.gz | tail -1 | tr -d \\\"\\ ,\\ | cut -c 5-150)"},{"line_number":282,"context_line":"    if [ -n \"${download_url}\" ]; then"},{"line_number":283,"context_line":"        download $(basename \"${download_url}\") \"${download_url}\""},{"line_number":284,"context_line":"    else"}],"source_content_type":"text/x-sh","patch_set":2,"id":"1a122d0e_dc0ec18b","line":281,"in_reply_to":"1a122d0e_fbabd185","updated":"2016-04-30 00:29:52.000000000","message":"What if you call out to a python function - I hacked something together that will fetch the URL given a package name, optional version number, and optional format (default is .gz).\n\nhttps://gist.github.com/sheyman/364fc60047fd00bf16ef197e4c471fd6","commit_id":"adf134321907fd0c022645a946814e21650bf188"},{"author":{"_account_id":10475,"name":"Alexander Maretskiy","email":"amaretskiy@mirantis.com","username":"maretskiy"},"change_message_id":"1e6635f7844a170872c544e5b4c5aea861cecf22","unresolved":false,"context_lines":[{"line_number":278,"context_line":"    local pkg\u003d${1}"},{"line_number":279,"context_line":"    local pkg_json\u003d$(download - \"http://pypi.python.org/pypi/${pkg}/json/\")"},{"line_number":280,"context_line":"    local download_url\u003d$(echo \"${pkg_json}\"\\"},{"line_number":281,"context_line":"        | grep url\\\": | grep tar.gz | tail -1 | tr -d \\\"\\ ,\\ | cut -c 5-150)"},{"line_number":282,"context_line":"    if [ -n \"${download_url}\" ]; then"},{"line_number":283,"context_line":"        download $(basename \"${download_url}\") \"${download_url}\""},{"line_number":284,"context_line":"    else"}],"source_content_type":"text/x-sh","patch_set":2,"id":"1a122d0e_4af28c9c","line":281,"in_reply_to":"1a122d0e_fbabd185","updated":"2016-05-04 07:40:33.000000000","message":"http://paste.openstack.org/show/496031/","commit_id":"adf134321907fd0c022645a946814e21650bf188"}]}
