)]}'
{"lib/config":[{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"ca403ffe8e90311cffc61402081878ed203ca5ab","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                for (i \u003d 3; i \u003c\u003d n; i++) {"},{"line_number":102,"context_line":"                    value \u003d value \"\u003d\" d[i]"},{"line_number":103,"context_line":"                }"},{"line_number":104,"context_line":"            }"},{"line_number":105,"context_line":"            print \"iniset \" configfile \" \" section \" \" attr \" \\\"\" value \"\\\"\""},{"line_number":106,"context_line":"        }"},{"line_number":107,"context_line":"    \u0027 | while read a; do eval \"$a\"; done"}],"source_content_type":"text/x-ini","patch_set":2,"id":"baa201ad_7db8b9e5","line":104,"updated":"2014-10-01 18:14:15.000000000","message":"recommend the change as:\n            value \u003d substr($0, index($0, \"\u003d\") + 1)\n\nThis will keep the config value exactly the same as it appears in local.conf","commit_id":"4ee56e41c8e615be0bc06d39773467fbde755014"},{"author":{"_account_id":842,"name":"Fergal Mc Carthy","email":"fergal.mc.carthy@suse.com","username":"fergal-mccarthy"},"change_message_id":"74717fd873ab0a926f0d91387854af9c58677b43","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                for (i \u003d 3; i \u003c\u003d n; i++) {"},{"line_number":102,"context_line":"                    value \u003d value \"\u003d\" d[i]"},{"line_number":103,"context_line":"                }"},{"line_number":104,"context_line":"            }"},{"line_number":105,"context_line":"            print \"iniset \" configfile \" \" section \" \" attr \" \\\"\" value \"\\\"\""},{"line_number":106,"context_line":"        }"},{"line_number":107,"context_line":"    \u0027 | while read a; do eval \"$a\"; done"}],"source_content_type":"text/x-ini","patch_set":2,"id":"baa201ad_589e9157","line":104,"in_reply_to":"baa201ad_4dcfb5b0","updated":"2014-10-02 13:18:05.000000000","message":"Realised after as I was verifying that in this case we also need to strip trailing spaces as well.","commit_id":"4ee56e41c8e615be0bc06d39773467fbde755014"},{"author":{"_account_id":842,"name":"Fergal Mc Carthy","email":"fergal.mc.carthy@suse.com","username":"fergal-mccarthy"},"change_message_id":"abf63c3ab9d5e891cc5eae4c02fc3bb2318c06b5","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                for (i \u003d 3; i \u003c\u003d n; i++) {"},{"line_number":102,"context_line":"                    value \u003d value \"\u003d\" d[i]"},{"line_number":103,"context_line":"                }"},{"line_number":104,"context_line":"            }"},{"line_number":105,"context_line":"            print \"iniset \" configfile \" \" section \" \" attr \" \\\"\" value \"\\\"\""},{"line_number":106,"context_line":"        }"},{"line_number":107,"context_line":"    \u0027 | while read a; do eval \"$a\"; done"}],"source_content_type":"text/x-ini","patch_set":2,"id":"baa201ad_4dcfb5b0","line":104,"in_reply_to":"baa201ad_7db8b9e5","updated":"2014-10-02 12:29:48.000000000","message":"Note that to make this work you actually need the following code block:\n\n            value \u003d substr($0, index($0, \"\u003d\") + 1)\n            while (substr(value, 1, 1) \u003d\u003d \" \") {\n                value \u003d substr(value, 2)\n            }\n\nThis ensures that any spaces at the beginning of value are stripped, as is the case for d[2]. Otherwise we get multiple test failures when running the tests.","commit_id":"4ee56e41c8e615be0bc06d39773467fbde755014"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"1ef207c2bb6526a9236c748b1ec4c71798817fdc","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            }"},{"line_number":103,"context_line":"            while (substr(value, length(value), length(value)) \u003d\u003d \" \") {"},{"line_number":104,"context_line":"                value \u003d substr(value, 1, length(value) - 1)"},{"line_number":105,"context_line":"            }"},{"line_number":106,"context_line":"            print \"iniset \" configfile \" \" section \" \" attr \" \\\"\" value \"\\\"\""},{"line_number":107,"context_line":"        }"},{"line_number":108,"context_line":"    \u0027 | while read a; do eval \"$a\"; done"}],"source_content_type":"text/x-ini","patch_set":3,"id":"baa201ad_eee13cd1","line":105,"updated":"2014-10-02 16:12:18.000000000","message":"the idea is to keep the config value exactly the same as it appears in local.conf. However, I realized that iniset will also add one \u0027space\u0027 in between \u0027\u003d\u0027 and the config value. In any case, the tests can be modified to reflect the above semantics.\n\nBut I think it\u0027s also desirable to remove the leading and trailing spaces. In that case, the above code can be simplified as:\n\n            cfg_value \u003d substr($0, index($0, \"\u003d\") + 1)\n            # Remove leading and trailing spaces.\n            sub(/^[ \\t]*/, \"\", cfg_value)\n            sub(/[ \\t]*$/, \"\", cfg_value)","commit_id":"01964b4ea2d4f21f6226484c19a30f70cd57f18f"},{"author":{"_account_id":842,"name":"Fergal Mc Carthy","email":"fergal.mc.carthy@suse.com","username":"fergal-mccarthy"},"change_message_id":"c5cdf2afeab96ce93426c3f1256132d0eb365129","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            }"},{"line_number":103,"context_line":"            while (substr(value, length(value), length(value)) \u003d\u003d \" \") {"},{"line_number":104,"context_line":"                value \u003d substr(value, 1, length(value) - 1)"},{"line_number":105,"context_line":"            }"},{"line_number":106,"context_line":"            print \"iniset \" configfile \" \" section \" \" attr \" \\\"\" value \"\\\"\""},{"line_number":107,"context_line":"        }"},{"line_number":108,"context_line":"    \u0027 | while read a; do eval \"$a\"; done"}],"source_content_type":"text/x-ini","patch_set":3,"id":"baa201ad_1f7068a4","line":105,"in_reply_to":"baa201ad_eee13cd1","updated":"2014-10-02 17:45:13.000000000","message":"Thanks for the sub() examples; I initially tried doing something like that with gensub() without success so switched to the while loop.\n\nI\u0027ve implemented the above change for both the attr \u0026 value to be more consistent.","commit_id":"01964b4ea2d4f21f6226484c19a30f70cd57f18f"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"d4100f8da6021f150755d2a71f0ec41c0d8a0984","unresolved":false,"context_lines":[{"line_number":103,"context_line":"\t    sub(/[ \\t]*$/, \"\", attr)"},{"line_number":104,"context_line":"\t    # need to strip leading \u0026 trailing whitespace from value"},{"line_number":105,"context_line":"\t    sub(/^[ \\t]*/, \"\", value)"},{"line_number":106,"context_line":"\t    sub(/[ \\t]*$/, \"\", value)"},{"line_number":107,"context_line":"            print \"iniset \" configfile \" \" section \" \" attr \" \\\"\" value \"\\\"\""},{"line_number":108,"context_line":"        }"},{"line_number":109,"context_line":"    \u0027 | while read a; do eval \"$a\"; done"}],"source_content_type":"text/x-ini","patch_set":4,"id":"baa201ad_9af2a6d0","line":106,"updated":"2014-10-02 18:23:24.000000000","message":"oops, i think it\u0027s the tab character. Can you remove it?","commit_id":"4a1f2095eb13bceb5ca9c1f597ec36254703de3b"},{"author":{"_account_id":842,"name":"Fergal Mc Carthy","email":"fergal.mc.carthy@suse.com","username":"fergal-mccarthy"},"change_message_id":"9cb95bb3b30ee31c96c3ac83bf7dd9ffccec8e07","unresolved":false,"context_lines":[{"line_number":103,"context_line":"\t    sub(/[ \\t]*$/, \"\", attr)"},{"line_number":104,"context_line":"\t    # need to strip leading \u0026 trailing whitespace from value"},{"line_number":105,"context_line":"\t    sub(/^[ \\t]*/, \"\", value)"},{"line_number":106,"context_line":"\t    sub(/[ \\t]*$/, \"\", value)"},{"line_number":107,"context_line":"            print \"iniset \" configfile \" \" section \" \" attr \" \\\"\" value \"\\\"\""},{"line_number":108,"context_line":"        }"},{"line_number":109,"context_line":"    \u0027 | while read a; do eval \"$a\"; done"}],"source_content_type":"text/x-ini","patch_set":4,"id":"baa201ad_b52bfb92","line":106,"in_reply_to":"baa201ad_9af2a6d0","updated":"2014-10-02 19:16:05.000000000","message":"Forgot to expand the tabs before saving ;-)\n\nDone","commit_id":"4a1f2095eb13bceb5ca9c1f597ec36254703de3b"}],"tests/test_config.sh":[{"author":{"_account_id":970,"name":"Dean Troyer","email":"dtroyer@gmail.com","username":"dtroyer"},"change_message_id":"cb3bf53c7d2a851d3f6b768609667998b1a8ebc8","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"[[test6|test-strip.conf]]"},{"line_number":100,"context_line":"[DEFAULT]"},{"line_number":101,"context_line":"# next link has trailing space"},{"line_number":102,"context_line":"attr \u003d strip_trailing_space "},{"line_number":103,"context_line":"EOF"},{"line_number":104,"context_line":""}],"source_content_type":"text/x-sh","patch_set":5,"id":"baa201ad_517c27ec","line":101,"updated":"2014-10-08 16:52:07.000000000","message":"next line","commit_id":"176f9f5511aa664a968b08533814d05f5c36bbb4"},{"author":{"_account_id":842,"name":"Fergal Mc Carthy","email":"fergal.mc.carthy@suse.com","username":"fergal-mccarthy"},"change_message_id":"ea0b521b00903089cc91c2d8f3bf0e65b55f3253","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"[[test6|test-strip.conf]]"},{"line_number":100,"context_line":"[DEFAULT]"},{"line_number":101,"context_line":"# next link has trailing space"},{"line_number":102,"context_line":"attr \u003d strip_trailing_space "},{"line_number":103,"context_line":"EOF"},{"line_number":104,"context_line":""}],"source_content_type":"text/x-sh","patch_set":5,"id":"baa201ad_22f1f095","line":101,"in_reply_to":"baa201ad_517c27ec","updated":"2014-10-09 20:19:02.000000000","message":"Done","commit_id":"176f9f5511aa664a968b08533814d05f5c36bbb4"}]}
