Provide buildd as separate Debian package buildd, use nail instead of mutt in buildd...
authorMichael Prokop <mika@grml.org>
Sun, 31 Jan 2010 10:32:21 +0000 (11:32 +0100)
committerMichael Prokop <mika@grml.org>
Sun, 31 Jan 2010 10:49:05 +0000 (11:49 +0100)
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.

buildd/functions.sh
buildd/grml-buildd.conf
debian/changelog
debian/control
debian/grml-live-buildd.dirs [new file with mode: 0644]
debian/grml-live-buildd.install [new file with mode: 0644]
debian/grml-live.dirs
debian/grml-live.install
debian/overrides.grml-live-buildd [new file with mode: 0644]
debian/rules
grml-live

index 70f7287..97098ee 100755 (executable)
@@ -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
 
index 9c16ab9..c5dcec5 100644 (file)
@@ -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
index 605b672..25ef0cf 100644 (file)
@@ -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 <mika@grml.org>  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
index 18e2899..30f734e 100644 (file)
@@ -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 (file)
index 0000000..e2dab28
--- /dev/null
@@ -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 (file)
index 0000000..f964cb2
--- /dev/null
@@ -0,0 +1,2 @@
+buildd/grml-buildd.conf     etc/grml/
+buildd/*.sh                 usr/share/grml-live/buildd/
index 2745e0d..0b5c285 100644 (file)
@@ -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
index 0f63fb1..ac5fb8c 100644 (file)
@@ -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 (file)
index 0000000..9a29849
--- /dev/null
@@ -0,0 +1 @@
+grml-live-buildd: unknown-section grml
index a2e847f..19b0b99 100755 (executable)
@@ -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
index 39f49f9..d66c995 100755 (executable)
--- 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'