2012-09-01 13:20:14 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ -z "${1}" ]; then
|
|
|
|
echo "${0} <build script name>" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
BUILD_SCRIPT_NAME="${1}"
|
|
|
|
|
|
|
|
SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}"
|
|
|
|
. "${SABAYON_MOLECULE_HOME}/scripts/iso_build.include"
|
|
|
|
|
|
|
|
# Pull new data from Git
|
|
|
|
(
|
2012-09-01 13:48:26 +02:00
|
|
|
flock --timeout ${LOCK_TIMEOUT} -x 9
|
2012-09-01 13:20:14 +02:00
|
|
|
if [ "${?}" != "0" ]; then
|
|
|
|
echo "[git pull] cannot acquire lock, stale process holding it?" >&2
|
2012-09-01 13:48:26 +02:00
|
|
|
kill_stale_process || exit 1
|
2012-09-01 13:20:14 +02:00
|
|
|
fi
|
|
|
|
cd /sabayon && git pull --quiet
|
|
|
|
) 9> "${ISO_BUILD_LOCK}"
|
|
|
|
|
|
|
|
# Execute build
|
|
|
|
(
|
2012-09-01 13:48:26 +02:00
|
|
|
flock --timeout ${LOCK_TIMEOUT} -x 9
|
2012-09-01 13:20:14 +02:00
|
|
|
if [ "${?}" != "0" ]; then
|
|
|
|
echo "[build] cannot acquire lock, stale process holding it?" >&2
|
2012-09-01 13:48:26 +02:00
|
|
|
kill_stale_process || exit 1
|
2012-09-01 13:20:14 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
"${SABAYON_MOLECULE_HOME}/scripts/${BUILD_SCRIPT_NAME}"
|
|
|
|
|
|
|
|
) 9> "${ISO_BUILD_LOCK}"
|
|
|
|
|
|
|
|
exit ${?}
|