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