Backport d8a3871 - Update French by Amaury Pouly
[maemo-rb.git] / utils / themeeditor / includetargets.pl
blob3708c6a55c6bd550fc4bcbeeed68d8c8e681fe22
1 #!/usr/bin/perl
3 ###########################################################################
4 # __________ __ ___.
5 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
6 # Source | _ / _ \_/ ___\| |/ /| __ \ / _ \ \/ /
7 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
8 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 # \/ \/ \/ \/ \/
10 # $Id$
12 # Copyright (C) 2010 Robert Bieber
14 # This program is free software; you can redistribute it and/or
15 # modify it under the terms of the GNU General Public License
16 # as published by the Free Software Foundation; either version 2
17 # of the License, or (at your option) any later version.
19 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 # KIND, either express or implied.
22 ############################################################################/
24 require '../../tools/builds.pm';
26 open(FOUT, ">targets.php");
28 print FOUT '<?php $targets = array(';
30 @keys = sort byname keys %builds;
31 $size = @keys;
32 $final = @keys[$size - 1];
33 for my $b (@keys)
35 $key = $b;
36 $key =~ s/:/%:/;
37 $name = $builds{$b}{name};
38 $name =~ s/:/%:/;
40 print FOUT "\"$key\"" . "=>" . '"' . $name . '"' if ($builds{$b}{status} >= 3);
41 print FOUT ',' if $b ne $final && $builds{$b}{status} >= 3;
44 for my $b (@keys)
46 $key = $b;
47 $key =~ s/:/%:/;
48 $name = $builds{$b}{name};
49 $name =~ s/:/%:/;
51 print FOUT "\"$key\"" . "=>" . '"' . $name . '"' if ($builds{$b}{status} < 3);
52 print FOUT ',' if $b ne $final && $builds{$b}{status} < 3;
55 print FOUT '); ?>';
57 close(FOUT);