diff options
author | Mike Frysinger <vapier@gentoo.org> | 2012-09-28 18:30:54 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2012-09-28 18:30:54 +0000 |
commit | 931f581536ca0edfd942e69b6ac8a749bcff9439 (patch) | |
tree | b2b8a05f1d422df0bf566a8c88f3d78f12c3581b /scripts/cronjob.sh | |
parent | convert scripts to use wget as that is less likely to be removed (like lynx),... (diff) | |
download | toolchain-931f581536ca0edfd942e69b6ac8a749bcff9439.tar.gz toolchain-931f581536ca0edfd942e69b6ac8a749bcff9439.tar.bz2 toolchain-931f581536ca0edfd942e69b6ac8a749bcff9439.zip |
add metadata generation to the cronjob script
Diffstat (limited to 'scripts/cronjob.sh')
-rwxr-xr-x | scripts/cronjob.sh | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/scripts/cronjob.sh b/scripts/cronjob.sh index 19c9a3f..19dfc49 100755 --- a/scripts/cronjob.sh +++ b/scripts/cronjob.sh @@ -2,6 +2,7 @@ # Make sure we only have one instance running at a time. [[ ${FLOCKER} != $0 ]] && exec env FLOCKER=$0 flock -en $0 -c "$0 $*" || : +NCPUS=$(getconf _NPROCESSORS_ONLN) set -e cd "${0%/*}"/.. @@ -10,10 +11,7 @@ cd "${0%/*}"/.. svn revert -R . svn up -q -doit() { - ./scripts/update-$1 - cd sys-devel/$1 - +svn_commit() { # Just in case someone else made a commit before we did. svn up -q @@ -21,13 +19,29 @@ doit() { # given files that already exist. svn add -q --force * || : - [[ -z $(svn st | grep -v '[^AM]') ]] - svn commit -m "update $1 snapshots" + local st=$(svn st .) + + local d=$(echo "${st}" | awk '$1 == "!" { print $NF }') + if [[ -n ${d} ]] ; then + svn rm ${d} + fi + if [[ -n $(svn st . | grep -v '[^AM]') ]] ; then + svn commit -m "$1" . + fi +} +doit() { + ./scripts/update-$1 + cd sys-devel/$1 + svn_commit "update $1 snapshots" cd ../.. } doit gcc doit gdb +egencache --repo=toolchain --update --portdir-overlay="${PWD}" -j ${NCPUS:-1} +cd metadata +svn_commit "update metadata" + ) >& scripts/cronjob.log |