mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-02 20:42:43 +00:00
functions: read default configs from /usr/share/abuild/default.conf
This makes it easier to push default config updates with apk
This commit is contained in:
parent
fe26e9483b
commit
a1b672cad2
@ -77,7 +77,7 @@ readconfig() {
|
||||
[ -n "${SRCDEST+x}" ] && _SRCDEST=$SRCDEST
|
||||
[ -n "${CC+x}" ] && _CC=$CC
|
||||
[ -n "${CXX+x}" ] && _CXX=$CXX
|
||||
[ -n "${LD+x}" ] && _LD=$LD
|
||||
[ -n "${LD+x}" ] && _LD=$LD
|
||||
[ -n "${CARCH+x}" ] && _CARCH=$CARCH
|
||||
[ -n "${CHOST+x}" ] && _CHOST=$CHOST
|
||||
[ -n "${CTARGET+x}" ] && _CTARGET=$CTARGET
|
||||
@ -96,9 +96,11 @@ readconfig() {
|
||||
[ -n "${PACKAGER+x}" ] && _PACKAGER=$PACKAGER
|
||||
[ -n "${USE_COLORS+x}" ] && _USE_COLORS="$USE_COLORS"
|
||||
[ -n "${USE_CCACHE+x}" ] && _USE_CCACHE="$USE_CCACHE"
|
||||
: ${ABUILD_DEFCONF:=$ABUILD_SHAREDIR/default.conf}
|
||||
: ${ABUILD_CONF:=$sysconfdir/abuild.conf}
|
||||
: ${ABUILD_USERDIR:=$HOME/.abuild}
|
||||
: ${ABUILD_USERCONF:=$ABUILD_USERDIR/abuild.conf}
|
||||
[ -f "$ABUILD_DEFCONF" ] && . "$ABUILD_DEFCONF"
|
||||
[ -f "$ABUILD_CONF" ] && . "$ABUILD_CONF"
|
||||
[ -f "$ABUILD_USERCONF" ] && . "$ABUILD_USERCONF"
|
||||
APORTSDIR=${_APORTSDIR-$APORTSDIR}
|
||||
|
@ -56,22 +56,29 @@ funcs_check_env_set_but_empty_body() {
|
||||
}
|
||||
|
||||
funcs_check_defconfig_body() {
|
||||
echo "CFLAGS=defcflags" > def.conf
|
||||
echo "CFLAGS=syscflags" > etc.conf
|
||||
echo "CFLAGS=usercflags" > user.conf
|
||||
|
||||
# test /usr/share/abuild/default.conf
|
||||
ABUILD_DEFCONF="$PWD"/def.conf ABUILD_CONF=/dev/null ABUILD_USERCONF=/dev/null \
|
||||
atf_check -o match:"defcflags" \
|
||||
sh -e -c " . $FUNCS; echo \"\$CFLAGS\""
|
||||
|
||||
# test /etc/abuild.conf
|
||||
ABUILD_CONF="$PWD"/etc.conf atf_check \
|
||||
ABUILD_DEFCONF=/dev/null ABUILD_CONF="$PWD"/etc.conf ABUILD_USERCONF=/dev/null \
|
||||
atf_check \
|
||||
-o match:"syscflags" \
|
||||
sh -e -c " . $FUNCS; echo \"\$CFLAGS\""
|
||||
|
||||
# user config ($HOME/.abuild/abuild.conf) wins over /etc/abuild.conf
|
||||
ABUILD_CONF="$PWD/etc.conf" ABUILD_USERCONF="$PWD/user.conf" \
|
||||
ABUILD_DEFCONF="$PWD"/def.conf ABUILD_CONF="$PWD/etc.conf" ABUILD_USERCONF="$PWD/user.conf" \
|
||||
atf_check \
|
||||
-o match:"usercflags" \
|
||||
sh -e -c " . $FUNCS; echo \"\$CFLAGS\""
|
||||
|
||||
# environment wins
|
||||
ABUILD_CONF="$PWD/etc.conf" ABUILD_USERCONF="$PWD/user.conf" \
|
||||
ABUILD_DEFCONF="$PWD"/def.conf ABUILD_CONF="$PWD/etc.conf" ABUILD_USERCONF="$PWD/user.conf" \
|
||||
CFLAGS="envcflags" atf_check \
|
||||
-o match:"envcflags" \
|
||||
sh -e -c " . $FUNCS; echo \"\$CFLAGS\""
|
||||
|
Loading…
Reference in New Issue
Block a user