forked from cmccabe/cmccabe-hbin
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathant-install-tar.sh
More file actions
executable file
·32 lines (27 loc) · 857 Bytes
/
ant-install-tar.sh
File metadata and controls
executable file
·32 lines (27 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
die() {
echo $@
exit 1
}
[ -d "${HADOOP_HOME_BASE}" ] || die "can't find HADOOP_HOME_BASE directory"
#res=./build/hadoop-1.1.0-SNAPSHOT-amd64-bin.tar.gz
if [ -e ./build/hadoop-*SNAPSHOT-bin.tar.gz ]; then
res=./build/hadoop-*SNAPSHOT-bin.tar.gz
elif [ -e ./build/hadoop-*bin.tar.gz ]; then
res=./build/hadoop-*bin.tar.gz
else
res=./build/hadoop-*.tar.gz
fi
[ -f ${res} ] || die "can't find tar"
rm -rf "${HADOOP_HOME_BASE}"
mkdir "${HADOOP_HOME_BASE}"
tar xvzf ${res} --strip-components=1 -C "${HADOOP_HOME_BASE}" || die "failed to untar"
# symlink stuff in bin to sbin so that I don't have to remember what was moved
mkdir -p ${HADOOP_HOME_BASE}/sbin
pushd ${HADOOP_HOME_BASE}/bin
for f in *; do
ln -s `readlink -f $f` ../sbin/$f
done
popd &> /dev/null
# make binaries executable
chmod +x ${HADOOP_HOME_BASE}/bin/*