aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnno Boland <gottox@voidlinux.eu>2015-12-03 09:04:16 +0000
committerEnno Boland <g@s01.de>2019-02-15 12:19:44 +0000
commit6eb37e35b20ff7a22bf3902015460a83c5b33734 (patch)
tree23218bf58d81e4f7f62e4f861d77f89cad563aad
parente9769c21715cc91c2a802c6d542ff75b04d42e1e (diff)
downloadvoid-packages-6eb37e35b20ff7a22bf3902015460a83c5b33734.tar
void-packages-6eb37e35b20ff7a22bf3902015460a83c5b33734.tar.gz
void-packages-6eb37e35b20ff7a22bf3902015460a83c5b33734.tar.bz2
void-packages-6eb37e35b20ff7a22bf3902015460a83c5b33734.tar.lz
void-packages-6eb37e35b20ff7a22bf3902015460a83c5b33734.tar.xz
void-packages-6eb37e35b20ff7a22bf3902015460a83c5b33734.tar.zst
void-packages-6eb37e35b20ff7a22bf3902015460a83c5b33734.zip
common: merge only_for_archs and noarch=yes into one.
* noarch=yes is replaced with archs=noarch * only_for_archs= is renamed to archs= * archs= allows the use of wildcards and negations; first matching rule applies: * archs="*-musl" will build the pkg only for musl-libcs * archs="~*-musl" will build the pkg only on non-musl-libc * archs="x86_64-musl ~*-musl" will build for x86_64-musl and any non-musl arch. * archs= defaults to "*"
-rw-r--r--common/environment/setup-subpkg/subpkg.sh2
-rw-r--r--common/environment/setup/sourcepkg.sh2
-rw-r--r--common/hooks/do-pkg/00-gen-pkg.sh4
-rw-r--r--common/hooks/post-install/06-strip-and-debug-pkgs.sh2
-rw-r--r--common/hooks/post-pkg/00-register-pkg.sh4
-rw-r--r--common/hooks/pre-pkg/04-generate-runtime-deps.sh2
-rw-r--r--common/hooks/pre-pkg/05-prepare-32bit.sh2
-rw-r--r--common/hooks/pre-pkg/06-shlib-provides.sh2
-rw-r--r--common/xbps-src/shutils/common.sh3
-rw-r--r--common/xbps-src/shutils/pkgtarget.sh19
-rw-r--r--common/xbps-src/shutils/show.sh4
11 files changed, 26 insertions, 20 deletions
diff --git a/common/environment/setup-subpkg/subpkg.sh b/common/environment/setup-subpkg/subpkg.sh
index 21cd479ce0a..6bf748fdc3d 100644
--- a/common/environment/setup-subpkg/subpkg.sh
+++ b/common/environment/setup-subpkg/subpkg.sh
@@ -2,7 +2,7 @@
# a package template and can also be used in subpkgs.
## VARIABLES
-unset -v noarch conf_files mutable_files preserve triggers alternatives
+unset -v conf_files mutable_files preserve triggers alternatives
unset -v depends run_depends replaces provides conflicts tags
# hooks/post-install/03-strip-and-debug-pkgs
diff --git a/common/environment/setup/sourcepkg.sh b/common/environment/setup/sourcepkg.sh
index 0ed968f3784..82d466a11e1 100644
--- a/common/environment/setup/sourcepkg.sh
+++ b/common/environment/setup/sourcepkg.sh
@@ -3,7 +3,7 @@
## VARIABLES
unset -v pkgname version revision short_desc homepage license maintainer
-unset -v only_for_archs distfiles checksum build_style build_helper nocross broken
+unset -v archs only_for_archs distfiles checksum build_style build_helper nocross broken
unset -v configure_script configure_args wrksrc build_wrksrc create_wrksrc
unset -v make_build_args make_check_args make_install_args
unset -v make_build_target make_check_target make_install_target
diff --git a/common/hooks/do-pkg/00-gen-pkg.sh b/common/hooks/do-pkg/00-gen-pkg.sh
index 75d47d36496..2b1d3ad02e7 100644
--- a/common/hooks/do-pkg/00-gen-pkg.sh
+++ b/common/hooks/do-pkg/00-gen-pkg.sh
@@ -97,14 +97,14 @@ hook() {
local arch= binpkg= repo= _pkgver= _desc= _pkgn= _pkgv= _provides= \
_replaces= _reverts= f= found_dbg_subpkg=
- if [ -n "$noarch" ]; then
+ if [ "${archs// /}" = "noarch" ]; then
arch=noarch
elif [ -n "$XBPS_TARGET_MACHINE" ]; then
arch=$XBPS_TARGET_MACHINE
else
arch=$XBPS_MACHINE
fi
- if [ -z "$noarch" -a -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
+ if [ "${archs// /}" != "noarch" -a -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
arch=${XBPS_ARCH}
fi
diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index bd4cdbd6122..4a703c8007f 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -59,7 +59,7 @@ create_debug_pkg() {
hook() {
local fname= x= f= _soname= STRIPCMD=
- if [ -n "$nostrip" -o -n "$noarch" ]; then
+ if [ -n "$nostrip" -o "${archs// /}" = "noarch" ]; then
return 0
fi
diff --git a/common/hooks/post-pkg/00-register-pkg.sh b/common/hooks/post-pkg/00-register-pkg.sh
index 98e1a2f5c69..5dc28c999c9 100644
--- a/common/hooks/post-pkg/00-register-pkg.sh
+++ b/common/hooks/post-pkg/00-register-pkg.sh
@@ -13,14 +13,14 @@ registerpkg() {
hook() {
local arch= binpkg= pkgdir=
- if [ -n "$noarch" ]; then
+ if [ "${archs// /}" = "noarch" ]; then
arch=noarch
elif [ -n "$XBPS_TARGET_MACHINE" ]; then
arch=$XBPS_TARGET_MACHINE
else
arch=$XBPS_MACHINE
fi
- if [ -z "$noarch" -a -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
+ if [ "${archs// /}" != "noarch" -a -z "$XBPS_CROSS_BUILD" -a -n "$XBPS_ARCH" -a "$XBPS_ARCH" != "$XBPS_TARGET_MACHINE" ]; then
arch=${XBPS_ARCH}
fi
if [ -n "$repository" ]; then
diff --git a/common/hooks/pre-pkg/04-generate-runtime-deps.sh b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
index b5307ff8226..498d8289342 100644
--- a/common/hooks/pre-pkg/04-generate-runtime-deps.sh
+++ b/common/hooks/pre-pkg/04-generate-runtime-deps.sh
@@ -56,7 +56,7 @@ hook() {
mapshlibs=$XBPS_COMMONDIR/shlibs
- if [ -n "$noarch" -o -n "$noverifyrdeps" ]; then
+ if [ "${archs// /}" = "noarch" -o -n "$noverifyrdeps" ]; then
store_pkgdestdir_rundeps
return 0
fi
diff --git a/common/hooks/pre-pkg/05-prepare-32bit.sh b/common/hooks/pre-pkg/05-prepare-32bit.sh
index 1b6a5ae2161..8440b3d36a8 100644
--- a/common/hooks/pre-pkg/05-prepare-32bit.sh
+++ b/common/hooks/pre-pkg/05-prepare-32bit.sh
@@ -21,7 +21,7 @@ hook() {
return
fi
# Ignore noarch pkgs.
- if [ -n "$noarch" ]; then
+ if [ "${archs// /}" = "noarch" ]; then
return
fi
if [ -z "$lib32mode" ]; then
diff --git a/common/hooks/pre-pkg/06-shlib-provides.sh b/common/hooks/pre-pkg/06-shlib-provides.sh
index 66bb03ac058..480d614097b 100644
--- a/common/hooks/pre-pkg/06-shlib-provides.sh
+++ b/common/hooks/pre-pkg/06-shlib-provides.sh
@@ -45,7 +45,7 @@ collect_sonames() {
hook() {
local _destdir32=${XBPS_DESTDIR}/${pkgname}-32bit-${version}
- if [ -z "$shlib_provides" -a -n "$noarch" -o -n "$noshlibprovides" ]; then
+ if [ -z "$shlib_provides" -a "${archs// /}" = "noarch" -o -n "$noshlibprovides" ]; then
return 0
fi
diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index 405be4ac6e7..46552dd940a 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -411,7 +411,8 @@ setup_pkg() {
fi
makejobs="-j$XBPS_MAKEJOBS"
- if [ -n "$noarch" ]; then
+ # strip whitespaces to make " noarch " valid too.
+ if [ "${archs// /}" = "noarch" ]; then
arch="noarch"
else
arch="$XBPS_TARGET_MACHINE"
diff --git a/common/xbps-src/shutils/pkgtarget.sh b/common/xbps-src/shutils/pkgtarget.sh
index 1c20a717d04..fcad8cb4d28 100644
--- a/common/xbps-src/shutils/pkgtarget.sh
+++ b/common/xbps-src/shutils/pkgtarget.sh
@@ -1,9 +1,9 @@
# vim: set ts=4 sw=4 et:
check_pkg_arch() {
- local cross="$1" _arch f found
+ local cross="$1" _arch f match nonegation
- if [ -n "$only_for_archs" ]; then
+ if [ -n "$archs" -o "${archs// /}" != "noarch" ]; then
if [ -n "$cross" ]; then
_arch="$XBPS_TARGET_MACHINE"
elif [ -n "$XBPS_ARCH" ]; then
@@ -11,13 +11,16 @@ check_pkg_arch() {
else
_arch="$XBPS_MACHINE"
fi
- for f in ${only_for_archs}; do
- if [ "$f" = "${_arch}" ]; then
- found=1
- break
- fi
+ set -f
+ for f in ${archs}; do
+ set +f
+ nonegation=${f##\~*}
+ f=${f#\~}
+ case "${_arch}" in
+ $f) match=1; break ;;
+ esac
done
- if [ -z "$found" ]; then
+ if [ -z "$nonegation" -a -n "$match" ] || [ -n "$nonegation" -a -z "$match" ]; then
msg_red "$pkgname: this package cannot be built for ${_arch}.\n"
exit 2
fi
diff --git a/common/xbps-src/shutils/show.sh b/common/xbps-src/shutils/show.sh
index f2a2b39f4e7..0052293312a 100644
--- a/common/xbps-src/shutils/show.sh
+++ b/common/xbps-src/shutils/show.sh
@@ -12,7 +12,9 @@ show_pkg() {
for i in ${checksum}; do
[ -n "$i" ] && echo "checksum: $i"
done
- [ -n "$noarch" ] && echo "noarch: yes"
+ for i in ${archs}; do
+ [ -n "$i" ] && echo "archs: $i"
+ done
echo "maintainer: $maintainer"
[ -n "$homepage" ] && echo "Upstream URL: $homepage"
[ -n "$license" ] && echo "License(s): $license"