summaryrefslogtreecommitdiffstats
path: root/makeself
diff options
context:
space:
mode:
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2017-03-27 01:05:40 +0300
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2017-03-27 01:05:40 +0300
commit856d016c8e0376f8f40bbd9d19f58e896e1f0b5a (patch)
treeee83c9b0e6f03447d418c501392c41b2340838c6 /makeself
parent53ab0a3f36c040d6dc7a9c3630c7e509608e1afe (diff)
absolute references to several paths
Diffstat (limited to 'makeself')
-rwxr-xr-xmakeself/build.sh2
-rwxr-xr-xmakeself/functions.sh21
-rwxr-xr-xmakeself/run-all-jobs.sh8
3 files changed, 21 insertions, 10 deletions
diff --git a/makeself/build.sh b/makeself/build.sh
index 502f263ed2..5c1e060709 100755
--- a/makeself/build.sh
+++ b/makeself/build.sh
@@ -44,7 +44,7 @@ target Linux system cannot compile netdata.
EOF
-read "Press ENTER to continue > "
+read -p "Press ENTER to continue > "
if [ ! -d tmp ]
then
diff --git a/makeself/functions.sh b/makeself/functions.sh
index 84dd76a5a5..458e2129d2 100755
--- a/makeself/functions.sh
+++ b/makeself/functions.sh
@@ -15,12 +15,21 @@ set -euo pipefail
# -----------------------------------------------------------------------------
fetch() {
- local dir="${1}" url="${2}"
- local tar="${dir}.tar.gz"
-
- [ ! -f "tmp/${tar}" ] && run wget -O "tmp/${tar}" "${url}"
- [ ! -d "tmp/${dir}" ] && cd tmp && run tar -zxvpf "${tar}"
- run cd "tmp/${dir}"
+ local dir="${1}" url="${2}"
+ local tar="${dir}.tar.gz"
+
+ if [ ! -f "${NETDATA_MAKESELF_PATH}/tmp/${tar}" ]
+ then
+ run wget -O "${NETDATA_MAKESELF_PATH}/tmp/${tar}" "${url}"
+ fi
+
+ if [ ! -d "${NETDATA_MAKESELF_PATH}/tmp/${dir}" ]
+ then
+ cd "${NETDATA_MAKESELF_PATH}/tmp"
+ run tar -zxvpf "${tar}"
+ fi
+
+ run cd "${NETDATA_MAKESELF_PATH}/tmp/${dir}"
}
# -----------------------------------------------------------------------------
diff --git a/makeself/run-all-jobs.sh b/makeself/run-all-jobs.sh
index 8be355e79f..4c3236c15a 100755
--- a/makeself/run-all-jobs.sh
+++ b/makeself/run-all-jobs.sh
@@ -8,7 +8,7 @@ renice 19 $$ >/dev/null 2>/dev/null
# prepare the environment for the jobs
export NETDATA_INSTALL_PATH="${1-/opt/netdata}"
-export NETDATA_MAKESELF_PATH="$(pwd)"
+export NETDATA_MAKESELF_PATH="$(dirname "${0}")"
export NETDATA_SOURCE_PATH="${NETDATA_MAKESELF_PATH}/.."
PROCESSORS=$(cat /proc/cpuinfo 2>/dev/null | grep ^processor | wc -l)
@@ -18,9 +18,11 @@ export PROCESSORS
# make sure ${NULL} is empty
export NULL=
-. $(dirname "${0}")/functions.sh "${@}" || exit 1
+cd "${NETDATA_MAKESELF_PATH}" || exit 1
-for x in $(dirname "${0}")/*.install.sh
+. ./functions.sh "${@}" || exit 1
+
+for x in jobs/*.install.sh
do
progress "running ${x}"
"${x}" "${NETDATA_INSTALL_PATH}"