[file-roller] data/update-packages-match: Clean up



commit a51fd925c245d36ccb072dcbe46832afb60130d9
Author: Jan Tojnar <jtojnar gmail com>
Date:   Sat Sep 10 04:54:36 2022 +0200

    data/update-packages-match: Clean up
    
    - Add shebang
    - Make executable
    - Add locale to force consistent collation
      Suggested by https://gitlab.gnome.org/GNOME/file-roller/-/issues/97
    - Drop packages.match.in template since it only really has header
      and causes extra final new line to be included.
    - Run grep directly by find.

 data/packages.match.in     | 2 --
 data/update-packages-match | 6 ++++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/data/update-packages-match b/data/update-packages-match
old mode 100644
new mode 100755
index f6048d42..9120fcfc
--- a/data/update-packages-match
+++ b/data/update-packages-match
@@ -1,2 +1,4 @@
-list=`find .. -iname "*.c" | xargs grep FR_PACKAGES | sed -e 's/.*FR_PACKAGES[ ]*[(]"\([^"]*\)"[)];/\1/g' -e 
's/,/\n/g' | sort -u | sed -e 's/\(.*\)/\1=/g' | tr '\n' '|'` 
-sed -e 's/@NAMES@/'"$list"'/g' < packages.match.in | tr '|' '\n' > packages.match
+#!/bin/sh
+export LC_ALL=C.utf8
+echo "[Package Matches]" > packages.match
+find .. -iname "*.c" -exec grep FR_PACKAGES '{}' ';' | sed -e 's/.*FR_PACKAGES[ ]*[(]"\([^"]*\)"[)];/\1/g' 
-e 's/,/\n/g' | sort -u | sed -e 's/\(.*\)/\1=/g' >> packages.match


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]