)]}'
{"functions-common":[{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"f29dfcf9052b160b889d40dddde9a8b77226a72e","unresolved":false,"context_lines":[{"line_number":944,"context_line":"        no_proxy\u003d$no_proxy \\"},{"line_number":945,"context_line":"        yum install -y \"$@\" 2\u003e\u00261 | \\"},{"line_number":946,"context_line":"        awk \u0027"},{"line_number":947,"context_line":"        BEGIN { fail\u003d0 }"},{"line_number":948,"context_line":"        /No package/ { fail\u003d1 }"},{"line_number":949,"context_line":"        { print }"},{"line_number":950,"context_line":"        END {"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAAVX%2F%2FvYc%3D","line":947,"updated":"2014-02-28 16:43:33.000000000","message":"Please indent the awk code","commit_id":"f5b59e82aa4809fa681bb5d46876af2c1942090d"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"509f7c014770996a0b931c4dd6581703865c7aeb","unresolved":false,"context_lines":[{"line_number":944,"context_line":"        no_proxy\u003d$no_proxy \\"},{"line_number":945,"context_line":"        yum install -y \"$@\" 2\u003e\u00261 | \\"},{"line_number":946,"context_line":"        awk \u0027"},{"line_number":947,"context_line":"        BEGIN { fail\u003d0 }"},{"line_number":948,"context_line":"        /No package/ { fail\u003d1 }"},{"line_number":949,"context_line":"        { print }"},{"line_number":950,"context_line":"        END {"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAAVn%2F%2F%2BV0%3D","line":947,"in_reply_to":"AAAAVX%2F%2FvYc%3D","updated":"2014-03-03 03:06:04.000000000","message":"Done","commit_id":"f5b59e82aa4809fa681bb5d46876af2c1942090d"},{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"f29dfcf9052b160b889d40dddde9a8b77226a72e","unresolved":false,"context_lines":[{"line_number":952,"context_line":"                print \"Some packages not installed!\""},{"line_number":953,"context_line":"                exit fail"},{"line_number":954,"context_line":"            }"},{"line_number":955,"context_line":"        }\u0027"},{"line_number":956,"context_line":"    $xtrace"},{"line_number":957,"context_line":"}"},{"line_number":958,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAAVX%2F%2FvXs%3D","line":955,"updated":"2014-02-28 16:43:33.000000000","message":"even with errexit set I think we should trap the non-zero exit here and call die so the error status is clear.","commit_id":"f5b59e82aa4809fa681bb5d46876af2c1942090d"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"509f7c014770996a0b931c4dd6581703865c7aeb","unresolved":false,"context_lines":[{"line_number":952,"context_line":"                print \"Some packages not installed!\""},{"line_number":953,"context_line":"                exit fail"},{"line_number":954,"context_line":"            }"},{"line_number":955,"context_line":"        }\u0027"},{"line_number":956,"context_line":"    $xtrace"},{"line_number":957,"context_line":"}"},{"line_number":958,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAAVn%2F%2F%2BV4%3D","line":955,"in_reply_to":"AAAAVX%2F%2FvXs%3D","updated":"2014-03-03 03:06:04.000000000","message":"do you mean \"overriding\" -e semantics something like\n\n---\nsudo ...blah... | awk {...} \u0026\u0026 [[ 1 ]]\nif [[ $? \u003d\u003d 1 ]]; then\n  die()\nfi\n---\n\nIMO that\u0027s rather confusing.\n\nOr do you mean simply check $? and die, but with the understanding this won\u0027t trigger when -e is set?","commit_id":"f5b59e82aa4809fa681bb5d46876af2c1942090d"},{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"c247e8fa0bd9089ab417e795f4b7a627aedd3b8b","unresolved":false,"context_lines":[{"line_number":952,"context_line":"                print \"Some packages not installed!\""},{"line_number":953,"context_line":"                exit fail"},{"line_number":954,"context_line":"            }"},{"line_number":955,"context_line":"        }\u0027"},{"line_number":956,"context_line":"    $xtrace"},{"line_number":957,"context_line":"}"},{"line_number":958,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAAVn%2F%2F2Vc%3D","line":955,"in_reply_to":"AAAAVn%2F%2F%2BV4%3D","updated":"2014-03-03 20:13:26.000000000","message":"If the awk hits \u0027exit fail\u0027 then you\u0027ll get a message to stdout and only if errexit is set does the script abort.  I think it would be best to call die() at this point because if missing packages are worthy of stopping that doesn\u0027t change if errexit is set or not.  So this is what I had in mind:\n\n  $sudo ... \\\n    ...\n    awk `\n      ...\n    }\u0027 || die $LINENO \"Missing packages detected\"","commit_id":"f5b59e82aa4809fa681bb5d46876af2c1942090d"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"d18c263d90fc0b9ed5b7f387ed4587284580cccd","unresolved":false,"context_lines":[{"line_number":952,"context_line":"                print \"Some packages not installed!\""},{"line_number":953,"context_line":"                exit fail"},{"line_number":954,"context_line":"            }"},{"line_number":955,"context_line":"        }\u0027"},{"line_number":956,"context_line":"    $xtrace"},{"line_number":957,"context_line":"}"},{"line_number":958,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":1,"id":"AAAAVn%2F%2F1cQ%3D","line":955,"in_reply_to":"AAAAVn%2F%2F2Vc%3D","updated":"2014-03-03 21:33:40.000000000","message":"Ok, that is a good idea :)","commit_id":"f5b59e82aa4809fa681bb5d46876af2c1942090d"},{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"4df84ccb3cb062afda611430c0edb069dba853ab","unresolved":false,"context_lines":[{"line_number":946,"context_line":"        no_proxy\u003d$no_proxy \\"},{"line_number":947,"context_line":"        yum install -y \"$@\" 2\u003e\u00261 | \\"},{"line_number":948,"context_line":"        awk \u0027"},{"line_number":949,"context_line":"        BEGIN { fail\u003d0 }"},{"line_number":950,"context_line":""},{"line_number":951,"context_line":"        /No package/ { fail\u003d1 }"},{"line_number":952,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAAVn%2F%2F2SA%3D","line":949,"updated":"2014-03-03 20:13:19.000000000","message":"By indent, I just meant indenting the awk code one more level than the awk command:\n\n  awk \u0027\n      BEGIN { fail\u003d0 }\n      ...\n      }\u0027","commit_id":"15ec699be0883fd36ee1908bac73523101b0048d"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"c18d72ca5217744e973287858f9c1e7bc0e7c421","unresolved":false,"context_lines":[{"line_number":946,"context_line":"        no_proxy\u003d$no_proxy \\"},{"line_number":947,"context_line":"        yum install -y \"$@\" 2\u003e\u00261 | \\"},{"line_number":948,"context_line":"        awk \u0027"},{"line_number":949,"context_line":"        BEGIN { fail\u003d0 }"},{"line_number":950,"context_line":""},{"line_number":951,"context_line":"        /No package/ { fail\u003d1 }"},{"line_number":952,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAAVn%2F%2F1fk%3D","line":949,"in_reply_to":"AAAAVn%2F%2F2SA%3D","updated":"2014-03-03 21:33:52.000000000","message":"Done","commit_id":"15ec699be0883fd36ee1908bac73523101b0048d"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"e598f32f9fd33a970f10dda045dd103da3c4ea60","unresolved":false,"context_lines":[{"line_number":957,"context_line":"        die $LINENO \"Yum install failure\""},{"line_number":958,"context_line":"    fi"},{"line_number":959,"context_line":""},{"line_number":960,"context_line":"    $xtrace"},{"line_number":961,"context_line":"}"},{"line_number":962,"context_line":""},{"line_number":963,"context_line":"# zypper wrapper to set arguments correctly"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"AAAAVn%2F%2F0ug%3D","line":960,"updated":"2014-03-03 22:47:51.000000000","message":"where are you setting xtrace?","commit_id":"e8dfdbfbeb3c90bfc581a0d58a53c9d33d8852d5"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"61c08e4eb3281626b2bef98f9de739256cbaccf2","unresolved":false,"context_lines":[{"line_number":957,"context_line":"        die $LINENO \"Yum install failure\""},{"line_number":958,"context_line":"    fi"},{"line_number":959,"context_line":""},{"line_number":960,"context_line":"    $xtrace"},{"line_number":961,"context_line":"}"},{"line_number":962,"context_line":""},{"line_number":963,"context_line":"# zypper wrapper to set arguments correctly"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"AAAAVn%2F%2F0l8%3D","line":960,"in_reply_to":"AAAAVn%2F%2F0ug%3D","updated":"2014-03-03 23:05:08.000000000","message":"oops, sorry ... wasn\u0027t in the diff.  updated","commit_id":"e8dfdbfbeb3c90bfc581a0d58a53c9d33d8852d5"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"1d718c4d35190462c3c299474122acc2af091178","unresolved":false,"context_lines":[{"line_number":937,"context_line":"function yum_install {"},{"line_number":938,"context_line":"    local xtrace\u003d$(set +o | grep xtrace)"},{"line_number":939,"context_line":"    set +o xtrace"},{"line_number":940,"context_line":"    [[ \"$OFFLINE\" \u003d \"True\" ]] \u0026\u0026 return"},{"line_number":941,"context_line":"    local sudo\u003d\"sudo\""},{"line_number":942,"context_line":"    [[ \"$(id -u)\" \u003d \"0\" ]] \u0026\u0026 sudo\u003d\"env\""},{"line_number":943,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":6,"id":"AAAAVn%2F%2FIxE%3D","line":940,"updated":"2014-03-08 11:31:53.000000000","message":"so this means we just turned off xtrace for the rest of the script. Which is bad. If you are going to manipulate xtrace in a function you need to be really explicit on the reset on any not fatal exit.","commit_id":"8641508062a0d6d2f3a69fa4f1561240fea750b0"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"6685fdc8c1fc86201ebe531a589855b895b472f1","unresolved":false,"context_lines":[{"line_number":937,"context_line":"function yum_install {"},{"line_number":938,"context_line":"    local xtrace\u003d$(set +o | grep xtrace)"},{"line_number":939,"context_line":"    set +o xtrace"},{"line_number":940,"context_line":"    [[ \"$OFFLINE\" \u003d \"True\" ]] \u0026\u0026 return"},{"line_number":941,"context_line":"    local sudo\u003d\"sudo\""},{"line_number":942,"context_line":"    [[ \"$(id -u)\" \u003d \"0\" ]] \u0026\u0026 sudo\u003d\"env\""},{"line_number":943,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":6,"id":"AAAAVn%2F%2FFVY%3D","line":940,"in_reply_to":"AAAAVn%2F%2FIxE%3D","updated":"2014-03-10 03:12:35.000000000","message":"Ok, thanks for catching that.  The awk output made things a bit long IMO.  Let\u0027s just leave xtrace changes to be done separately to this","commit_id":"8641508062a0d6d2f3a69fa4f1561240fea750b0"}]}
