~ubuntu-branches/ubuntu/lucid/phpmyadmin/lucid

« back to all changes in this revision

Viewing changes to scripts/find_unused_messages.sh

  • Committer: Bazaar Package Importer
  • Author(s): Michal Čihař
  • Date: 2009-06-30 14:05:13 UTC
  • mfrom: (1.2.1 upstream) (36.1.2 karmic)
  • Revision ID: james.westby@ubuntu.com-20090630140513-hz71do3sij2jhm4s
* New upstream version fixing XSS (PMASA-2009-5).
* Document no empty password in README.Debian and the shipped sample
  configuration file (LP: #388703).
* Install service file for avahi (if web service enabled and if avahi is
  installed) (LP: #369244).
* Mention protecting of setup if not using provided configuration snippets
  for webservers.
* Call ucf with --debconf-ok in postrm (Closes: #534894).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
 
 
3
export LANG=C
 
4
set -e
 
5
 
3
6
# Simple script to find unused message strings by Michal Čihař
4
7
 
5
8
tmp1=`mktemp`
6
9
tmp2=`mktemp`
7
 
grep -o '\<str[A-Z][a-zA-Z0-9_]*\>' lang/english-iso-8859-1.inc.php \
 
10
grep -o '^\$\<str[A-Z][a-zA-Z0-9_]*\>' lang/english-utf-8.inc.php \
 
11
    | tr -d '$' \
8
12
    | grep -Ev '^str(Transformation_|ShowStatus)' | sort -u > $tmp1
9
13
grep -ho '\<str[A-Z][a-zA-Z0-9_]*\>' `find . -type f -a -name '*.php' -a -not -path '*/lang/*'` \
10
 
    | grep -Ev '^str(Transformation_|ShowStatus)' | sort -u > $tmp2
 
14
    | grep -Ev '^str(Transformation_|ShowStatus|Lang|Locale|SetupForm_|SetupFormset_)' | sort -u > $tmp2
11
15
 
12
16
echo Please note that you need to check results of this script, it doesn\'t
13
17
echo understand PHP, it only tries to find what looks like message name.
25
29
echo Not used messages present in english language file:
26
30
echo
27
31
 
28
 
diff $tmp1 $tmp2 | awk '/^</ {print $2}'
 
32
diff $tmp1 $tmp2 | awk '/^</ {print $2}' | grep -Ev '(strSetup.*_(desc|name)|strSetupForm_|strSetupFormset_)'
29
33
 
30
34
 
31
35
rm -f $tmp1 $tmp2