summaryrefslogtreecommitdiff
path: root/system/abuild/noarch.patch
blob: d6e59d4dbfab19b3ede5063ef967ac20a301a92f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
diff --git a/abuild.in b/abuild.in
index b0c0f9c..a6a0fe1 100644
--- a/abuild.in
+++ b/abuild.in
@@ -518,7 +518,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
@@ -943,7 +943,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
@@ -1039,7 +1039,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" \
@@ -1137,10 +1137,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
@@ -1339,7 +1339,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
 
@@ -1542,7 +1542,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
 		)
@@ -1590,7 +1590,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
@@ -1936,7 +1936,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
@@ -1952,7 +1952,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
@@ -1966,7 +1966,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
@@ -2335,7 +2335,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
@@ -2679,7 +2679,7 @@ fi
 fi
 
 # add dbg subpackage if its enabled globally
-if [ -n "$DEFAULT_DBG" ] && ! subpackage_types_has "dbg" && ! options_has "!dbg" && [ "$pkgarch" != "noarch" ]; then
+if [ -n "$DEFAULT_DBG" ] && ! subpackage_types_has "dbg" && ! options_has "!dbg" && ! list_has noarch "$pkgarch"; then
         subpackages="$pkgname-dbg $subpackages"
 fi