From 7c78963bbb09603e8ceb986b478ae4762a6f427b Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Fri, 1 Jun 2012 22:51:48 +0200 Subject: [PATCH] Add voicefile version to rockbox-info.txt. When the voicefile binary format changes there is no easy way to figure which format is compatible with a given Rockbox installation. Add the version number to rockbox-info.txt so tools like Rockbox Utility can easily retrieve it and therefore support different versions. Change-Id: Ia5b8f00f89065f0dd0adf061612d844dcaff39c6 Reviewed-on: http://gerrit.rockbox.org/269 Tested-by: Dominik Riebeling Reviewed-by: Dominik Riebeling --- tools/mkinfo.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/mkinfo.pl b/tools/mkinfo.pl index 483ddd10bc..12d32bc7dc 100755 --- a/tools/mkinfo.pl +++ b/tools/mkinfo.pl @@ -28,6 +28,21 @@ sub cmd1line { return $out[0]; } +sub definescan { + my ($f, $d)=($_[0], $_[1]); + my $v; + open(M, "<$f"); + while() { + if($_ =~ /\#define\s+$d\s+([^\s]+)\s?/) { + $v = $1; + last; + } + } + close(M); + + return $v; +} + sub mapscan { my ($f)=@_; my $start, $end; @@ -82,6 +97,7 @@ printf O ("Manufacturer: %s\n", $ENV{'MANUFACTURER'}); printf O ("Version: %s", `$ENV{TOOLSDIR}/version.sh $ENV{ROOTDIR}`); printf O ("Binary: %s\n", $ENV{'BINARY'}); printf O ("Binary size: %s\n", filesize($ENV{'BINARY'})); +printf O ("Voice format: %s\n", definescan("$ENV{APPSDIR}/talk.h", "VOICE_VERSION")); if ($ENV{'APPSDIR'} =~ /\/apps$/) { printf O ("Actual size: %s\n", filesize("rockbox.bin"));