From ac333faecc1cced5c465f57aa1070f981ac19f3e Mon Sep 17 00:00:00 2001
From: Joel Grunbaum <joelgrun@gmail.com>
Date: Sun, 20 Sep 2020 08:16:59 +0000
Subject: [PATCH] Modified email message

---
 main.sh |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/main.sh b/main.sh
index 64be697..62d0f10 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
@@ -169,7 +171,11 @@
 		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
+				echo "To: $EMAIL
+					 Subject: Build errors
+
+					 There were build errors for the build at $(date), please address them soon
+					 The errors were: $ERRORS" | sendmail -t
 			fi
 		else
 			echo "All packages built successfully"

--
Gitblit v1.9.3