From 94852cd393687f955d352cf2a0686b3e802c4c9e Mon Sep 17 00:00:00 2001
From: Chizi123 <build@jsrv.com>
Date: Fri, 30 Oct 2020 05:39:56 +0000
Subject: [PATCH] fixed working with zoom exception

---
 main.sh |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/main.sh b/main.sh
index 97179a8..2974e8f 100755
--- a/main.sh
+++ b/main.sh
@@ -47,7 +47,7 @@
 # Usage: build_pkg [package name] [-f force]
 function build_pkg {
 	#check if PKGBUILD has updated, don't rebuild if hasn't changed
-	if [[ -n "$(git pull | grep 'Already up to date.')" && -z "$(grep 'pkgver() {' PKGBUILD)" && -z "$2" ]]; then
+	if [[ -n "$(git pull | grep 'Already up to date.')" && -z "$(grep 'pkgver[[:space:]]() {' PKGBUILD)" && -z "$2" ]]; then
 		return 2
 	fi
 
@@ -81,6 +81,16 @@
 	done
 	while read -r -d '' x; do pkgs+=("$x"); done < <(printf "%s\0" "${ipkgs[@]}" | sort -uz)
 
+	# Weird exceptions
+	if [[ "$1" == "zoom" ]]; then
+		rm zoom*_orig*
+		for i in ${pkgs[@]}; do
+			if [ -z "${i##*_orig*}" ]; then
+				pkgs=(${pkgs[@]/$i})
+			fi
+		done
+	fi
+
 	#Move package to repodir and add to repo db
 	#Dont change the database if rebuilt the same package at same release and version
 	flag=0
@@ -97,16 +107,6 @@
 		done
 	else 
 		return;
-	fi
-
-	# Weird exceptions
-	if [[ "$1" == "zoom" ]]; then
-		rm zoom*_orig*.pkg.tar.xz
-		for i in ${pkgs[@]}; do
-			if [ -z "${i##*orig*}" ]; then
-				pkgs=${pkgs[@]/$i}
-			fi
-		done
 	fi
 
 	# Add package to waiting list to be added to repo db
@@ -131,7 +131,7 @@
 					sleep 1
 				else
 					# Remove self from top of queue
-					echo 1 > $WAITLST_LCK
+					echo 1 > $WAITLIST_LCK
 					TEMP=$(mktemp)
 					tail -n +2 $WAITLIST > $TEMP
 					cp $TEMP $WAITLIST
@@ -252,7 +252,6 @@
 	rmlist="$rmlist $(comm -12 <(pacman -Slq $REPONAME | sort) <(pacman -Slq core | sort) | tr '\n' ' ')"
 	rmlist="$rmlist $(comm -12 <(pacman -Slq $REPONAME | sort) <(pacman -Slq extra | sort) | tr '\n' ' ')"
 	rmlist="$rmlist $(comm -12 <(pacman -Slq $REPONAME | sort) <(pacman -Slq community | sort) | tr '\n' ' ')"
-	removed=()
 	TMPFILE=$(mktemp)
 	for i in $(find $BUILDDIR -mindepth 1 -maxdepth 1 -type d); do
 		check_pkg $TMPFILE "$(echo $i | rev | cut -d'/' -f1 | rev)" &

--
Gitblit v1.9.3