xbps-src: open $XBPS_MASTERDIR/etc/xbps/xbps-src.conf only once

This commit is contained in:
Duncaen 2019-06-13 00:29:49 +02:00 committed by Juan RP
parent 6d3c739c9a
commit f1ec7fac9f
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368

View File

@ -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