From d94a15be8f4dc83c51b5db38ab7e126a94e09e45 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 26 Jan 2020 10:41:12 +0100 Subject: [PATCH] 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. --- common/xbps-src/shutils/chroot.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/common/xbps-src/shutils/chroot.sh b/common/xbps-src/shutils/chroot.sh index 3fc144db2d0..c4297bcfa85 100644 --- a/common/xbps-src/shutils/chroot.sh +++ b/common/xbps-src/shutils/chroot.sh @@ -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