[Dev] [dbscripts] [PATCH 24/31] test: common.bash: Move __buildPackage() up in the file

Luke Shumaker lukeshu at lukeshu.com
Fri Apr 6 18:43:57 GMT 2018


From: Luke Shumaker <lukeshu at parabola.nu>

For merge-conflict reasons.
---
 test/lib/common.bash | 68 ++++++++++++++++++++++++++--------------------------
 1 file changed, 34 insertions(+), 34 deletions(-)

diff --git a/test/lib/common.bash b/test/lib/common.bash
index dab16a5..ea01a2d 100644
--- a/test/lib/common.bash
+++ b/test/lib/common.bash
@@ -34,6 +34,40 @@ __getCheckSum() {
 	echo "${result%% *}"
 }
 
+__buildPackage() {
+	local arch=$1
+	local p
+	local checkSum
+	local pkgnames
+
+	if [[ -n ${PACKAGE_CACHE} ]]; then
+		checkSum=$(__getCheckSum PKGBUILD)
+			# TODO: Be more specific
+			if cp -av ${PACKAGE_CACHE}/${checkSum}/*-${arch}${PKGEXT}{,.sig} .; then
+				return 0
+			fi
+	fi
+
+	if [ "${arch}" == 'any' ]; then
+		sudo librechroot -n "dbscripts@${arch}" make
+	else
+		sudo librechroot -n "dbscripts@${arch}" -A "$arch" make
+	fi
+	sudo libremakepkg -n "dbscripts@${arch}"
+
+	pkgnames=($(. PKGBUILD; print_all_package_names))
+	for p in ${pkgnames[@]/%/${PKGEXT}}; do
+		[[ ${p} = *-${arch}${PKGEXT} ]] || continue
+		# Manually sign packages as "makepkg --sign" is buggy
+		gpg -v --detach-sign --no-armor --use-agent ${p}
+
+		if [[ -n ${PACKAGE_CACHE} ]]; then
+			mkdir -p ${PACKAGE_CACHE}/${checkSum}
+			cp -Lv ${p}{,.sig} ${PACKAGE_CACHE}/${checkSum}/
+		fi
+	done
+}
+
 setup() {
 	local p
 	local pkg
@@ -118,40 +152,6 @@ releasePackage() {
 	popd
 }
 
-__buildPackage() {
-	local arch=$1
-	local p
-	local checkSum
-	local pkgnames
-
-	if [[ -n ${PACKAGE_CACHE} ]]; then
-		checkSum=$(__getCheckSum PKGBUILD)
-			# TODO: Be more specific
-			if cp -av ${PACKAGE_CACHE}/${checkSum}/*-${arch}${PKGEXT}{,.sig} .; then
-				return 0
-			fi
-	fi
-
-	if [ "${arch}" == 'any' ]; then
-		sudo librechroot -n "dbscripts@${arch}" make
-	else
-		sudo librechroot -n "dbscripts@${arch}" -A "$arch" make
-	fi
-	sudo libremakepkg -n "dbscripts@${arch}"
-
-	pkgnames=($(. PKGBUILD; print_all_package_names))
-	for p in ${pkgnames[@]/%/${PKGEXT}}; do
-		[[ ${p} = *-${arch}${PKGEXT} ]] || continue
-		# Manually sign packages as "makepkg --sign" is buggy
-		gpg -v --detach-sign --no-armor --use-agent ${p}
-
-		if [[ -n ${PACKAGE_CACHE} ]]; then
-			mkdir -p ${PACKAGE_CACHE}/${checkSum}
-			cp -Lv ${p}{,.sig} ${PACKAGE_CACHE}/${checkSum}/
-		fi
-	done
-}
-
 updatePackage() {
 	local pkgbase=$1
 	local arch=$2
-- 
2.16.2




More information about the Dev mailing list