)]}'
{"inc/meta-config":[{"author":{"_account_id":5803,"name":"Attila Fazekas","email":"afazekas@redhat.com","username":"afazekas"},"change_message_id":"27d22d01b4d10232a3538259ad4a68d235e25b1a","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    local real_configfile\u003d$(eval echo $configfile)"},{"line_number":93,"context_line":"    if [ ! -f $real_configfile ]; then"},{"line_number":94,"context_line":"        touch $real_configfile"},{"line_number":95,"context_line":"        if [ ! $? -eq 0 ]; then"},{"line_number":96,"context_line":"            die $LINENO \"could not create config file $real_configfile ($configfile)\""},{"line_number":97,"context_line":"        fi"},{"line_number":98,"context_line":"    fi"}],"source_content_type":"application/x-shellscript","patch_set":4,"id":"9a1a9d01_b0b85c12","line":95,"updated":"2015-09-30 14:31:12.000000000","message":"foo || die \"msg\" is preferred instead of the extra statement. \n\n touch $real_configfile || die $LINENO \"could not create config file $real_configfile ($configfile)\"","commit_id":"8f2470ac696bc51eddeb22b492d96258639592d7"},{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"bd7dc8b7cbd637dbdd15720807c7c532f58dc269","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    local real_configfile\u003d$(eval echo $configfile)"},{"line_number":93,"context_line":"    if [ ! -f $real_configfile ]; then"},{"line_number":94,"context_line":"        touch $real_configfile"},{"line_number":95,"context_line":"        if [ ! $? -eq 0 ]; then"},{"line_number":96,"context_line":"            die $LINENO \"could not create config file $real_configfile ($configfile)\""},{"line_number":97,"context_line":"        fi"},{"line_number":98,"context_line":"    fi"}],"source_content_type":"application/x-shellscript","patch_set":4,"id":"7a2fa921_8d73874d","line":95,"in_reply_to":"9a1a9d01_30df6c3b","updated":"2015-10-05 21:41:59.000000000","message":"The last one is the correct answer, broken tests are not good and will let us down at some point, like maybe already?\n\nIf this stays, please use use if [[ ... ]] here","commit_id":"8f2470ac696bc51eddeb22b492d96258639592d7"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"b2bfc9d3ae747c8756bd4a6845d4a8d31de0268f","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    local real_configfile\u003d$(eval echo $configfile)"},{"line_number":93,"context_line":"    if [ ! -f $real_configfile ]; then"},{"line_number":94,"context_line":"        touch $real_configfile"},{"line_number":95,"context_line":"        if [ ! $? -eq 0 ]; then"},{"line_number":96,"context_line":"            die $LINENO \"could not create config file $real_configfile ($configfile)\""},{"line_number":97,"context_line":"        fi"},{"line_number":98,"context_line":"    fi"}],"source_content_type":"application/x-shellscript","patch_set":4,"id":"9a1a9d01_30df6c3b","line":95,"in_reply_to":"9a1a9d01_b0b85c12","updated":"2015-09-30 15:06:24.000000000","message":"I tried, but for some reason (totally opaque to me I have to admit), what you suggest does not give the desired effect.\n\nIt does do the expected thing when the error is triggered inside a stack.sh.\n\nBut when the error is triggered through the unit test, it subtly breaks:\n- in the unit test, \u0027die\u0027 is not sourced from function-common to avoid interrupting the test suite when it is called\n- calling \u0027die\u0027 inside the if/else statement achieves the desired behavior: the mocked \u0027die\u0027 is called and the unit test can see that an issue was raised\n- but calling \u0027die\u0027 in a \"touch foo || die\" statement does *not* work: I get  \u0027die: command not found\u0027 and the test script stops here  -- Honestly I don\u0027t understand at all why it does not work (why \u0027die\u0027 is not found, and why \u0027die\u0027 not being found result in the unit test suite to fully stop)\n\nCan we keep this as it is ?\n\n(the alternatives are: drop this improvements, or do not cover it with a unit test, or spend X amount of time digging into bash subtlties to have a \u0027touch foo|| die\u0027 statement work including in the unit test)","commit_id":"8f2470ac696bc51eddeb22b492d96258639592d7"},{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"bd7dc8b7cbd637dbdd15720807c7c532f58dc269","unresolved":false,"context_lines":[{"line_number":180,"context_line":"    local configfile group"},{"line_number":181,"context_line":"    for group in $matchgroups; do"},{"line_number":182,"context_line":"        for configfile in $(get_meta_section_files $localfile $group); do"},{"line_number":183,"context_line":"            realconfigfile\u003d$(eval \"echo $configfile\")"},{"line_number":184,"context_line":"            if [ -z \"$realconfigfile\" ]; then"},{"line_number":185,"context_line":"                die $LINENO \"bogus config file specification: $configfile is undefined\""},{"line_number":186,"context_line":"            fi"}],"source_content_type":"application/x-shellscript","patch_set":4,"id":"7a2fa921_0d877710","line":183,"updated":"2015-10-05 21:41:59.000000000","message":"this needs to be local","commit_id":"8f2470ac696bc51eddeb22b492d96258639592d7"},{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"bd7dc8b7cbd637dbdd15720807c7c532f58dc269","unresolved":false,"context_lines":[{"line_number":181,"context_line":"    for group in $matchgroups; do"},{"line_number":182,"context_line":"        for configfile in $(get_meta_section_files $localfile $group); do"},{"line_number":183,"context_line":"            realconfigfile\u003d$(eval \"echo $configfile\")"},{"line_number":184,"context_line":"            if [ -z \"$realconfigfile\" ]; then"},{"line_number":185,"context_line":"                die $LINENO \"bogus config file specification: $configfile is undefined\""},{"line_number":186,"context_line":"            fi"},{"line_number":187,"context_line":"            dir\u003d$(dirname $realconfigfile)"}],"source_content_type":"application/x-shellscript","patch_set":4,"id":"7a2fa921_4de24fd7","line":184,"updated":"2015-10-05 21:41:59.000000000","message":"use if [[ ... ]] here","commit_id":"8f2470ac696bc51eddeb22b492d96258639592d7"},{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"bd7dc8b7cbd637dbdd15720807c7c532f58dc269","unresolved":false,"context_lines":[{"line_number":184,"context_line":"            if [ -z \"$realconfigfile\" ]; then"},{"line_number":185,"context_line":"                die $LINENO \"bogus config file specification: $configfile is undefined\""},{"line_number":186,"context_line":"            fi"},{"line_number":187,"context_line":"            dir\u003d$(dirname $realconfigfile)"},{"line_number":188,"context_line":"            if [[ -d $dir ]]; then"},{"line_number":189,"context_line":"                merge_config_file $localfile $group $configfile"},{"line_number":190,"context_line":"            else"}],"source_content_type":"application/x-shellscript","patch_set":4,"id":"7a2fa921_2d8fd324","line":187,"updated":"2015-10-05 21:41:59.000000000","message":"this needs to be local","commit_id":"8f2470ac696bc51eddeb22b492d96258639592d7"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"76f7a7dc3861662ea12788c5a9d9748fff5676b2","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    # it alone."},{"line_number":92,"context_line":"    local real_configfile\u003d$(eval echo $configfile)"},{"line_number":93,"context_line":"    if [ ! -f $real_configfile ]; then"},{"line_number":94,"context_line":"        touch $real_configfile"},{"line_number":95,"context_line":"        if [[ ! $? -eq 0 ]]; then"},{"line_number":96,"context_line":"            die $LINENO \"could not create config file $real_configfile ($configfile)\""},{"line_number":97,"context_line":"        fi"}],"source_content_type":"application/x-shellscript","patch_set":5,"id":"1a26ad4f_1c3bfed2","line":94,"updated":"2015-10-29 00:09:43.000000000","message":"if we\u0027re running under \"set -e\" (which we should be), then isn\u0027t this going to just fail here before this detection anyway?","commit_id":"0b55411e89990915fa32883d1d2ccfa0711c40c3"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"e8b2f5b66c6630b6a7797a5418833dcb37da9c51","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    # it alone."},{"line_number":92,"context_line":"    local real_configfile\u003d$(eval echo $configfile)"},{"line_number":93,"context_line":"    if [ ! -f $real_configfile ]; then"},{"line_number":94,"context_line":"        touch $real_configfile"},{"line_number":95,"context_line":"        if [[ ! $? -eq 0 ]]; then"},{"line_number":96,"context_line":"            die $LINENO \"could not create config file $real_configfile ($configfile)\""},{"line_number":97,"context_line":"        fi"}],"source_content_type":"application/x-shellscript","patch_set":5,"id":"1a26ad4f_30784cf2","line":94,"in_reply_to":"1a26ad4f_1c3bfed2","updated":"2015-10-29 13:39:37.000000000","message":"The unit tests, for the cases that are supposed to fail, precede the call to the tested function with a set +e (see the diff of tests/test_meta_config.sh in this gerrit change).","commit_id":"0b55411e89990915fa32883d1d2ccfa0711c40c3"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"c4a5a72de3887507184fcccb0e4a7fb860718e87","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    # it alone."},{"line_number":92,"context_line":"    local real_configfile\u003d$(eval echo $configfile)"},{"line_number":93,"context_line":"    if [ ! -f $real_configfile ]; then"},{"line_number":94,"context_line":"        touch $real_configfile"},{"line_number":95,"context_line":"        if [[ ! $? -eq 0 ]]; then"},{"line_number":96,"context_line":"            die $LINENO \"could not create config file $real_configfile ($configfile)\""},{"line_number":97,"context_line":"        fi"}],"source_content_type":"application/x-shellscript","patch_set":5,"id":"1a26ad4f_ff4cd371","line":94,"in_reply_to":"1a26ad4f_30784cf2","updated":"2015-10-30 00:06:54.000000000","message":"what i mean is in \"real\" code, where set -e is set and we call merge_config_file\n\nit seems like this doesn\u0027t really fix the problem of the failing case just putting out a unhelpful \"can\u0027t touch this\"\n\ni guess it should just be\n\n  touch $real_configfile || die $LINENO \"can\u0027t touch this\"","commit_id":"0b55411e89990915fa32883d1d2ccfa0711c40c3"},{"author":{"_account_id":5803,"name":"Attila Fazekas","email":"afazekas@redhat.com","username":"afazekas"},"change_message_id":"fd92b389f19d49e719e1c3e5d4948b1e29cbf2b8","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            local dir"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"            realconfigfile\u003d$(eval \"echo $configfile\")"},{"line_number":185,"context_line":"            if [[ -z $realconfigfile ]]; then"},{"line_number":186,"context_line":"                die $LINENO \"bogus config file specification: $configfile is undefined\""},{"line_number":187,"context_line":"            fi"},{"line_number":188,"context_line":"            dir\u003d$(dirname $realconfigfile)"}],"source_content_type":"application/x-shellscript","patch_set":8,"id":"fa80f949_4bc79612","line":185,"updated":"2015-11-04 05:35:57.000000000","message":"It also could be written in a shorter form.","commit_id":"85f42f698c7bd74d53309da486fbf44ed860c348"}]}
