2015-10-03 12:11:29 +00:00
|
|
|
# Add current directory to PATH
|
|
|
|
export PATH="$(pwd):$PATH"
|
|
|
|
|
|
|
|
# Manage the travis build
|
|
|
|
ct-ng_travis_build()
|
|
|
|
{
|
2015-12-08 17:09:49 +00:00
|
|
|
# Override the log behaviour
|
|
|
|
sed -i -e 's/^.*\(CT_LOG_ERROR\).*$/# \1 is not set/' \
|
|
|
|
-e 's/^.*\(CT_LOG_WARN\).*$/# \1 is not set/' \
|
|
|
|
-e 's/^.*\(CT_LOG_INFO\).*$/# \1 is not set/' \
|
|
|
|
-e 's/^.*\(CT_LOG_EXTRA\).*$/\1=y/' \
|
|
|
|
-e 's/^.*\(CT_LOG_ALL\).*$/# \1 is not set/' \
|
|
|
|
-e 's/^.*\(CT_LOG_DEBUG\).*$/# \1 is not set/' \
|
|
|
|
-e 's/^.*\(CT_LOG_LEVEL_MAX\).*$/\1="EXTRA"/' \
|
|
|
|
-e 's/^.*\(CT_LOG_PROGRESS_BAR\).*$/# \1 is not set/' \
|
|
|
|
-e 's/^.*\(CT_LOCAL_TARBALLS_DIR\).*$/\1="${HOME}\/src"/' \
|
|
|
|
-e 's/^.*\(CT_SAVE_TARBALLS\).*$/\1=y/' \
|
|
|
|
.config
|
2015-10-03 12:11:29 +00:00
|
|
|
|
2015-12-08 17:09:49 +00:00
|
|
|
# Build the sample
|
2017-06-15 20:54:40 +00:00
|
|
|
ct-ng build.8 &
|
2015-12-08 17:09:49 +00:00
|
|
|
local build_pid=$!
|
2015-10-03 12:11:29 +00:00
|
|
|
|
2015-12-08 17:09:49 +00:00
|
|
|
# Start a runner task to print a "still running" line every 5 minutes
|
|
|
|
# to avoid travis to think that the build is stuck
|
|
|
|
{
|
|
|
|
while true
|
|
|
|
do
|
|
|
|
sleep 300
|
|
|
|
printf "Crosstool-NG is still running ...\r"
|
|
|
|
done
|
|
|
|
} &
|
|
|
|
local runner_pid=$!
|
2015-10-03 12:11:29 +00:00
|
|
|
|
2015-12-08 17:09:49 +00:00
|
|
|
# Wait for the build to finish and get the result
|
|
|
|
wait $build_pid 2>/dev/null
|
|
|
|
local result=$?
|
2015-10-03 12:11:29 +00:00
|
|
|
|
2015-12-08 17:09:49 +00:00
|
|
|
# Stop the runner task
|
|
|
|
kill $runner_pid
|
|
|
|
wait $runner_pid 2>/dev/null
|
2015-10-03 12:11:29 +00:00
|
|
|
|
2015-12-08 17:09:49 +00:00
|
|
|
# Return the result
|
|
|
|
return $result
|
2015-10-03 12:11:29 +00:00
|
|
|
}
|