[gcompris] tools: integrated check_missing_intro.sh into check_missing_voices.pl



commit 26ef2785256b38acb61ebdd5cceeceedb1be75a7
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Sat May 19 21:47:29 2012 +0200

    tools: integrated check_missing_intro.sh into check_missing_voices.pl
    
    It is best to have a single tool for that.

 tools/check_missing_voices.pl |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)
---
diff --git a/tools/check_missing_voices.pl b/tools/check_missing_voices.pl
index 5b17a58..e6e0e9a 100755
--- a/tools/check_missing_voices.pl
+++ b/tools/check_missing_voices.pl
@@ -9,7 +9,6 @@
 use strict;
 use Data::Dumper;
 
-
 if(!defined $ARGV[0])
   {
     print "Usage: ./check_missing_voices <locale>\n";
@@ -52,7 +51,6 @@ foreach my $locale (@LOCALES)
       {
 	if (! opendir DIR, "$BASEDIR/$locale/$subdir")
 	  {
-	    print "cannot open dir $BASEDIR/$locale/$subdir: $!\n";
 	    next;
 	  }
 
@@ -81,5 +79,31 @@ foreach my $file (@ALL_FILES)
 	$got_error = 1;
       }
   }
+
+#
+# Check intro voices
+#
+my $database = glob("~/.config/gcompris/gcompris_sqlite.db");
+if (! -e $database) {
+    print "ERROR: The GCompris sqlite database is not in $database." .
+	" Run GCompris once to create it\n";
+    $got_error = 1;
+}
+
+my $request = "select name from boards where type != 'menu' and section != '/experimental'" .
+    " and name != 'tuxpaint' and name !='administration' and name !='login';";
+
+my $results = `sqlite3 $database "$request"`;
+foreach my $name (split /\n/, $results)
+{
+    my $file = "intro/$name.ogg";
+    if (! -e "$BASEDIR/$TARGET_LOCALE/$file") {
+	print "$file\n";
+	$got_error = 1;
+    }
+}
+
+
+
 print "\nGreat, nothing is missing !\n" if !$got_error;
 print "\nI did not checked the directory '$BASEDIR/$TARGET_LOCALE/alphabet'\n"



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