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

91
ezsync
View File

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

View File

@ -422,6 +422,7 @@ function showEzsyncUsage() {
echo -e " -p\t--purge\t\tclears temporary folder" echo -e " -p\t--purge\t\tclears temporary folder"
echo -e " -P\t--purgeonly\tclears temporary folder and exits" echo -e " -P\t--purgeonly\tclears temporary folder and exits"
echo -e " -s\t--syscheck\tperforms prerequisites check only" 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 "\nEXAMPLES:"
echo -e " ezsync -c -n mainline" echo -e " ezsync -c -n mainline"
echo -e " ezsync -n mainline -n my_repo1" echo -e " ezsync -n mainline -n my_repo1"