@@ -41,25 +41,20 @@ usage() {
4141 echo " --prefix=/some/path set the prefix path (default=/usr/local)." >&2
4242 echo " --bin= set the binary folder path (default=%prefix%/bin)." >&2
4343 echo " --base= set the base install path (default=%prefix%/lib/bazel)." >&2
44- echo " --bazelrc= set the path to bazelrc (default=/etc/bazel.bazelrc)." >&2
4544 echo " --user configure for user install, expands to:" >&2
46- echo ' --bin=$HOME/bin --base=$HOME/.bazel --bazelrc=$HOME/.bazelrc ' >&2
45+ echo ' --bin=$HOME/bin --base=$HOME/.bazel' >&2
4746 exit 1
4847}
4948
5049prefix=" /usr/local"
5150bin=" %prefix%/bin"
5251base=" %prefix%/lib/bazel"
53- bazelrc=" /etc/bazel.bazelrc"
5452
5553for opt in " ${@ } " ; do
5654 case $opt in
5755 --prefix=* )
5856 prefix=" $( echo " $opt " | cut -d ' =' -f 2-) "
5957 ;;
60- --bazelrc=* )
61- bazelrc=" $( echo " $opt " | cut -d ' =' -f 2-) "
62- ;;
6358 --bin=* )
6459 bin=" $( echo " $opt " | cut -d ' =' -f 2-) "
6560 ;;
@@ -69,7 +64,6 @@ for opt in "${@}"; do
6964 --user)
7065 bin=" $HOME /bin"
7166 base=" $HOME /.bazel"
72- bazelrc=" $HOME /.bazelrc"
7367 ;;
7468 * )
7569 usage
7973
8074bin=" ${bin//% prefix%/ ${prefix} } "
8175base=" ${base//% prefix%/ ${prefix} } "
82- bazelrc=" ${bazelrc//% prefix%/ ${prefix} } "
8376
8477test_write () {
8578 local file=" $1 "
133126# Test for write access
134127test_write " ${bin} "
135128test_write " ${base} "
136- test_write " ${bazelrc} "
137129
138130# Do the actual installation
139131echo -n " Uncompressing."
@@ -159,17 +151,7 @@ echo -n .
159151ln -s " ${base} /bin/bazel" " ${bin} /bazel"
160152echo -n .
161153
162- if [ -f " ${bazelrc} " ]; then
163- echo
164- echo " ${bazelrc} already exists, moving it to ${bazelrc} .bak."
165- mv " ${bazelrc} " " ${bazelrc} .bak"
166- fi
167-
168- # Not necessary, but this way it matches the Debian package.
169- touch " ${bazelrc} "
170- if [ " ${UID} " -eq 0 ]; then
171- chmod 0644 " ${bazelrc} "
172- else
154+ if [ " ${UID} " -ne 0 ]; then
173155 # Uncompress the bazel base install for faster startup time
174156 " ${bin} /bazel" help > /dev/null
175157fi
0 commit comments