From 9221d19435d685edf5cf54f4ad7419bc9255996f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Fri, 20 Jul 2018 23:12:22 +0200 Subject: [PATCH] slight speed improvement in meta updating --- indexmeta.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/indexmeta.sh b/indexmeta.sh index 37a617a..f0185fb 100644 --- a/indexmeta.sh +++ b/indexmeta.sh @@ -92,13 +92,12 @@ meta_dir(){ RELEASE "$meta" elif [ -d "$dir/.index" -a "$dir" -nt "$meta" ] && LOCK "$meta"; then cp -p "$meta" "$meta.ref"; touch "$meta" - find "$dir" -type f -mindepth 1 -maxdepth 1 \ + find "$dir" -type f -newer "$meta.ref" \ + -mindepth 1 -maxdepth 1 \ | grep -aE "$file_pattern" \ | while read -r v; do - if [ "$v" -nt "$meta.ref" ]; then - grep -qF " $(meta_name "$v")" "$meta" \ - || meta_line "$v" - fi + grep -qF " $(meta_name "$v")" "$meta" \ + || meta_line "$v" done >>"$meta" rm "$meta.ref" -- 2.39.2