From f1ec7fac9fd0a6d988b57da243734683485f13c1 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Thu, 13 Jun 2019 00:29:49 +0200 Subject: [PATCH] xbps-src: open $XBPS_MASTERDIR/etc/xbps/xbps-src.conf only once --- common/xbps-src/shutils/chroot.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/common/xbps-src/shutils/chroot.sh b/common/xbps-src/shutils/chroot.sh index 14d28ab56a..ea8f7b6246 100644 --- a/common/xbps-src/shutils/chroot.sh +++ b/common/xbps-src/shutils/chroot.sh @@ -3,17 +3,11 @@ # FIXME: $XBPS_FFLAGS is not set when chroot_init() is run # It is set in common/build-profiles/bootstrap.sh but lost somewhere? chroot_init() { - XBPSSRC_CF=$XBPS_MASTERDIR/etc/xbps/xbps-src.conf - mkdir -p $XBPS_MASTERDIR/etc/xbps - cat > $XBPSSRC_CF <<_EOF + cat > $XBPS_MASTERDIR/etc/xbps/xbps-src.conf <<_EOF # Generated configuration file by xbps-src, DO NOT EDIT! -_EOF - if [ -e "$XBPS_CONFIG_FILE" ]; then - grep -E '^XBPS_.*' $XBPS_CONFIG_FILE >> $XBPSSRC_CF - fi - cat >> $XBPSSRC_CF <<_EOF +$(grep -E '^XBPS_.*' "$XBPS_CONFIG_FILE") XBPS_MASTERDIR=/ XBPS_CFLAGS="$XBPS_CFLAGS" XBPS_CXXFLAGS="$XBPS_CXXFLAGS" @@ -21,10 +15,9 @@ XBPS_FFLAGS="-fPIC -pipe" XBPS_CPPFLAGS="$XBPS_CPPFLAGS" XBPS_LDFLAGS="$XBPS_LDFLAGS" XBPS_HOSTDIR=/host +# End of configuration file. _EOF - echo "# End of configuration file." >> $XBPSSRC_CF - # Create custom script to start the chroot bash shell. cat > $XBPS_MASTERDIR/bin/xbps-shell <<_EOF #!/bin/sh