From: Michael Prokop Date: Sun, 31 Jan 2010 10:32:21 +0000 (+0100) Subject: Provide buildd as separate Debian package buildd, use nail instead of mutt in buildd... X-Git-Tag: v0.9.35~17 X-Git-Url: https://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=bbc4b9db068e7ed536161680c84fbed328ddb3af Provide buildd as separate Debian package buildd, use nail instead of mutt in buildd for sending mails. Recent Mutt versions introduced an annoying cmdline behaviour change in a patch version upgrade (1.5.x->1.5.y) which breaks sending mails from the cmdline when you've to add several attachments at once and want to stay backward and forward compatible. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=539276 for further details. Therefore get rid of mutt and use nail for sending mails instead. --- diff --git a/buildd/functions.sh b/buildd/functions.sh index 70f7287..97098ee 100755 --- a/buildd/functions.sh +++ b/buildd/functions.sh @@ -13,7 +13,7 @@ die() { . /etc/grml/grml-buildd.conf || die "Could not source /etc/grml/grml-buildd.conf. Exiting." -which mutt >/dev/null 2>&1 || die "mutt binary not found. Exiting." +which nail >/dev/null 2>&1 || die "nail binary not found. Exiting." # exit if important variables aren't set: [ -n "$STORAGE" ] || die "\$STORAGE is not set. Exiting." @@ -26,9 +26,7 @@ which mutt >/dev/null 2>&1 || die "mutt binary not found. Exiting." PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11 DATE=$(date +'%Y%m%d_%H%M%S') TMP_DIR="$(mktemp -d)" -MUTT_HEADERS="$(mktemp)" [ -n "$TMP_DIR" ] || die "Could not create \$TMP_DIR. Exiting." -[ -n "$MUTT_HEADERS" ] || die "Could not create $\MUTT_HEADERS. Exiting." # make sure we have same safe defaults: [ -n "$OUTPUT_DIR" ] || OUTPUT_DIR="${STORAGE}/grml-live_${DATE}.$$" @@ -46,8 +44,6 @@ fi [ -n "$FAI_LOGFILES" ] || FAI_LOGFILES=/var/log/fai/grml/last -echo "my_hdr From: grml-live autobuild daemon <$FROM>" > $MUTT_HEADERS - # execute grml-live: grml_live_run() { if ! [ "$FORCE_REBUILD" = "1" ] ; then @@ -107,8 +103,6 @@ iso_details() { send_mail() { # create logs if using 'send_mail -e' [ "$1" = "-e" ] && create_logs - # attach logs only if we have some: - [ -r "$ATTACHMENT" ] && MUTT_ATTACH="-a $ATTACHMENT" || MUTT_ATTACH='' echo -en "Automatically generated mail by $SCRIPTNAME @@ -139,8 +133,8 @@ $(grep -i "Couldn't find.*package" $FAI_LOGFILES/software.log | sed 's/\(.*\)"\( See attached files: /var/log/grml-buildd.stderr /var/log/grml-buildd.stdout $ATTACHMENT -EOF " | \ - mutt -s "$SCRIPTNAME [${DATE}] - $RC_INFO" -a /var/log/grml-buildd.stderr $MUTT_ATTACH "$RECIPIENT" +EOF" | \ + nail -r "grml-live autobuild daemon <$FROM>" -s "$SCRIPTNAME [${DATE}] - $RC_INFO" -a /var/log/grml-buildd.stderr $ATTACHMENT "$RECIPIENT" } # make sure we store the final iso: @@ -160,9 +154,8 @@ store_iso() { # allow clean exit: bailout() { if [ "$RC" = "0" ] ; then - rm -rf "$TMP_DIR" "$MUTT_HEADERS" "$OUTPUT_DIR" + rm -rf "$TMP_DIR" "$OUTPUT_DIR" else - rm -f "$MUTT_HEADERS" echo "building ISO failed, keeping build files [${OUTPUT_DIR} / ${TMP_DIR}]">&2 fi diff --git a/buildd/grml-buildd.conf b/buildd/grml-buildd.conf index 9c16ab9..c5dcec5 100644 --- a/buildd/grml-buildd.conf +++ b/buildd/grml-buildd.conf @@ -14,7 +14,7 @@ # do you want to force rebuild of already present ISOs? # Set it to '1' to force rebuild, otherwise use '0'. -FORCE_REBUILD=0 +#FORCE_REBUILD=1 # what do you want to use for "From:" in notification mails? # default: root@localhost diff --git a/debian/changelog b/debian/changelog index 605b672..25ef0cf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +grml-live (0.9.35) UNRELEASED; urgency=low + + * No entries yet, will be added when releasing via git-dch. + + -- Michael Prokop Sun, 31 Jan 2010 11:23:03 +0100 + grml-live (0.9.34) unstable; urgency=low * Add scripts/GRMLBASE/38-udev to get rid of automatically generated diff --git a/debian/control b/debian/control index 18e2899..30f734e 100644 --- a/debian/control +++ b/debian/control @@ -37,3 +37,12 @@ Description: log package build information of grml-live to database information about grml-live builds in a sqlite3 database. More details are available in the provided grml-live-db manpage and /usr/share/doc/grml-live-db/grml-live-db.html + +Package: grml-live-buildd +Architecture: all +Depends: ${misc:Depends}, grml-live, nail +Description: autobuild daemon for grml-live + This package provides example scripts for a simple autobuild + daemon for the grml-live framework. Those scripts are used + for creating the official daily grml ISOs provided through + http://daily.grml.org/ diff --git a/debian/grml-live-buildd.dirs b/debian/grml-live-buildd.dirs new file mode 100644 index 0000000..e2dab28 --- /dev/null +++ b/debian/grml-live-buildd.dirs @@ -0,0 +1 @@ +usr/share/grml-live/buildd diff --git a/debian/grml-live-buildd.install b/debian/grml-live-buildd.install new file mode 100644 index 0000000..f964cb2 --- /dev/null +++ b/debian/grml-live-buildd.install @@ -0,0 +1,2 @@ +buildd/grml-buildd.conf etc/grml/ +buildd/*.sh usr/share/grml-live/buildd/ diff --git a/debian/grml-live.dirs b/debian/grml-live.dirs index 2745e0d..0b5c285 100644 --- a/debian/grml-live.dirs +++ b/debian/grml-live.dirs @@ -2,4 +2,3 @@ etc/grml/fai/live-initramfs usr/sbin usr/share/doc/grml-live usr/share/grml-live -usr/share/grml-live/buildd usr/sbin diff --git a/debian/grml-live.install b/debian/grml-live.install index 0f63fb1..ac5fb8c 100644 --- a/debian/grml-live.install +++ b/debian/grml-live.install @@ -1,5 +1,3 @@ -buildd/grml-buildd.conf etc/grml/ -buildd/*.sh usr/share/grml-live/buildd/ docs/grml-live.8 usr/share/man/man8/ docs/grml-live-remaster.8 usr/share/man/man8/ etc/grml etc diff --git a/debian/overrides.grml-live-buildd b/debian/overrides.grml-live-buildd new file mode 100644 index 0000000..9a29849 --- /dev/null +++ b/debian/overrides.grml-live-buildd @@ -0,0 +1 @@ +grml-live-buildd: unknown-section grml diff --git a/debian/rules b/debian/rules index a2e847f..19b0b99 100755 --- a/debian/rules +++ b/debian/rules @@ -98,11 +98,31 @@ grml-live-db: install dh_md5sums -p$@ -P$(b)/$@ dh_builddeb -p$@ -P$(b)/$@ +grml-live-buildd: install + @echo "--- Building: $@" + dh_installdirs -p$@ -P$(b)/$@ + dh_link -p$@ -P$(b)/$@ + dh_installdocs -p$@ -P$(b)/$@ + dh_installchangelogs -p$@ -P$(b)/$@ + dh_install -p$@ -P$(b)/$@ + dh_strip -p$@ -P$(b)/$@ + dh_compress -p$@ -P$(b)/$@ + mkdir -p $(b)/$(@)/usr/share/lintian/overrides/ + cp -av debian/overrides.$(@) $(b)/$(@)/usr/share/lintian/overrides/$(@) + dh_fixperms -p$@ -P$(b)/$@ + dh_makeshlibs -p$@ -P$(b)/$@ -V + dh_installdeb -p$@ -P$(b)/$@ + dh_shlibdeps -p$@ -P$(b)/$@ + dh_installdebconf -p$@ -P$(b)/$@ + dh_gencontrol -p$@ -P$(b)/$@ + dh_md5sums -p$@ -P$(b)/$@ + dh_builddeb -p$@ -P$(b)/$@ + # Build architecture-dependent files here. binary-all: build install # Build architecture-independent files here. -binary-indep: build install grml-live grml-live-addons grml-live-db +binary-indep: build install grml-live grml-live-addons grml-live-db grml-live-buildd binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install diff --git a/grml-live b/grml-live index 39f49f9..d66c995 100755 --- a/grml-live +++ b/grml-live @@ -23,7 +23,7 @@ fi set -e # global variables -GRML_LIVE_VERSION='0.9.34' +GRML_LIVE_VERSION='0.9.35-pre1' PN="$(basename $0)" CMDLINE="$0 $@" SOURCES_LIST_FILE='/etc/grml/fai/apt/sources.list'