svn commit: r288342 - user/gjb/thermite

Glen Barber gjb at FreeBSD.org
Mon Sep 28 17:25:49 UTC 2015


Author: gjb
Date: Mon Sep 28 17:25:48 2015
New Revision: 288342
URL: https://svnweb.freebsd.org/changeset/base/288342

Log:
  Re-sync with the re@ scripts.
  
  - Allow specifying the sender in send_logmail() where it is
    not ideal to have mail sent from a human address.
  
  - Only set SVNREVISION and BUILDDATE to the contents of the
    relevant files if otherwise unset.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  user/gjb/thermite/master.conf
  user/gjb/thermite/thermite.sh

Modified: user/gjb/thermite/master.conf
==============================================================================
--- user/gjb/thermite/master.conf	Mon Sep 28 16:33:38 2015	(r288341)
+++ user/gjb/thermite/master.conf	Mon Sep 28 17:25:48 2015	(r288342)
@@ -9,6 +9,7 @@
 
 use_zfs=1
 emailgoesto=
+emailsentfrom=
 scriptdir="$(dirname $(realpath ${0}))"
 srcdir="${scriptdir}/../release"
 logdir="${scriptdir}/../logs"

Modified: user/gjb/thermite/thermite.sh
==============================================================================
--- user/gjb/thermite/thermite.sh	Mon Sep 28 16:33:38 2015	(r288341)
+++ user/gjb/thermite/thermite.sh	Mon Sep 28 17:25:48 2015	(r288342)
@@ -233,12 +233,14 @@ prebuild_setup() {
 # Email log output when a stage has completed
 send_logmail() {
 	[ -z "${emailgoesto}" ] && return 0
+	[ -z "${emailsentfrom}" ] && return 0
 	local _body
 	local _subject
-	_body="${1}"
 	_subject="${2}"
-	tail -n 50 "${_body}" | \
-		mail -s "${_subject} done" ${emailgoesto}
+	_body="$(tail -n 50 ${1})"
+
+	printf "From: ${emailsentfrom}\nTo: ${emailgoesto}\nSubject: ${_subject}\n\n${_body}\n\n" \
+		| /usr/sbin/sendmail -oi -f ${emailsentfrom} ${emailgoesto}
 	return 0
 }
 
@@ -253,9 +255,11 @@ ftp_stage() {
 	info "Staging for ftp: ${_build}"
 	[ ! -z "${EMBEDDEDBUILD}" ] && export EMBEDDEDBUILD
 	[ ! -z "${BOARDNAME}" ] && export BOARDNAME
-	[ -e "${scriptdir}/svnrev_src" ] && \
+	[ ! -z "${SVNREVISION}" ] && export SVNREVISION
+	[ ! -z "${BUILDDATE}" ] && export BUILDDATE
+	[ -z "${SVNREVISION}" -a -e "${scriptdir}/svnrev_src" ] && \
 		export SVNREVISION="$(cat ${scriptdir}/svnrev_src)"
-	[ -e "${scriptdir}/builddate" ] && \
+	[ -z "${BUILDDATE}" -a -e "${scriptdir}/builddate" ] && \
 		export BUILDDATE="$(cat ${scriptdir}/builddate)"
 	chroot ${CHROOTDIR} make -C /usr/src/release \
 		-f Makefile.mirrors \


More information about the svn-src-user mailing list