aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-buildpackage-funcs
diff options
context:
space:
mode:
authorLoïc Minier <lool@dooz.org>2010-01-03 08:25:19 +0100
committerLoïc Minier <lool@dooz.org>2010-01-03 08:25:19 +0100
commit0e12cc38636ed1841ff465e6aea134002ab066da (patch)
tree76a547fa63ce30c75cb35ca010aaeff1b81e7bb7 /pbuilder-buildpackage-funcs
parent4d656f9ba6d76dcfab0fe8f4ed4d645ec228dc90 (diff)
downloadpbuilder-0e12cc38636ed1841ff465e6aea134002ab066da.tar
pbuilder-0e12cc38636ed1841ff465e6aea134002ab066da.tar.gz
Move ccache setup to pbuilder-buildpackage-funcs
Diffstat (limited to 'pbuilder-buildpackage-funcs')
-rw-r--r--pbuilder-buildpackage-funcs13
1 files changed, 13 insertions, 0 deletions
diff --git a/pbuilder-buildpackage-funcs b/pbuilder-buildpackage-funcs
index 023dbca..39f1e71 100644
--- a/pbuilder-buildpackage-funcs
+++ b/pbuilder-buildpackage-funcs
@@ -104,3 +104,16 @@ function createbuilduser () {
unset LOGNAME || true
fi
}
+
+function setup_ccache() {
+ if [ -n "$CCACHEDIR" ]; then
+ log "I: Setting up ccache"
+ if ! [ -d "$BUILDPLACE/$CCACHEDIR" ]; then
+ mkdir -p "$BUILDPLACE/$CCACHEDIR"
+ fi
+ chown -R $BUILDUSERID:$BUILDUSERID "$BUILDPLACE/$CCACHEDIR"
+ # Unfortunate difference between pbuilder-style and ccache-style config
+ # env vars :-/
+ export CCACHE_DIR="$CCACHEDIR"
+ fi
+}