aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/packages/template_bin.sh
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2016-09-27 20:55:55 +0000
committerGravatar Yun Peng <pcloudy@google.com>2016-09-28 08:27:49 +0000
commitc5545fd0896f3c602a9be0986debed6f0c9c662d (patch)
tree3b500cc4625f224dc2c32ffa83673963c081052a /scripts/packages/template_bin.sh
parent65e3ae6228bd179ef9ed80ebc817f829e180496e (diff)
*** Reason for rollback *** Broke installation on latest release. Fixes #1846 *** Original change description *** Reintroduce .bazelrc and set --action_env defaults Shipping a .bazelrc was removed in 009b48bcfaf4ebb17f9ab03bea9036cfa3c12ff0. However, as per our "Specifying environment variables for actions" design document, we want to ship a global rc file specifying the common environment variables to be inherited. So revert that change and add the desired entries to the global bazelrc file we're shipping. -- MOS_MIGRATED_REVID=134450299
Diffstat (limited to 'scripts/packages/template_bin.sh')
-rwxr-xr-xscripts/packages/template_bin.sh22
1 files changed, 4 insertions, 18 deletions
diff --git a/scripts/packages/template_bin.sh b/scripts/packages/template_bin.sh
index 69837f4ad7..ceb58c83de 100755
--- a/scripts/packages/template_bin.sh
+++ b/scripts/packages/template_bin.sh
@@ -41,16 +41,14 @@ usage() {
echo " --prefix=/some/path set the prefix path (default=/usr/local)." >&2
echo " --bin= set the binary folder path (default=%prefix%/bin)." >&2
echo " --base= set the base install path (default=%prefix%/lib/bazel)." >&2
- echo " --bazelrc= set the path to bazelrc (default=/etc/bazel.bazelrc)." >&2
echo " --user configure for user install, expands to:" >&2
- echo ' --bin=$HOME/bin --base=$HOME/.bazel --bazelrc=$HOME/.bazelrc' >&2
+ echo ' --bin=$HOME/bin --base=$HOME/.bazel' >&2
exit 1
}
prefix="/usr/local"
bin="%prefix%/bin"
base="%prefix%/lib/bazel"
-bazelrc="/etc/bazel.bazelrc"
for opt in "${@}"; do
case $opt in
@@ -58,7 +56,8 @@ for opt in "${@}"; do
prefix="$(echo "$opt" | cut -d '=' -f 2-)"
;;
--bazelrc=*)
- bazelrc="$(echo "$opt" | cut -d '=' -f 2-)"
+ # TODO(kchodorow): remove once everything we're testing on CI contains
+ # this comment.
;;
--bin=*)
bin="$(echo "$opt" | cut -d '=' -f 2-)"
@@ -69,7 +68,6 @@ for opt in "${@}"; do
--user)
bin="$HOME/bin"
base="$HOME/.bazel"
- bazelrc="$HOME/.bazelrc"
;;
*)
usage
@@ -79,7 +77,6 @@ done
bin="${bin//%prefix%/${prefix}}"
base="${base//%prefix%/${prefix}}"
-bazelrc="${bazelrc//%prefix%/${prefix}}"
test_write() {
local file="$1"
@@ -133,7 +130,6 @@ fi
# Test for write access
test_write "${bin}"
test_write "${base}"
-test_write "${bazelrc}"
# Do the actual installation
echo -n "Uncompressing."
@@ -159,17 +155,7 @@ echo -n .
ln -s "${base}/bin/bazel" "${bin}/bazel"
echo -n .
-if [ -f "${bazelrc}" ]; then
- echo
- echo "${bazelrc} already exists, moving it to ${bazelrc}.bak."
- mv "${bazelrc}" "${bazelrc}.bak"
-fi
-
-# Not necessary, but this way it matches the Debian package.
-touch "${bazelrc}"
-if [ "${UID}" -eq 0 ]; then
- chmod 0644 "${bazelrc}"
-else
+if [ "${UID}" -ne 0 ]; then
# Uncompress the bazel base install for faster startup time
"${bin}/bazel" help >/dev/null
fi