molecules/scripts/cleanup_pkgcache_locked.sh
2012-09-01 13:48:26 +02:00

14 lines
431 B
Bash
Executable File

# Path to molecules.git dir
SABAYON_MOLECULE_HOME="${SABAYON_MOLECULE_HOME:-/sabayon}"
. "${SABAYON_MOLECULE_HOME}/scripts/iso_build.include"
(
flock --timeout ${LOCK_TIMEOUT} -x 9
if [ "${?}" != "0" ]; then
echo "[cleanup] cannot acquire lock, stale process holding it?" >&2
kill_stale_process || exit 1
fi
"${SABAYON_MOLECULE_HOME}/scripts/cleanup_pkgcache.sh"
) 9> "${ISO_BUILD_LOCK}"
exit ${?}