servo: Merge #12299 - Fix up shell scripts (from jimberlage:fixup-scripts); r=emilio
authorJim Berlage <jberlage@mdsol.com>
Thu, 07 Jul 2016 16:24:52 -0700
changeset 339232 ee01a50543f71a61fbdbd15622eca3b9429cb034
parent 339231 ce48f125d31f532186fa0d2719a4e11c213270a8
child 339233 ccd6c8cbd829b4dece6dd421ebe329d4f64d48b2
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
servo: Merge #12299 - Fix up shell scripts (from jimberlage:fixup-scripts); r=emilio <!-- Please describe your changes on the following line: --> This brings these two scripts in line with the style guidelines. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because it's a small change to bring some shell scripts in line with the style guide <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 1f5c26a320af170a44f43dee4dcb076a6c5593e2
servo/ports/geckolib/gecko_bindings/tools/regen.sh
servo/ports/geckolib/gecko_bindings/tools/setup_bindgen.sh
--- a/servo/ports/geckolib/gecko_bindings/tools/regen.sh
+++ b/servo/ports/geckolib/gecko_bindings/tools/regen.sh
@@ -1,24 +1,33 @@
-#!/bin/bash
+#!/usr/bin/env bash
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+set -o errexit
+set -o nounset
+set -o pipefail
 
 if [ $# -eq 0 ]; then
   echo "Usage: $0 /path/to/gecko/objdir [other-regen.py-flags]"
   exit 1
 fi
 
 # Check for rust-bindgen
 if [ ! -d rust-bindgen ]; then
   echo "rust-bindgen not found. Run setup_bindgen.sh first."
   exit 1
 fi
 
 # Check for /usr/include
 if [ ! -d /usr/include ]; then
-  echo "/usr/include doesn't exist. Mac users may need to run xcode-select --install."
+  echo "/usr/include doesn't exist." \
+       "Mac users may need to run xcode-select --install."
   exit 1
 fi
 
 if [ "$(uname)" == "Linux" ]; then
   LIBCLANG_PATH=/usr/lib/llvm-3.8/lib;
 else
   LIBCLANG_PATH=`brew --prefix llvm38`/lib/llvm-3.8/lib;
 fi
--- a/servo/ports/geckolib/gecko_bindings/tools/setup_bindgen.sh
+++ b/servo/ports/geckolib/gecko_bindings/tools/setup_bindgen.sh
@@ -1,23 +1,32 @@
-#!/bin/bash
+#!/usr/bin/env bash
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+set -o errexit
+set -o nounset
+set -o pipefail
 
 # Run in the tools directory.
 cd "$(dirname $0)"
 
 # Setup and build bindgen.
 if [ "$(uname)" == "Linux" ]; then
   export LIBCLANG_PATH=/usr/lib/llvm-3.8/lib;
 else
   export LIBCLANG_PATH=`brew --prefix llvm38`/lib/llvm-3.8/lib;
 fi
 
 # Make sure we have llvm38.
 if [ ! -x "$(command -v clang-3.8)" ]; then
-    echo "llmv38 must be installed. Mac users should |brew install llvm38|, Linux varies by distro."
+    echo "llmv38 must be installed." \
+         "Mac users should |brew install llvm38|, Linux varies by distro."
     exit 1
 fi
 
 export LD_LIBRARY_PATH=$LIBCLANG_PATH
 export DYLD_LIBRARY_PATH=$LIBCLANG_PATH
 
 # Check for multirust
 if [ ! -x "$(command -v multirust)" ]; then