X-Git-Url: http://git.plutz.net/?p=serve0;a=blobdiff_plain;f=indexmeta.sh;h=2da085f9a0bf86fcdb630f8fd98443df7d99c423;hp=fb893e14195bd8ba2554adb121097a5f8c021eb9;hb=83ae7baa92d4bf2010666435813bb965f7c71561;hpb=fe22bb1e8fc7e116cd165ebeba90361e740b0989 diff --git a/indexmeta.sh b/indexmeta.sh index fb893e1..2da085f 100644 --- a/indexmeta.sh +++ b/indexmeta.sh @@ -76,6 +76,9 @@ meta_dir(){ local dir meta v dir="${1}" meta="${dir}/.index/meta" + metat="${dir}/.index/meta.time" + + [ -f "$metat" ] || touch -d @0 "$metat" if [ -d "$dir/.index" -a \! -f "$meta" ] && LOCK "$meta"; then touch "$meta" # preliminary touch to prevent concurrent generators @@ -86,9 +89,9 @@ meta_dir(){ done >"$meta" RELEASE "$meta" - elif [ -d "$dir/.index" -a "$dir" -nt "$meta" ] && LOCK "$meta"; then + elif [ -d "$dir/.index" -a "$dir" -nt "$metat" ] && LOCK "$meta"; then cp -p "$meta" "$meta.ref"; touch "$meta" - find "$dir" -type f -newer "$meta.ref" \ + find "$dir" -type f -newer "$metat" \ -mindepth 1 -maxdepth 1 \ | grep -aE "$file_pattern" \ | while read -r v; do @@ -97,6 +100,7 @@ meta_dir(){ done >>"$meta" sort -u "$meta" >"$meta.ref" mv "$meta.ref" "$meta" + touch "$metat" RELEASE "$meta" fi