lib/pvl/hosts/include_cache.sh
changeset 715 76ed62924d50
equal deleted inserted replaced
714:e0a651547bd2 715:76ed62924d50
       
     1 INCLUDE_CACHE='var/include-cache'
       
     2 
       
     3 ## Normalize a given source path for use in the include-cache
       
     4 function include_cache_path {
       
     5     local src="$1"
       
     6     local cache="$src"
       
     7 
       
     8     cache="${cache//_/__}"
       
     9     cache="${cache//\//_}"
       
    10 
       
    11     echo "$INCLUDE_CACHE/$cache"
       
    12 }
       
    13 
       
    14 ## Read the include cache for given path
       
    15 function include_cache {
       
    16     local cache="$1"
       
    17 
       
    18     if [ ! -e "$cache" ]; then
       
    19         debug "missing: $cache"
       
    20 
       
    21         return 0
       
    22     fi
       
    23     
       
    24     cat $cache
       
    25 }
       
    26