X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=buildd%2Ffunctions.sh;h=70f728784196bc5e1351a8bd702f7f48ef299436;hb=91d417296f39959abc322089fcafd9bdf1ea0c82;hp=c7d9ebcfc157b9a01ba5238fa7c34218e226b0d0;hpb=08dce3af0da758cda35dc98b2819f4f6efb00c07;p=grml-live.git diff --git a/buildd/functions.sh b/buildd/functions.sh index c7d9ebc..70f7287 100755 --- a/buildd/functions.sh +++ b/buildd/functions.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Filename: /usr/share/grml-live/buildd/functions.sh # Purpose: main function file for grml-live buildd # Authors: grml-team (grml.org), (c) Michael Prokop @@ -13,7 +13,7 @@ die() { . /etc/grml/grml-buildd.conf || die "Could not source /etc/grml/grml-buildd.conf. Exiting." -type -p mutt 1>/dev/null 2>&1 || die "mutt binary not found. 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." @@ -24,12 +24,11 @@ type -p mutt 1>/dev/null 2>&1 || die "mutt binary not found. Exiting." # some defaults: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11 -DATE="$(date +%Y%m%d)" +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." -[ -n "$ARCH" ] && GRML_LIVE_ARCH="-a $ARCH" # make sure we have same safe defaults: [ -n "$OUTPUT_DIR" ] || OUTPUT_DIR="${STORAGE}/grml-live_${DATE}.$$" @@ -37,6 +36,7 @@ MUTT_HEADERS="$(mktemp)" [ -n "$RECIPIENT" ] || RECIPIENT=root@localhost [ -n "$ATTACHMENT" ] || ATTACHMENT="$TMP_DIR/grml-live-logs_$DATE.tar.gz" [ -n "$FROM" ] || FROM=root@localhost +[ -n "$ARCH" ] || ARCH="$(dpkg --print-architecture)" if [ -n "$LOGFILE" ] ; then GRML_LOGFILE="$LOGFILE" @@ -69,7 +69,7 @@ grml_live_run() { grml_name="$NAME-daily-$CODENAME" shortdate="$(date +%y%m%d)" - grml-live -F $* $GRML_LIVE_ARCH -s $SUITE -c $CLASSES -o $OUTPUT_DIR \ + grml-live -F $* -a $ARCH -s $SUITE -c $CLASSES -o $OUTPUT_DIR \ -g "$grml_name" -v "$shortdate" -r grml-live-autobuild -i $ISO_NAME \ 1>/var/log/grml-buildd.stdout \ 2>/var/log/grml-buildd.stderr ; RC=$? @@ -90,8 +90,7 @@ create_logs() { # store logs on remote server: upload_logs() { [ -n "$RSYNC_MIRROR" ] || return 1 - umask 002 - rsync --exclude dmesg.log --times --partial --copy-links -az --quiet /var/log/grml-buildd.* \ + rsync --exclude dmesg.log --times --partial --copy-links -rltDz --quiet /var/log/grml-buildd.* \ $FAI_LOGFILES $GRML_LOGFILE $RSYNC_MIRROR/logs/"${NAME}_${DATE}"/ }