xbps-src: export CCACHE_DIR is XBPS_CCACHE is set.

This commit is contained in:
Juan RP 2011-07-19 00:22:52 +02:00
parent 0c94a67f88
commit c586459062
2 changed files with 12 additions and 1 deletions

View file

@ -89,7 +89,9 @@ _EOF
if [ -n "$XBPS_HOSTDIR" ]; then
echo "XBPS_HOSTDIR=/host" >> $XBPSSRC_CF
fi
if [ -n "$XBPS_CCACHE" ]; then
echo "XBPS_CCACHE=$XBPS_CCACHE" >> $XBPSSRC_CF
fi
echo "# End of configuration file." >> $XBPSSRC_CF
if [ -d $XBPS_MASTERDIR/tmp ]; then

View file

@ -314,6 +314,15 @@ if [ -z "$IN_CHROOT" ]; then
else
if [ -n "$XBPS_CCACHE" ]; then
CCACHEPATH="/usr/lib/ccache/bin"
if [ -n "$XBPS_HOSTDIR" ]; then
[ ! -d "$XBPS_HOSTDIR/ccache" ] && \
mkdir -p $XBPS_HOSTDIR/ccache
export CCACHE_DIR="$XBPS_HOSTDIR/ccache"
else
[ ! -d "$XBPS_MASTERDIR/host/ccache" ] && \
mkdir -p $XBPS_MASTERDIR/host/ccache
export CCACHE_DIR="$XBPS_MASTERDIR/host/ccache"
fi
fi
# In chroot always prefer tools from bootstrap.
MYPATH="$CCACHEPATH:/tools/bin:/usr/local/sbin:/bin:/usr/bin"