let modules to be easily disabled

This commit is contained in:
belliash 2012-01-20 11:51:33 +01:00
parent 7de4c1f440
commit 916260efa9
2 changed files with 52 additions and 40 deletions

27
ezsync
View File

@ -49,6 +49,9 @@ until [[ -z "${1}" ]]; do
-s|--syscheck)
EZOPT_SYSCHECKONLY=true
;;
-t|--notrigger)
EZOPT_NOTRIGGER=true
;;
*)
die "Unrecognized option ${1}"
;;
@ -98,7 +101,8 @@ eval `keychain --noask --eval id_dsa id_rsa &> /dev/null`
[ ${?} -ne 0 ] && die "EzBuild was unable to load public keys!" 1
# Execute all 'presync' enabled modules
for MODULE in ${MODULES_PRESYNC}; do
if ! isEnabled ${EZOPT_NOTRIGGER}; then
for MODULE in ${MODULES_PRESYNC}; do
loadModule ${MODULE} "presync"
RESULT=${?}
if [ ${RESULT} -eq 255 ]; then
@ -107,7 +111,8 @@ for MODULE in ${MODULES_PRESYNC}; do
fail "EzBuild was unable to execute module: ${MODULE}!" 255
fi
unloadModule
done
done
fi
# Update local copy of Portage that is being built
printInfo "Refreshing constructed Portage tree..."
@ -142,7 +147,8 @@ for OVERLAY in ${SYNC_OVERLAYS[*]}; do
done
# Execute all 'postsync' enabled modules
for MODULE in ${MODULES_POSTSYNC}; do
if ! isEnabled ${EZOPT_NOTRIGGER}; then
for MODULE in ${MODULES_POSTSYNC}; do
loadModule ${MODULE} "postsync"
RESULT=${?}
if [ ${RESULT} -eq 255 ]; then
@ -151,7 +157,8 @@ for MODULE in ${MODULES_POSTSYNC}; do
fail "EzBuild was unable to execute module: ${MODULE}!" 255
fi
unloadModule
done
done
fi
# Optionally merge data into build overlay
if isSet MERGED_OVERLAY && isSet OVERLAY_BUILD; then
@ -184,7 +191,8 @@ for OVERLAY in ${MERGED_PORTAGE[*]}; do
done
# Execute all 'precommit' enabled modules
for MODULE in ${MODULES_PRECOMMIT}; do
if ! isEnabled ${EZOPT_NOTRIGGER}; then
for MODULE in ${MODULES_PRECOMMIT}; do
loadModule ${MODULE} "precommit"
RESULT=${?}
if [ ${RESULT} -eq 255 ]; then
@ -193,7 +201,8 @@ for MODULE in ${MODULES_PRECOMMIT}; do
fail "EzBuild was unable to execute module: ${MODULE}!" 255
fi
unloadModule
done
done
fi
# Regenerate Portage cache
printInfo "Updating constructed Portage cache..."
@ -208,7 +217,8 @@ if ! isEnabled ${EZOPT_NOPUSH}; then
fi
# Execute all 'postcommit' enabled modules
for MODULE in ${MODULES_POSTCOMMIT}; do
if ! isEnabled ${EZOPT_NOTRIGGER}; then
for MODULE in ${MODULES_POSTCOMMIT}; do
loadModule ${MODULE} "postcommit"
RESULT=${?}
if [ ${RESULT} -eq 255 ]; then
@ -217,7 +227,8 @@ for MODULE in ${MODULES_POSTCOMMIT}; do
fail "EzBuild was unable to execute module: ${MODULE}!" 255
fi
unloadModule
done
done
fi
# Finally quit the application
quit

View File

@ -422,6 +422,7 @@ function showEzsyncUsage() {
echo -e " -p\t--purge\t\tclears temporary folder"
echo -e " -P\t--purgeonly\tclears temporary folder and exits"
echo -e " -s\t--syscheck\tperforms prerequisites check only"
echo -e " -t\t--notrigger\tdisables all build triggers and modules"
echo -e "\nEXAMPLES:"
echo -e " ezsync -c -n mainline"
echo -e " ezsync -n mainline -n my_repo1"