xbps-src: use XBPS_INSTALL_ARGS; allow custom xbps.d settings.

If `etc/xbps.d/custom` exists (directory) and contains
xbps.d(5) .conf files, those will be copied verbatim
to `masterdir/etc/xbps.d`.

This allows you to set your custom xbps.d(5) settings
without having to modify any other file.

This is also useful for testing xbps.d(5) noextract feature.
This commit is contained in:
Juan RP 2020-01-26 10:41:12 +01:00
parent 855796f23a
commit d94a15be8f
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368
1 changed files with 10 additions and 4 deletions

View File

@ -127,7 +127,7 @@ chroot_prepare() {
cp -f $XBPS_SRCPKGDIR/base-files/files/hosts $XBPS_MASTERDIR/etc
mkdir -p $XBPS_MASTERDIR/etc/xbps.d
echo "syslog=false" >> $XBPS_MASTERDIR/etc/xbps.d/xbps.conf
echo "syslog=false" >> $XBPS_MASTERDIR/etc/xbps.d/00-xbps-src.conf
# Prepare default locale: en_US.UTF-8.
if [ -s ${XBPS_MASTERDIR}/etc/default/libc-locales ]; then
@ -153,7 +153,7 @@ chroot_handler() {
fi
case "$action" in
fetch|extract|patch|configure|build|check|install|pkg|bootstrap-update|chroot)
fetch|extract|patch|configure|build|check|install|pkg|bootstrap-update|chroot|clean)
chroot_prepare || return $?
chroot_init || return $?
;;
@ -191,7 +191,13 @@ chroot_sync_repodata() {
crossconfdir=$XBPS_MASTERDIR/$XBPS_CROSS_BASE/etc/xbps.d
[ -d $confdir ] && rm -rf $confdir
[ -d $crossconfdir ] && rm -rf $crossconfdir
if [ -d $XBPS_DISTDIR/etc/xbps.d/custom ]; then
mkdir -p $confdir $crossconfdir
cp -f $XBPS_DISTDIR/etc/xbps.d/custom/*.conf $confdir
cp -f $XBPS_DISTDIR/etc/xbps.d/custom/*.conf $crossconfdir
fi
if [ "$CHROOT_READY" ]; then
hostdir=/host
else
@ -296,7 +302,7 @@ chroot_sync_repodata() {
# Make sure to sync index for remote repositories.
msg_normal "xbps-src: updating repositories for host ($XBPS_MACHINE)...\n"
xbps-install -r $XBPS_MASTERDIR -S
$XBPS_INSTALL_CMD $XBPS_INSTALL_ARGS -S
if [ -n "$XBPS_CROSS_BUILD" ]; then
# Copy host keys to the target rootdir.
@ -306,7 +312,7 @@ chroot_sync_repodata() {
# Make sure to sync index for remote repositories.
msg_normal "xbps-src: updating repositories for target ($XBPS_TARGET_MACHINE)...\n"
env -- XBPS_TARGET_ARCH=$XBPS_TARGET_MACHINE \
xbps-install -r $XBPS_MASTERDIR/$XBPS_CROSS_BASE -S
$XBPS_INSTALL_CMD $XBPS_INSTALL_ARGS -r $XBPS_MASTERDIR/$XBPS_CROSS_BASE -S
fi
return 0