]> git.plutz.net Git - serve0/commitdiff
bugfix: allow rime based update of meta file cgilite
authorPaul Hänsch <paul@plutz.net>
Thu, 19 Jul 2018 00:33:30 +0000 (02:33 +0200)
committerPaul Hänsch <paul@plutz.net>
Thu, 19 Jul 2018 00:33:30 +0000 (02:33 +0200)
indexmeta.sh

index 45a3bac008b2ee469719d6ac2b91b3a0976b9178..37a617aa0fa6c860f44ceeb1f568568380d0ee89 100644 (file)
@@ -91,15 +91,16 @@ meta_dir(){
 
     RELEASE "$meta"
   elif [ -d "$dir/.index" -a "$dir" -nt "$meta" ] && LOCK "$meta"; then
-    touch "$meta"
+    cp -p "$meta" "$meta.ref"; touch "$meta"
     find "$dir" -type f -mindepth 1 -maxdepth 1 \
     | grep -aE "$file_pattern" \
     | while read -r v; do
-      if [ "$v" -nt "$meta" ]; then
+      if [ "$v" -nt "$meta.ref" ]; then
         grep -qF "     $(meta_name "$v")" "$meta" \
         || meta_line "$v"
       fi
     done >>"$meta"
+    rm "$meta.ref"
 
     RELEASE "$meta"
   fi