Remove grml-live-buildd package
[grml-live.git] / buildd / functions.sh
diff --git a/buildd/functions.sh b/buildd/functions.sh
deleted file mode 100755 (executable)
index a960d6f..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-#!/bin/sh
-# Filename:      /usr/share/grml-live/buildd/functions.sh
-# Purpose:       main function file for grml-live buildd
-# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
-# Bug-Reports:   see http://grml.org/bugs/
-# License:       This file is licensed under the GPL v2 or any later version.
-################################################################################
-
-die() {
-  [ -n "$1" ] && echo "$1">&2
-  exit 1
-}
-
-. /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."
-
-# exit if important variables aren't set:
-[ -n "$STORAGE" ]  || die "\$STORAGE is not set. Exiting."
-[ -n "$SUITE" ]    || die "\$SUITE is not set. Exiting."
-[ -n "$CLASSES" ]  || die "\$CLASSES is not set. Exiting."
-[ -n "$NAME" ]     || die "\$NAME is not set. Exiting."
-[ -n "$PRODUCT_NAME" ] || die "\$PRODUCT_NAME is not set. Exiting."
-
-# some defaults:
-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)"
-[ -n "$TMP_DIR" ]      || die "Could not create \$TMP_DIR. Exiting."
-ISO_NAME="${PRODUCT_NAME}.iso"
-
-# make sure we have same safe defaults:
-[ -n "$OUTPUT_DIR" ]    || OUTPUT_DIR="${STORAGE}/grml-live_${DATE}.$$"
-[ -n "$ISO_DIR" ]       || ISO_DIR=$STORAGE/grml-isos
-[ -n "$RECIPIENT" ]     || RECIPIENT=root@localhost
-[ -n "$FROM" ]          || FROM=root@localhost
-[ -n "$ARCH" ]          || ARCH="$(dpkg --print-architecture)"
-MIRROR_LOG_PATH="logs/${PRODUCT_NAME}_${DATE}"
-
-if [ -n "$LOGFILE" ] ; then
-   GRML_LOGFILE="$LOGFILE"
-else
-   [ -n "$GRML_LOGFILE" ]  || GRML_LOGFILE=/var/log/grml-live.log
-fi
-
-[ -n "$FAI_LOGFILES" ]  || FAI_LOGFILES=/var/log/fai/grml/last
-
-# execute grml-live:
-grml_live_run() {
-  if ! [ "$FORCE_REBUILD" = "1" ] ; then
-     if [ -f "$ISO_DIR/$ISO_NAME" ] ; then
-        echo "$ISO_DIR/$ISO_NAME exists already. Nothing to be done, exiting."
-        exit 0
-     fi
-  fi
-
-  # workaround the 32 chars limit of mkisofs -V ....
-  # 'grml64-small-daily-squeeze 090223' is too long
-  case $SUITE in
-    sid)      CODENAME=sid   ;;
-    squeeze)  CODENAME=squ   ;;
-    wheezy)   CODENAME=wheez ;;
-    lenny)    CODENAME=lenny ;;
-    etch)     CODENAME=etch  ;;
-  esac
-
-  grml_name="$NAME-daily-$CODENAME"
-  shortdate="$(date +%y%m%d)"
-
-  TIME_START=$(date +%s)
-  grml-live -F $* -a $ARCH -s $SUITE -c $CLASSES -o $OUTPUT_DIR \
-            -g "$grml_name" -v "$shortdate" -r grml-live-autobuild -i $ISO_NAME \
-             >/var/log/grml-buildd.log 2>&1 ; RC=$?
-  TIME_END=$(date +%s)
-  WALLTIME=$(($TIME_END-$TIME_START))
-
-  if [ "$RC" = "0" ] ; then
-     RC_INFO=success
-  else
-     RC_INFO=error
-     return 1
-  fi
-}
-
-# store logs on remote server:
-upload_logs() {
-  [ -n "$RSYNC_MIRROR" ] || return 1
-  rsync --exclude dmesg.log --times --partial --copy-links -rltDz --quiet /var/log/grml-buildd.log \
-  $FAI_LOGFILES/* $GRML_LOGFILE $RSYNC_MIRROR/$MIRROR_LOG_PATH/
-}
-
-# store information of ISO size:
-iso_details() {
-  if ! [ -f "$OUTPUT_DIR/grml_isos/$ISO_NAME" ] ; then
-     ISO_DETAILS="There was an error creating $ISO_NAME"
-  else
-     ISO_DETAILS=$(ls -lh $OUTPUT_DIR/grml_isos/$ISO_NAME)
-  fi
-}
-
-# send status mail:
-send_mail() {
-  echo "$ISO_DETAILS
-
-Return code of grml-live was: $RC
-Time: $WALLTIME
-
-Full logs at: $MIRROR_URL/$MIRROR_LOG_PATH/
-
-$(grep -A2 'Executed grml-live' $GRML_LOGFILE || echo "* executed grml-live command line not available")
-
-$(grep -A2 'Executed FAI' $GRML_LOGFILE || echo "* executed FAI command line not available")
-
-The following errors have been noticed (several might be warnings only):
-
-$(grep -i error $FAI_LOGFILES/*.log /var/log/grml-buildd.log | grep -ve liberror -ve libgpg-error -ve libcomerr -ve 'no errors found' || echo "* nothing")
-
-The following errors have been noticed in FAI scripts:
-
-$(grep -B2 "FAILED with exit code" $FAI_LOGFILES/* | echo "* nothing")
-
-The following warnings have been noticed:
-
-$(grep -i warn $FAI_LOGFILES/* /var/log/grml-buildd.log || echo "* nothing")
-
-There following dependency problems have been noticed:
-
-$(grep -i "Not Installed" $FAI_LOGFILES/software.log || echo "* nothing")
-
-The following packages could not be installed:
-
-$(grep -i "Couldn't find.*package" $FAI_LOGFILES/software.log | sed 's/\(.*\)"\(.*\)"\(.*\)/\2/' | sort -u || echo "* nothing")
-
-See full logs for further details.
-
---" "
-Automatically generated mail by $SCRIPTNAME
-" | \
-  mutt -e "my_hdr From: grml-live autobuild daemon <$FROM>" -s "$PRODUCT_NAME - $RC_INFO" \
-       -a /var/log/grml-buildd.log -- "$RECIPIENT"
-}
-
-# make sure we store the final iso:
-store_iso() {
-  if [ "$RC" = "0" ] ; then
-     [ -d "$ISO_DIR" ] || mkdir "$ISO_DIR"
-     mv "${OUTPUT_DIR}/grml_isos/${ISO_NAME}" "$ISO_DIR"
-     if [ -r "${OUTPUT_DIR}/grml_isos/${ISO_NAME}.md5" ] ; then
-        mv   "${OUTPUT_DIR}/grml_isos/${ISO_NAME}.md5" "${ISO_DIR}"
-     fi
-     if [ -r "${OUTPUT_DIR}/grml_isos/${ISO_NAME}.sha1" ] ; then
-        mv   "${OUTPUT_DIR}/grml_isos/${ISO_NAME}.sha1" "${ISO_DIR}"
-     fi
-  fi
-}
-
-# allow clean exit:
-bailout() {
-  if [ "$RC" = "0" ] ; then
-     rm -rf "$TMP_DIR" "$OUTPUT_DIR"
-  else
-     echo "building ISO failed, keeping build files [${OUTPUT_DIR} / ${TMP_DIR}]">&2
-  fi
-
-}
-
-trap bailout 1 2 3 15
-
-## END OF FILE #################################################################