Permalink
Browse files

Don't assume that bash is in /bin

  • Loading branch information...
1 parent 3fe7e80 commit 22b433a32c55f4329c5b9f626b405915763c1c59 @fperrin fperrin committed Aug 29, 2011
View
@@ -152,7 +152,9 @@ uninstall:
# Install our ocamlbuild-generation engine
install-bld:
@mkdir -p $(INSTALL_DIR)/bin
- @echo "#!/bin/bash -ue" > $(INSTALL_DIR)/bin/bld
+ @echo "#!/usr/bin/env bash" > $(INSTALL_DIR)/bin/bld
+ @echo "set -e" >> $(INSTALL_DIR)/bin/bld
+ @echo "set -u" >> $(INSTALL_DIR)/bin/bld
@chmod 755 $(INSTALL_DIR)/bin/bld
@echo "BLDDIR=$(PREFIX)/share/opa/bld $(PREFIX)/share/opa/bld/gen_myocamlbuild.sh" >> $(INSTALL_DIR)/bin/bld
@echo "_build/myocamlbuild -no-plugin -j 6 \"\$$@\"" >> $(INSTALL_DIR)/bin/bld
@@ -164,7 +166,9 @@ install-bld:
install-qmlflat: # depends on opabsl_for_compiler, but we don't want to run ocamlbuild twice
@mkdir -p $(INSTALL_DIR)/bin $(INSTALL_DIR)/share/opa/mlstatebsl
@$(INSTALL) $(BUILD_DIR)/opabsl/mlstatebsl/opabslgen_*.opa $(INSTALL_DIR)/share/opa/mlstatebsl
- @echo "#!/bin/bash -ue" > $(INSTALL_DIR)/bin/qmlflat
+ @echo "#!/usr/bin/env bash" > $(INSTALL_DIR)/bin/qmlflat
+ @echo "set -e" >> $(INSTALL_DIR)/bin/qmlflat
+ @echo "set -u" >> $(INSTALL_DIR)/bin/qmlflat
@chmod 755 $(INSTALL_DIR)/bin/qmlflat
@echo 'exec opa --no-stdlib --no-server --no-cps --no-closure --no-ei --no-constant-sharing --no-undot --separated off --value-restriction disabled --no-warn duplicateL0 --no-warn typer.warncoerce --no-warn unused --no-discard-of-unused-stdlib --no-warn pattern $$(if ! grep -qE "(^| )--no-stdlib( |$$)" <<<"$$*"; then echo $(shell sed "s%^[^# ]\+%$(PREFIX)/share/opa/mlstatebsl/opabslgen_&%; t OK; d; :OK" opabsl/mlstatebsl/bsl-sources); fi) "$$@"' \
>> $(INSTALL_DIR)/bin/qmlflat
View
@@ -1,4 +1,7 @@
-#!/bin/bash -ue
+#!/usr/bin/env bash
+
+set -u
+set -e
# README BEFORE EDITING THIS FILE!
#
@@ -1,4 +1,7 @@
-#!/bin/bash -ue
+#!/usr/bin/env bash
+
+set -u
+set -e
# This script reads files config.{sh,ml}, build_rules*.ml, build_libs, build_tools and uses them
# to build an ocamlbuild plugin in <build_dir>/myocamlbuild
@@ -1,4 +1,7 @@
-#!/bin/bash -eu
+#!/usr/bin/env bash
+
+set -e
+set -u
# Copyright © 2011 MLstate
# This file is part of OPA.
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This script is used for generating opa files and packages dependency graphs
# It is meant to be called from any directory containing some .opx/ directories
View
@@ -1,4 +1,7 @@
-#!/bin/bash -ue
+#!/usr/bin/env bash
+
+set -u
+set -e
: ${OPA_SOURCE_DIR:=$(dirname $0)}
if [ "${OPA_SOURCE_DIR#/}" = "$OPA_SOURCE_DIR" ]; then OPA_SOURCE_DIR=$PWD/$OPA_SOURCE_DIR; fi
@@ -1,4 +1,7 @@
-#!/bin/bash -ue
+#!/usr/bin/env bash
+
+set -u
+set -e
SCRIPTDIR=$(dirname $0)
cd $SCRIPTDIR
@@ -1,4 +1,7 @@
-#!/bin/bash -ue
+#!/usr/bin/env bash
+
+set -u
+set -e
#
# Copyright © 2011 MLstate
View
@@ -1,4 +1,6 @@
-#!/bin/bash -e
+#!/usr/bin/env bash
+
+set -e
help () (
echo "$0:"
View
@@ -1,4 +1,7 @@
-#!/bin/bash -eu
+#!/usr/bin/env bash
+
+set -e
+set -u
. ./platform_helper.sh
View
@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/usr/bin/env bash
rlwrap ocamlbase.top -I $MLSTATELIBS/lib/opa/static $@
View
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
P=$MLSTATELIBS/lib/opa/static
OPA=$P/opabslgen.bypass
View
@@ -1,4 +1,7 @@
-#!/bin/bash -eu
+#!/usr/bin/env bash
+
+set -e
+set -u
#PREFIX=/usr
INSTALLDIR=$PWD/release_install_root
@@ -123,7 +126,10 @@ if [ -n "$AUTOINSTALL" ]; then
AUTOINSTALL=${AUTOINSTALL//\{\}/$VERSION_STRING}
msg "Making $AUTOINSTALL"
cat >"$INSTALLDIR/install.sh" <<EOF
-#!/bin/bash -eu
+#!/usr/bin/env bash
+
+set -e
+set -u
if [ -n "\${1:-}" ]; then
echo "Installing in \$1"
@@ -164,7 +170,10 @@ EOF
chmod a+x "$INSTALLDIR/install.sh"
cat >"$INSTALLDIR/share/opa/uninstall.sh" <<"EOF"
-#!/bin/bash -eu
+#!/usr/bin/env bash
+
+set -e
+set -u
SCRIPT="$0"
if [ "${SCRIPT:0:1}" != "/" ]; then
View
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
export ROOT=`pwd`
View
@@ -1,4 +1,7 @@
-#!/bin/bash -eu
+#!/usr/bin/env bash
+
+set -e
+set -u
# Include in your scripts to detect the host platform and have appropriate
# aliases set for some commands (eg use the GNU versions on a mac)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# script used to generate the list of packages
DIRS=$(find . -type d | sed "s/.\///")
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#java-bench.lst obtained with:
# find /home/koper/soft/jdk-1_5_0-src-jrl/ -type f -name '*.java' ! -exec grep -q '#warn' {} \; -print > ./teerex/java/java-bench.lst
#we ignore files containing #warn as they need some preprocessing
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
CC_DIR="$OPAGENERAL/tools/jschecker"
CC="$CC_DIR/compiler.jar"
View
@@ -1,4 +1,6 @@
-#!/bin/bash -e
+#!/usr/bin/env bash
+
+set -e
skip=1

0 comments on commit 22b433a

Please sign in to comment.