)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":12320,"name":"Pino Toscano","email":"ptoscano@redhat.com","username":"ptoscano"},"change_message_id":"1fd3b991f58ab1f8191f5b883bc7d71f38a2f7b8","unresolved":false,"context_lines":[{"line_number":13,"context_line":"install: missing destination file operand after"},{"line_number":14,"context_line":"\u0027/tmp/image.ILFTBYVy/mnt/usr/local/bin/dib-run-parts\u0027"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"The reason is chaining a command in exec bypasses set -e. For example:"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":" exec /bin/ls $(which doesnotexist)"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"ba15a1d1_86a9f67d","line":16,"updated":"2015-09-15 06:47:25.000000000","message":"exec is not the problem here, the same issue happens also if you remove it.","commit_id":"cc9f0d0c4e740aa879665428bc815ee14463619b"},{"author":{"_account_id":12320,"name":"Pino Toscano","email":"ptoscano@redhat.com","username":"ptoscano"},"change_message_id":"1fd3b991f58ab1f8191f5b883bc7d71f38a2f7b8","unresolved":false,"context_lines":[{"line_number":22,"context_line":"Handle the which lookup in a variable to have the script abort"},{"line_number":23,"context_line":"immediately whenever dib-run-parts is not found."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"While at it assert $TARGET_ROOT is set."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Signed-off-by: Dan Duvall \u003cdduvall@wikimedia.org\u003e"},{"line_number":28,"context_line":"Change-Id: Ibb5d7342b0d06483b84f9dd567e1cc0bf90f194e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"ba15a1d1_c6c60e49","line":25,"updated":"2015-09-15 06:47:25.000000000","message":"This is no more in the change.","commit_id":"cc9f0d0c4e740aa879665428bc815ee14463619b"}],"elements/dib-run-parts/root.d/90-base-dib-run-parts":[{"author":{"_account_id":1926,"name":"Derek Higgins","email":"derekh@redhat.com","username":"derekh"},"change_message_id":"87bc12604775e8c5c335bc817bd8229a0637e898","unresolved":false,"context_lines":[{"line_number":6,"context_line":"set -eu"},{"line_number":7,"context_line":"set -o pipefail"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"[ -n $TARGET_ROOT ]"},{"line_number":10,"context_line":"DIB_RUN_PARTS\u003d$(which dib-run-parts)"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"exec sudo install -m 0755 -o root -g root -D \\"}],"source_content_type":"application/x-shellscript","patch_set":1,"id":"da20952f_f981134e","line":9,"updated":"2015-09-11 16:20:07.000000000","message":"This allows the script to continue when TARGET_ROOT is set but an empty string (on bash 4.3.39), I think it should probably treat both cases the same.\n\nAlso in the case of a undefined variable \"[ -n \" is redundant as the error being triggered by\n    TARGET_ROOT: unbound variable","commit_id":"ec7040f360d0fab6858c75674108d88afcf383ac"},{"author":{"_account_id":2475,"name":"Antoine Musso","email":"hashar@free.fr","username":"hashar"},"change_message_id":"dfe5859306cc5a430c01e0c83eb81a944703889f","unresolved":false,"context_lines":[{"line_number":6,"context_line":"set -eu"},{"line_number":7,"context_line":"set -o pipefail"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"[ -n $TARGET_ROOT ]"},{"line_number":10,"context_line":"DIB_RUN_PARTS\u003d$(which dib-run-parts)"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"exec sudo install -m 0755 -o root -g root -D \\"}],"source_content_type":"application/x-shellscript","patch_set":1,"id":"ba15a1d1_cc80af49","line":9,"in_reply_to":"da20952f_f981134e","updated":"2015-09-12 07:36:41.000000000","message":"I am not sure why I added it, removing in next PS","commit_id":"ec7040f360d0fab6858c75674108d88afcf383ac"},{"author":{"_account_id":12320,"name":"Pino Toscano","email":"ptoscano@redhat.com","username":"ptoscano"},"change_message_id":"b085f0221792a1923b9dc2fe092c71835ab8865e","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"DIB_RUN_PARTS\u003d$(which dib-run-parts)"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"exec sudo install -m 0755 -o root -g root -D \\"},{"line_number":12,"context_line":"    $DIB_RUN_PARTS \\"},{"line_number":13,"context_line":"    $TARGET_ROOT/usr/local/bin/dib-run-parts"}],"source_content_type":"application/x-shellscript","patch_set":2,"id":"ba15a1d1_4f030a74","line":11,"updated":"2015-09-14 16:59:00.000000000","message":"I just wonder why the exec here is needed at all, and https://review.openstack.org/#/c/21982/ does not explain that.\n\nWhat about just drop the exec and the -o/-g arguments (see https://review.openstack.org/#/c/221042/ )?","commit_id":"cc9f0d0c4e740aa879665428bc815ee14463619b"},{"author":{"_account_id":2475,"name":"Antoine Musso","email":"hashar@free.fr","username":"hashar"},"change_message_id":"9995b91ac9df189929900347175bce8fe71434df","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"DIB_RUN_PARTS\u003d$(which dib-run-parts)"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"exec sudo install -m 0755 -o root -g root -D \\"},{"line_number":12,"context_line":"    $DIB_RUN_PARTS \\"},{"line_number":13,"context_line":"    $TARGET_ROOT/usr/local/bin/dib-run-parts"}],"source_content_type":"application/x-shellscript","patch_set":2,"id":"ba15a1d1_757c9472","line":11,"in_reply_to":"ba15a1d1_4f030a74","updated":"2015-09-14 20:48:35.000000000","message":"For -o/-g, I guess it is all about being explicit.  This way it is obvious the file belong to root:root.\n\nI do not think the exec is actually of any use here.\n\nMight be done in another change probably.  This change is just to make sure which dig-run-parts fails the script properly.","commit_id":"cc9f0d0c4e740aa879665428bc815ee14463619b"},{"author":{"_account_id":12320,"name":"Pino Toscano","email":"ptoscano@redhat.com","username":"ptoscano"},"change_message_id":"1fd3b991f58ab1f8191f5b883bc7d71f38a2f7b8","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"DIB_RUN_PARTS\u003d$(which dib-run-parts)"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"exec sudo install -m 0755 -o root -g root -D \\"},{"line_number":12,"context_line":"    $DIB_RUN_PARTS \\"},{"line_number":13,"context_line":"    $TARGET_ROOT/usr/local/bin/dib-run-parts"}],"source_content_type":"application/x-shellscript","patch_set":2,"id":"ba15a1d1_8651f6da","line":11,"in_reply_to":"ba15a1d1_757c9472","updated":"2015-09-15 06:47:25.000000000","message":"\u003e For -o/-g, I guess it is all about being explicit.\n\nIt is simply redundant, see https://review.openstack.org/#/c/221042/\n\n\u003e This change is just to make sure which dig-run-parts fails the script properly.\n\nOk, but then please add a short comment to $DIB_RUN_PARTS above, so it is not changed back in the future.","commit_id":"cc9f0d0c4e740aa879665428bc815ee14463619b"},{"author":{"_account_id":2475,"name":"Antoine Musso","email":"hashar@free.fr","username":"hashar"},"change_message_id":"7ba2bb8797e138cb55fdd3f75ff35f27e398e812","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"DIB_RUN_PARTS\u003d$(which dib-run-parts)"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"exec sudo install -m 0755 -o root -g root -D \\"},{"line_number":12,"context_line":"    $DIB_RUN_PARTS \\"},{"line_number":13,"context_line":"    $TARGET_ROOT/usr/local/bin/dib-run-parts"}],"source_content_type":"application/x-shellscript","patch_set":2,"id":"9a061dce_7a8f63cc","line":11,"in_reply_to":"ba15a1d1_8651f6da","updated":"2016-04-05 14:27:08.000000000","message":"Will add a comment explaining the which is in a variable in order to generate a proper error message.","commit_id":"cc9f0d0c4e740aa879665428bc815ee14463619b"}]}
