32 lines
956 B
Plaintext

if [[ ${globaldebug} == "true" ]]; then
local debug=true
else
local debug=false
fi
_list_blogs
typeset -A blog_cache
if [[ -f $blog_cache_file ]]; then
while IFS=':' read -r name hash; do
blog_cache[$name]=$hash
if (${debug}) _msg debug "${0:t}_msg_1" " ${blog_cache[${name}]}"
done < "$blog_cache_file"
fi
make_blog_array=()
for blog_file in ${blogs_file_array[@]}; do
current_hash=$(md5sum "$blog_file" | awk '{print $1}')
if (${debug}) _msg debug "${0:t}_msg_2" " ${blog_file}"
if (${debug}) _msg debug "${0:t}_msg_3" " ${current_hash}"
if [[ ${blog_cache[$blog_file]} != "$current_hash" ]]; then
if (${debug}) _msg debug "${0:t}_msg_4" " ${blog_file}"
if (${debug}) _msg debug "${0:t}_msg_5" " ${current_hash}"
make_blog_array+=("$blog_file")
blog_cache[$blog_file]=$current_hash
fi
done
: >| "$blog_cache_file"
for name in "${(@k)blog_cache}"; do
echo "$name:${blog_cache[$name]}" >> "$blog_cache_file"
done