#!/bin/sh # ARCH_ARCHIVE: always # represents the archive on which the action is being performed # # ARCH_LOCATION: make-archive # gives the location of the archive being prepared by tla # # ARCH_REVISION: import, tag, commit # gives the exact revision being (import|tagg|commit)ed # # ARCH_CATEGORY: make-category # gives the category being prepared (format: category) # # ARCH_BRANCH: make-branch # gives the branch being prepared (format: category--branch) # # ARCH_VERSION: make-version # gives the version being prepared (format: category--branch--version) # # ARCH_TREE_ROOT: commit, import # gives the location of the working tree from which tla is performing # the action # # ARCH_TAGGED_ARCHIVE: tag # gives the archive of the revision from which tla will create the tag # # ARCH_TAGGED_REVISION # gives the revision from which tla will create the tagged version ARCH_ACTION="$1" doPrepLog() { tla cat-archive-log "${ARCH_ARCHIVE}/${ARCH_REVISION}" } doMirror() { tla push-mirror "${ARCH_ARCHIVE}" "`tla parse-package-name --package-version $ARCH_REVISION`" } doSendMail() { local recipients="${1}" mutt -s "arch ${ARCH_ACTION}: ${ARCH_REVISION}" -i "${logfile}" -e 'unset signature' ${recipients} } case "${ARCH_ACTION}" in commit | import) ARCH_CATEGORY="`tla parse-package-name --category $ARCH_REVISION`" ARCH_BRANCH="`tla parse-package-name --branch $ARCH_REVISION`" logfile="`tempfile`" doPrepLog > "${logfile}" case "${ARCH_ARCHIVE}" in address@hidden) if [ "${ARCH_CATEGORY}" != "test" ] ; then doMirror fi doSendMail sascha-arch-commit-"${ARCH_CATEGORY}"@silbe.org ;; address@hidden) doSendMail address@hidden doMirror ;; esac rm "${logfile}" ;; esac