Skip to content

Commit

Permalink
move bash flag to set statement (#3494)
Browse files Browse the repository at this point in the history
Passing bash with flags to the first argument of /usr/bin/env requires
its own flag to interpret it correctly.  Rather than use `env -S` to
split the argument, have the script `set -e` to enable the same behavior
explicitly in preinst and postinst scripts.

Also set `-o pipefail` for consistency.

Closes: #3492

Signed-off-by: Cole White <cwhite@wikimedia.org>
(cherry picked from commit 2fbf335)
  • Loading branch information
shdubsh authored and github-actions[bot] committed Jun 3, 2022
1 parent ae8b3a7 commit e93a4c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion buildSrc/src/main/resources/deb/postinst.ftl
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/usr/bin/env bash -e
#!/usr/bin/env bash
set -e -o pipefail
<% commands.each {command -> %><%= command %><% } %>
3 changes: 2 additions & 1 deletion buildSrc/src/main/resources/deb/preinst.ftl
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/usr/bin/env bash -e
#!/usr/bin/env bash
set -e -o pipefail
<% commands.each {command -> %><%= command %><% } %>

0 comments on commit e93a4c4

Please sign in to comment.