Browse Source

Prepare cleaning tools for release.

Laurent Destailleur 10 years ago
parent
commit
5cc48c7c78
5 changed files with 10 additions and 4 deletions
  1. 1 0
      dev/fixdosfiles.sh
  2. 1 0
      dev/fixduplicatelangkey.sh
  3. 6 4
      dev/fixduplicatelines.sh
  4. 1 0
      dev/fixperms.sh
  5. 1 0
      dev/fixutf8bomfiles.sh

+ 1 - 0
dev/fixdosfiles.sh

@@ -10,6 +10,7 @@
 # Syntax
 if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
 then
+    echo "Detect and fix files ending with bad ending chars (must be LF)"
 	echo "Usage: fixdosfiles.sh [list|fix]"
 fi
 

+ 1 - 0
dev/fixduplicatelangkey.sh

@@ -7,6 +7,7 @@
 # Syntax
 if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
 then
+    echo "Detect duplicate translation keys inside a file (there is no cross file check)."
 	echo "Usage: detectduplicatelangkey.sh (list|fix)"
 fi
 

+ 6 - 4
dev/deduplicatefilelinesrecursively.sh → dev/fixduplicatelines.sh

@@ -9,17 +9,19 @@
 # Syntax
 if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
 then
+	echo "Find exact duplicated lines into file (not cross file checking)"
 	echo "Usage: deduplicatefilelinesrecursively.sh [list|fix]"
 fi
 
 # To detect
 if [ "x$1" = "xlist" ]
 then
-    for file in `find . -type f -name *.lang`
+    for file in `find htdocs/langs/en_US -type f -name *.lang`
     do
-        if [ `sort "$file" | uniq -d | wc -l` -gt 0 ]
+        if [ `sort "$file" | grep -v '^$' | uniq -d | wc -l` -gt 0 ]
         then
-            echo "$file"
+            echo "***** $file"
+            sort "$file" | grep -v '^$' | uniq -d
         fi
     done
 fi
@@ -27,7 +29,7 @@ fi
 # To fix
 if [ "x$1" = "xfix" ]
 then
-    for file in `find . -type f -name *.lang`
+    for file in `find htdocs/langs/en_US -type f -name *.lang`
     do
     	awk -i inplace ' !x[$0]++' "$file"
     done;

+ 1 - 0
dev/fixperms.sh

@@ -10,6 +10,7 @@
 # Syntax
 if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
 then
+	echo "Fix permissions of files"
 	echo "Usage: fixperms.sh (list|fix)"
 fi
 

+ 1 - 0
dev/fixutf8bomfiles.sh

@@ -12,6 +12,7 @@
 # Syntax
 if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
 then
+    echo "Detect and fix bad UTF8 encoded files (UTF8 must not use BOM char)"
 	echo "Usage: fixutf8bomfiles.sh (list|fix) [addincludes]"
 fi