summaryrefslogblamecommitdiff
path: root/system/abuild/noarch.patch
blob: 8c61d32a6e1a6b772312beff7808cfca797905d6 (plain) (tree)



















































































































                                                                                                                      
diff --git a/abuild.in b/abuild.in
index b0c0f9c..a6a0fe1 100644
--- a/abuild.in
+++ b/abuild.in
@@ -516,7 +516,7 @@ cleanpkg() {
 	rm -f "$REPODEST/$repo/src/$pkgname-$pkgver-r$pkgrel.src.tar.gz"
 	for i in $allpackages; do
 		subpkg_set "$i"
-		[ "$subpkgarch" = "noarch" ] && subpkgarch="$CARCH"
+		list_has noarch "$subpkgarch" && subpkgarch="$CARCH"
 		rm -f "$REPODEST/$repo/$subpkgarch/$subpkgname-$pkgver-r$pkgrel.apk"
 	done
 	subpkg_unset
@@ -931,7 +931,7 @@ prepare_metafiles() {
 
 	if [ "$arch" != "$apkbuild_arch" ]; then
 		local msg="Split function set arch=\"$arch\" for $name, use subpackages=pkg:split:arch format instead"
-		[ "$arch" != "noarch" ] && die "$msg"
+		! list_has noarch "$arch" && die "$msg"
 		warning "$msg"
 		subpkgarch="$arch"
 	fi
@@ -1027,7 +1027,7 @@ prepare_metafiles() {
 prepare_trace_rpaths() {
 	local dir="${subpkgdir:-$pkgdir}"
 	local etype= soname= file= sover=
-	[ "${subpkgarch:-$pkgarch}" = "noarch" ] && return 0
+	list_has noarch "${subpkgarch:-$pkgarch}" && return 0
 	options_has "!tracedeps" && return 0
 	# lets tell all the places we should look for .so files - all rpaths
 	scanelf --quiet --recursive --rpath "$dir" \
@@ -1115,10 +1115,10 @@ is_openrc_pkg() {
 archcheck() {
 	options_has "!archcheck" && return 0
 	if dir_has_arch_binaries "${subpkgdir:-$pkgdir}"; then
-		[ "${subpkgarch:-$pkgarch}" != "noarch" ] && return 0
+		! list_has noarch "${subpkgarch:-$pkgarch}" && return 0
 		error "Arch specific binaries found so arch must not be set to \"noarch\""
 		return 1
-	elif [ "${subpkgarch:-$pkgarch}" != "noarch" ] && ! is_dev_pkg; then
+	elif ! list_has noarch "${subpkgarch:-$pkgarch}" && ! is_dev_pkg; then
 		# we dont want -dev package go to noarch
 		warning "No arch specific binaries found so arch should probably be set to \"noarch\""
 	fi
@@ -1317,7 +1317,7 @@ scan_shared_objects() {
 	local name="$1" controldir="$2" datadir="$3"
 	local opt= i=
 
-	if [ "${subpkgarch:-$pkgarch}" = "noarch" ]; then
+	if list_has noarch "${subpkgarch:-$pkgarch}"; then
 		return 0
 	fi
 
@@ -1520,7 +1520,7 @@ create_apks() {
 		abuild-sign -q control.tar.gz || exit 1
 
 		msg "Create $apk"
-		[ "$subpkgarch" = "noarch" ] && subpkgarch="$CARCH"
+		list_has noarch "$subpkgarch" && subpkgarch="$CARCH"
 		mkdir -p "$REPODEST"/$repo/$subpkgarch
 		cat control.tar.gz data.tar.gz > "$REPODEST"/$repo/$subpkgarch/$apk
 		)
@@ -1562,7 +1562,7 @@ update_abuildrepo_index() {
 		# thinks they are for $CARCH and apk-tools will fetch them from
 		# correct URL path. Remainder of the script uses ${subpkgarch/noarch/$CARCH}
 		# when expanding to the target repository path.
-		[ "$subpkgarch" = "noarch" ] && subpkgarch="$CARCH"
+		list_has noarch "$subpkgarch" && subpkgarch="$CARCH"
 		list_has "$subpkgarch" "$allarch" || allarch="$allarch $subpkgarch"
 	done
 	subpkg_unset
@@ -1856,7 +1856,7 @@ apk_up2date() {
 	local i s
 	for i in $allpackages; do
 		subpkg_set "$i"
-		[ "$subpkgarch" = "noarch" ] && subpkgarch="$CARCH"
+		list_has noarch "$subpkgarch" && subpkgarch="$CARCH"
 		if [ ! -f "$REPODEST/$repo/$subpkgarch/$subpkgname-$pkgver-r$pkgrel.apk" ]; then
 			subpkg_unset
 			return 1
@@ -1872,7 +1872,7 @@ apk_up2date() {
 		else
 			s="$startdir/${i##*/}"
 		fi
-		[ "$pkgarch" = "noarch" ] && pkgarch="$CARCH"
+		list_has noarch "$pkgarch" && pkgarch="$CARCH"
 		if [ "$s" -nt "$REPODEST/$repo/$pkgarch/$pkgname-$pkgver-r$pkgrel.apk" ]; then
 			return 1
 		fi
@@ -1886,7 +1886,7 @@ abuildindex_up2date() {
 
 	for i in $allpackages; do
 		subpkg_set "$i"
-		[ "$subpkgarch" = "noarch" ] && subpkgarch="$CARCH"
+		list_has noarch "$subpkgarch" && subpkgarch="$CARCH"
 		local dir="$REPODEST"/$repo/$subpkgarch
 		local idx="$dir"/APKINDEX.tar.gz
 		local file="$dir"/$subpkgname-$pkgver-r$pkgrel.apk
@@ -2253,7 +2253,7 @@ rootbld() {
 
 stripbin() {
 	local bin
-	if options_has "!strip" || [ "${subpkgarch:-$pkgarch}" = "noarch" ]; then
+	if options_has "!strip" || list_has noarch "${subpkgarch:-$pkgarch}"; then
 		return 0
 	fi
 	cd "${subpkgdir:-$pkgdir}" || return 1
@@ -2597,7 +2597,7 @@ fi
 export REPODEST SRCDEST
 
 # add dbg subpackage if its enabled globally
-if [ -n "$DEFAULT_DBG" ] && ! subpackage_types_has "dbg" && ! options_has "!dbg" && [ "$arch" != "noarch" ]; then
+if [ -n "$DEFAULT_DBG" ] && ! subpackage_types_has "dbg" && ! options_has "!dbg" && ! list_has noarch "$arch"; then
         subpackages="$pkgname-dbg $subpackages"
 fi