makepkg: add support for CARCH environment var

Add support for overriding configuration in /etc/makepkg.conf and
~/.makepkg.conf by setting the environment variable CARCH similar to
how SRCDEST and PKGDEST behave.

Fixes FS#35030.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Phillip Smith 2013-04-30 09:10:08 +10:00 committed by Allan McRae
parent a975523fb9
commit 5bcc058d42
2 changed files with 6 additions and 0 deletions

View File

@ -229,6 +229,10 @@ Environment Variables
Folder where the package will be built. Overrides the corresponding
value defined in linkman:makepkg.conf[5].
**CARCH=**"(i686|x86_64)"::
Force build for a specific architecture. Useful for cross-compiling.
Overrides the corresponding value defined in linkman:makepkg.conf[5].
Configuration
-------------
See linkman:makepkg.conf[5] for more details on configuring makepkg using the

View File

@ -2638,6 +2638,7 @@ trap 'trap_exit USR1 "$(gettext "An unknown error has occurred. Exiting...")"' E
[[ -n ${SRCEXT} ]] && _SRCEXT=${SRCEXT}
[[ -n ${GPGKEY} ]] && _GPGKEY=${GPGKEY}
[[ -n ${PACKAGER} ]] && _PACKAGER=${PACKAGER}
[[ -n ${CARCH} ]] && _CARCH=${CARCH}
# default config is makepkg.conf
MAKEPKG_CONF=${MAKEPKG_CONF:-$confdir/makepkg.conf}
@ -2737,6 +2738,7 @@ PKGEXT=${_PKGEXT:-$PKGEXT}
SRCEXT=${_SRCEXT:-$SRCEXT}
GPGKEY=${_GPGKEY:-$GPGKEY}
PACKAGER=${_PACKAGER:-$PACKAGER}
CARCH=${_CARCH:-$CARCH}
if (( ! INFAKEROOT )); then
if (( EUID == 0 && ! ASROOT )); then