Skip to content

Commit

Permalink
Replace which by bash-builtin hash
Browse files Browse the repository at this point in the history
Reportedly, which is not installed by default on all non-windows
systems bazel is used. As we only use which to test if a program
can be found on PATH, use the bash builtin hash command. While there
- replace the search for [ by a search for tr, a program we care more,
  as [ is the builtin test anyway,
- fix a typo in the name of the GNU tools collection searched for.

Change-Id: Id78737eba10e96c6fa41ca68a47102ab28e6031f
PiperOrigin-RevId: 166685117
  • Loading branch information
aehlig authored and vladmos committed Aug 28, 2017
1 parent 26ad43d commit 27db2d8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ esac

# Check that the bintools can be found, otherwise we would see very confusing
# error messages.
which [ >&/dev/null || {
echo >&2 "ERROR: cannot locate GNU bintools; check your PATH."
hash tr >&/dev/null || {
echo >&2 "ERROR: cannot locate GNU coreutils; check your PATH."
echo >&2 " (You may need to run 'export PATH=/bin:/usr/bin:\$PATH)'"
exit 1
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/docker/Dockerfile.centos6.7
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM centos:centos6.7
RUN yum -y upgrade

RUN yum -y install \
wget which git findutils binutils \
wget git findutils binutils \
zip unzip tar gzip zlib-devel \
clang gcc gcc-c++ \
java java-devel java-1.8.0-openjdk-devel \
Expand Down
2 changes: 1 addition & 1 deletion src/test/docker/Dockerfile.fedora23
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM fedora:23

RUN dnf -y update && dnf clean all
RUN dnf -y install \
which findutils binutils gcc tar git \
findutils binutils gcc tar git \
gzip zip unzip zlib-devel \
clang java java-devel python \
&& dnf clean all
Expand Down

0 comments on commit 27db2d8

Please sign in to comment.