#!/usr/bin/env perl ############################################################################ # __________ __ ___. # Open \______ \ ____ ____ | | _\_ |__ _______ ___ # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ # \/ \/ \/ \/ \/ # $Id: binlang,v 1.10 2003/05/08 08:35:28 bagder Exp $ # # Copyright (C) 2004 by Daniel Stenberg # # All files in this archive are subject to the GNU General Public License. # See the file COPYING in the source tree root for full license agreement. # # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # KIND, either express or implied. # ############################################################################ my $lang ="apps/lang/english.lang"; if (! -r $lang) { print "run this in the rockbox root dir\n"; exit; } open(LANG, "<$lang"); while() { if(/^id: +(.*)/) { push @ids, $1; } } close(LANG); sub getfiles { my ($dir) = @_; opendir(DIR, $dir) || die "can't opendir $dir: $!"; my @ents = readdir(DIR); closedir DIR; my @entries; for(@ents) { my $f = $_; my $d = "$dir/$f"; push @entries, $d; if(-d $d && ($f !~ /^\./)) { push @entries, getfiles("$d"); } } return @entries; } sub checkfile { my ($file)=@_; open(FILE, "<$file"); while() { my $l= $_; for(@ids) { my $id=$_; if(!$found{$id} && ($l =~ /$_/)) { $found{$id}++; } } } close(FILE); } my @all= getfiles("."); for(@all) { if(/.*\.c$/) { my $f=$_; print STDERR "Scanning $f\n"; checkfile($f); } } for(@ids) { my $id = $_; if(!$found{$id}) { printf "%s\n", $id; } }