)]}'
{"scripts/files/elements/ubuntu-mariadb/pre-install.d/10-percona-apt-key":[{"author":{"_account_id":10215,"name":"Peter Stachowski","email":"peter@tesora.com","username":"peterstac"},"change_message_id":"15de4dd0303fde2c187711b5dee93d2253ddf046","unresolved":false,"context_lines":[{"line_number":23,"context_line":"if [ \"$?\" -ne \"0\" ];"},{"line_number":24,"context_line":"then"},{"line_number":25,"context_line":"    echo \"Trying alternate keyserver hkp://keyserver.ubuntu.com\""},{"line_number":26,"context_line":"    set -e"},{"line_number":27,"context_line":"    apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C4CBDCDCD2EFD2A"},{"line_number":28,"context_line":"fi"},{"line_number":29,"context_line":""}],"source_content_type":"application/x-shellscript","patch_set":1,"id":"dab17558_22348af9","line":26,"range":{"start_line":26,"start_character":4,"end_line":26,"end_character":10},"updated":"2016-05-14 17:10:19.000000000","message":"You could re-enable it right after the command, then you wouldn\u0027t need to do it again after the \u0027if\u0027 but no biggie","commit_id":"e363325c022d2901aede471fe0f66ae60e876f28"},{"author":{"_account_id":9664,"name":"amrith","email":"amrith.kumar@gmail.com","username":"amrith"},"change_message_id":"7caef79048965b656eadaf0957ab9e17156bdab3","unresolved":false,"context_lines":[{"line_number":23,"context_line":"if [ \"$?\" -ne \"0\" ];"},{"line_number":24,"context_line":"then"},{"line_number":25,"context_line":"    echo \"Trying alternate keyserver hkp://keyserver.ubuntu.com\""},{"line_number":26,"context_line":"    set -e"},{"line_number":27,"context_line":"    apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C4CBDCDCD2EFD2A"},{"line_number":28,"context_line":"fi"},{"line_number":29,"context_line":""}],"source_content_type":"application/x-shellscript","patch_set":1,"id":"dab17558_eda8b379","line":26,"range":{"start_line":26,"start_character":4,"end_line":26,"end_character":10},"in_reply_to":"dab17558_22348af9","updated":"2016-05-14 19:11:51.000000000","message":"No, you can\u0027t (I don\u0027t think).\n\nset -e will reset the last commands return status. I\u0027d have to save $? into something and then check that if you insist.\n\nI created some examples to illustrate.\n\nhttps://gist.github.com/amrith/be10c06ee968cae12f9c263e739a5408\n\nfail.bash does nothing more than return a status of 1, simulating a failure.\n\nAs you\u0027ll see set1.bash will not print the message because it has set -e enabled.\n\nset2.bash won\u0027t print the message either because enabling set -e before the if [as you suggest] resets the return value.\n\nI\u0027d have to do what set3.bash does to not have to execute set -e in two places.\n\nit is a choice; I chose the way I did it here. You could argue that I should do the other ...\n\nBut, the mechanism you propose, that won\u0027t work. That\u0027s set2.bash.","commit_id":"e363325c022d2901aede471fe0f66ae60e876f28"},{"author":{"_account_id":9664,"name":"amrith","email":"amrith.kumar@gmail.com","username":"amrith"},"change_message_id":"bd1cc2d605f687ff2ac1f39bd96de837b700d890","unresolved":false,"context_lines":[{"line_number":23,"context_line":"if [ \"$?\" -ne \"0\" ];"},{"line_number":24,"context_line":"then"},{"line_number":25,"context_line":"    echo \"Trying alternate keyserver hkp://keyserver.ubuntu.com\""},{"line_number":26,"context_line":"    set -e"},{"line_number":27,"context_line":"    apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C4CBDCDCD2EFD2A"},{"line_number":28,"context_line":"fi"},{"line_number":29,"context_line":""}],"source_content_type":"application/x-shellscript","patch_set":1,"id":"dab17558_d4ec20bd","line":26,"range":{"start_line":26,"start_character":4,"end_line":26,"end_character":10},"in_reply_to":"dab17558_34eacc0f","updated":"2016-05-16 19:15:12.000000000","message":"I most definitely am ... see line 23.\n\nset -e says on error, abort\n\nSo you have to disable that and turn on set +e (line 20).\n\nThen you get to check the status (line 23) and re-enable abort on error (lines 26 and 30).","commit_id":"e363325c022d2901aede471fe0f66ae60e876f28"},{"author":{"_account_id":6413,"name":"Victoria Martinez de la Cruz","email":"victoria@redhat.com","username":"vkmc"},"change_message_id":"43d252e62898fa3627fecb9b76993db4081be779","unresolved":false,"context_lines":[{"line_number":23,"context_line":"if [ \"$?\" -ne \"0\" ];"},{"line_number":24,"context_line":"then"},{"line_number":25,"context_line":"    echo \"Trying alternate keyserver hkp://keyserver.ubuntu.com\""},{"line_number":26,"context_line":"    set -e"},{"line_number":27,"context_line":"    apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C4CBDCDCD2EFD2A"},{"line_number":28,"context_line":"fi"},{"line_number":29,"context_line":""}],"source_content_type":"application/x-shellscript","patch_set":1,"id":"dab17558_b83b0b9b","line":26,"range":{"start_line":26,"start_character":4,"end_line":26,"end_character":10},"in_reply_to":"dab17558_d4ec20bd","updated":"2016-05-17 20:37:07.000000000","message":"I was referring after L23. Re-reading the patch I understood why you need set -e in the two places. Thanks!","commit_id":"e363325c022d2901aede471fe0f66ae60e876f28"},{"author":{"_account_id":6413,"name":"Victoria Martinez de la Cruz","email":"victoria@redhat.com","username":"vkmc"},"change_message_id":"c0ca1cf58970d0f74c57216f6d8505a90ce2fadf","unresolved":false,"context_lines":[{"line_number":23,"context_line":"if [ \"$?\" -ne \"0\" ];"},{"line_number":24,"context_line":"then"},{"line_number":25,"context_line":"    echo \"Trying alternate keyserver hkp://keyserver.ubuntu.com\""},{"line_number":26,"context_line":"    set -e"},{"line_number":27,"context_line":"    apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 1C4CBDCDCD2EFD2A"},{"line_number":28,"context_line":"fi"},{"line_number":29,"context_line":""}],"source_content_type":"application/x-shellscript","patch_set":1,"id":"dab17558_34eacc0f","line":26,"range":{"start_line":26,"start_character":4,"end_line":26,"end_character":10},"in_reply_to":"dab17558_eda8b379","updated":"2016-05-16 19:05:26.000000000","message":"But you are not checking $? anymore, right? You don\u0027t need to save its status. In that case, this line can be removed.","commit_id":"e363325c022d2901aede471fe0f66ae60e876f28"}]}
