Browse Source

Add more events: precommit & postcommit

master
belliash 8 years ago
parent
commit
814b9a406b
1 changed files with 24 additions and 0 deletions
  1. +24
    -0
      ezsync

+ 24
- 0
ezsync View File

@@ -182,10 +182,34 @@ for OVERLAY in ${MERGED_PORTAGE[*]}; do
fi
done

# Execute all 'precommit' enabled modules
for MODULE in ${MODULES_PRECOMMIT}; do
loadModule ${MODULE} "precommit"
RESULT=${?}
if [ ${RESULT} -eq 255 ]; then
printWarn "Trying to load module: ${MODULE}, that is incompatible with event: precommit!"
elif [ ${RESULT} -ne 0 ]; then
fail "EzBuild was unable to execute module: ${MODULE}!"
fi
unloadModule
done

# Regenerate Portage cache
printInfo "Updating constructed Portage cache..."
run "FEATURES="metadata-transfer" PORTDIR="${PORTAGESDIR}/${PORTAGE_BUILD[0]}" egencache --update --portdir=${PORTAGESDIR}/${PORTAGE_BUILD[0]} --jobs=${MAXJOBS} --load-average=${LOADAVERAGE} --tolerant"
[ ${?} -ne 0 ] && die "EzBuild was unable to regenerate cache!"

# Execute all 'postcommit' enabled modules
for MODULE in ${MODULES_POSTCOMMIT}; do
loadModule ${MODULE} "postcommit"
RESULT=${?}
if [ ${RESULT} -eq 255 ]; then
printWarn "Trying to load module: ${MODULE}, that is incompatible with event: postcommit!"
elif [ ${RESULT} -ne 0 ]; then
fail "EzBuild was unable to execute module: ${MODULE}!"
fi
unloadModule
done

# Finally quit the application
quit

Loading…
Cancel
Save