mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-05 06:09:41 +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
@ -96,9 +96,11 @@ readconfig() {
|
|||||||
[ -n "${PACKAGER+x}" ] && _PACKAGER=$PACKAGER
|
[ -n "${PACKAGER+x}" ] && _PACKAGER=$PACKAGER
|
||||||
[ -n "${USE_COLORS+x}" ] && _USE_COLORS="$USE_COLORS"
|
[ -n "${USE_COLORS+x}" ] && _USE_COLORS="$USE_COLORS"
|
||||||
[ -n "${USE_CCACHE+x}" ] && _USE_CCACHE="$USE_CCACHE"
|
[ -n "${USE_CCACHE+x}" ] && _USE_CCACHE="$USE_CCACHE"
|
||||||
|
: ${ABUILD_DEFCONF:=$ABUILD_SHAREDIR/default.conf}
|
||||||
: ${ABUILD_CONF:=$sysconfdir/abuild.conf}
|
: ${ABUILD_CONF:=$sysconfdir/abuild.conf}
|
||||||
: ${ABUILD_USERDIR:=$HOME/.abuild}
|
: ${ABUILD_USERDIR:=$HOME/.abuild}
|
||||||
: ${ABUILD_USERCONF:=$ABUILD_USERDIR/abuild.conf}
|
: ${ABUILD_USERCONF:=$ABUILD_USERDIR/abuild.conf}
|
||||||
|
[ -f "$ABUILD_DEFCONF" ] && . "$ABUILD_DEFCONF"
|
||||||
[ -f "$ABUILD_CONF" ] && . "$ABUILD_CONF"
|
[ -f "$ABUILD_CONF" ] && . "$ABUILD_CONF"
|
||||||
[ -f "$ABUILD_USERCONF" ] && . "$ABUILD_USERCONF"
|
[ -f "$ABUILD_USERCONF" ] && . "$ABUILD_USERCONF"
|
||||||
APORTSDIR=${_APORTSDIR-$APORTSDIR}
|
APORTSDIR=${_APORTSDIR-$APORTSDIR}
|
||||||
|
@ -56,22 +56,29 @@ funcs_check_env_set_but_empty_body() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
funcs_check_defconfig_body() {
|
funcs_check_defconfig_body() {
|
||||||
|
echo "CFLAGS=defcflags" > def.conf
|
||||||
echo "CFLAGS=syscflags" > etc.conf
|
echo "CFLAGS=syscflags" > etc.conf
|
||||||
echo "CFLAGS=usercflags" > user.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
|
# 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" \
|
-o match:"syscflags" \
|
||||||
sh -e -c " . $FUNCS; echo \"\$CFLAGS\""
|
sh -e -c " . $FUNCS; echo \"\$CFLAGS\""
|
||||||
|
|
||||||
# user config ($HOME/.abuild/abuild.conf) wins over /etc/abuild.conf
|
# 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 \
|
atf_check \
|
||||||
-o match:"usercflags" \
|
-o match:"usercflags" \
|
||||||
sh -e -c " . $FUNCS; echo \"\$CFLAGS\""
|
sh -e -c " . $FUNCS; echo \"\$CFLAGS\""
|
||||||
|
|
||||||
# environment wins
|
# 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 \
|
CFLAGS="envcflags" atf_check \
|
||||||
-o match:"envcflags" \
|
-o match:"envcflags" \
|
||||||
sh -e -c " . $FUNCS; echo \"\$CFLAGS\""
|
sh -e -c " . $FUNCS; echo \"\$CFLAGS\""
|
||||||
|
Loading…
Reference in New Issue
Block a user