From 86d762dc31655e4677678ec643ab3024f42753e3 Mon Sep 17 00:00:00 2001 From: Chizi123 <build@jsrv.com> Date: Sun, 20 Sep 2020 23:21:20 +0000 Subject: [PATCH] modified email message --- main.sh | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-) diff --git a/main.sh b/main.sh index d222d14..86de2d6 100755 --- a/main.sh +++ b/main.sh @@ -50,7 +50,7 @@ fi #remove old versions before build - rm $1*.pkg.tar.xz + rm *$1*.pkg.tar.xz* #make and force rebuild if is git package makepkg -s --noconfirm $([ $CLEAN == "Y" ] && echo "-c") $([ $SIGN == "Y" ] && echo "--sign --key $KEY") $([ "$2" == "-f" ] && echo -f) @@ -64,9 +64,10 @@ #latest="$(newold_matching_file n '*.pkg.tar.xz')" #or f in $(find g.tar.xz' #o - rm $REPODIR/$1*.pkg.tar.xz - cp $1*.pkg.tar.xz $REPODIR/ - repo-add $([ "$SIGN" == "Y" ] && echo "--sign --key $KEY") $REPODIR/$REPONAME.db.tar.xz $REPODIR/$1*.pkg.tar.xz + rm $REPODIR/*$1*.pkg.tar.xz* + cp *$1*.pkg.tar.xz $REPODIR/ + [ "$SIGN" == "Y" ] && cp *$1*.pkg.tar.xz.sig $REPODIR + repo-add $([ "$SIGN" == "Y" ] && echo "--sign --key $KEY") $REPODIR/$REPONAME.db.tar.xz $REPODIR/*$1*.pkg.tar.xz #one #Remove old versions of packages @@ -87,6 +88,7 @@ if [ $UPDATE == "Y" ]; then sudo pacman -Syu --noconfirm fi + #update every package currently stored for d in $(find $BUILDDIR -maxdepth 1 -mindepth 1 -type d) do @@ -104,7 +106,7 @@ cd $BUILDDIR git clone https://aur.archlinux.org/$1.git cd $1 - build_pkg $1 new + build_pkg $1 new -f return 0 } @@ -159,6 +161,16 @@ return 0 } +function send_email { + ( + echo "From: build@localhost" + echo "To: $EMAIL" + echo "Subject: Build errors" + echo "There were build errors for the build at $(date), please address them soon." + echo "The errors were: $ERRORS" + ) | sendmail -t +} + case $1 in "init") init;; @@ -169,7 +181,7 @@ if [ "$ERRORS" != "" ]; then echo "Errors in packages $ERRORS" if [ "$EMAIL" != "" ]; then - printf "Build for $(date)\nErrors found in $ERRORS\nPlease address these soon" | sendmail $EMAIL + send_email fi else echo "All packages built successfully" @@ -178,5 +190,5 @@ "remove") remove $2;; *) - printf "Invalid usage\nUsage: $0 init|add|build_all\n";; + printf "Invalid usage\nUsage: $0 init|add|build-all\n";; esac -- Gitblit v1.9.3