--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/pvl/hosts/include_cache.sh Tue Mar 03 12:09:22 2015 +0200
@@ -0,0 +1,26 @@
+INCLUDE_CACHE='var/include-cache'
+
+## Normalize a given source path for use in the include-cache
+function include_cache_path {
+ local src="$1"
+ local cache="$src"
+
+ cache="${cache//_/__}"
+ cache="${cache//\//_}"
+
+ echo "$INCLUDE_CACHE/$cache"
+}
+
+## Read the include cache for given path
+function include_cache {
+ local cache="$1"
+
+ if [ ! -e "$cache" ]; then
+ debug "missing: $cache"
+
+ return 0
+ fi
+
+ cat $cache
+}
+