--- ./package/develop/ccache/parse-config	2008-08-04 23:56:56.000000000 +0100
+++ ./package/develop/ccache/parse-config	2008-11-10 22:19:09.000000000 +0000
@@ -31,6 +31,10 @@
 	export CCACHE_UNIFY=1 # needed to e.g. strip comments
 	#export CCACHE_LOGFILE="$CCACHE_DIR.log"
 
+	if [[ $stagelevel -ge 2 && $stagelevel -le 8  ]]; then
+		export CCACHE_DIR="$base/loop/build/$ccache_dir/$pkg"
+	fi
+
 	# In the chroot sandbox we need to wire the cccache-$arch out by using
 	# the existing bind mount. We only do this, if we are not doing a
 	# manual stage9 build ...
