diff options
Diffstat (limited to 'utils/themeeditor/includetargets.pl')
-rwxr-xr-x | utils/themeeditor/includetargets.pl | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/utils/themeeditor/includetargets.pl b/utils/themeeditor/includetargets.pl new file mode 100755 index 0000000000..3708c6a55c --- /dev/null +++ b/utils/themeeditor/includetargets.pl | |||
@@ -0,0 +1,58 @@ | |||
1 | #!/usr/bin/perl | ||
2 | |||
3 | ########################################################################### | ||
4 | # __________ __ ___. | ||
5 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
6 | # Source | _ / _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
7 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
8 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
9 | # \/ \/ \/ \/ \/ | ||
10 | # $Id$ | ||
11 | # | ||
12 | # Copyright (C) 2010 Robert Bieber | ||
13 | # | ||
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. | ||
18 | # | ||
19 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
20 | # KIND, either express or implied. | ||
21 | # | ||
22 | ############################################################################/ | ||
23 | |||
24 | require '../../tools/builds.pm'; | ||
25 | |||
26 | open(FOUT, ">targets.php"); | ||
27 | |||
28 | print FOUT '<?php $targets = array('; | ||
29 | |||
30 | @keys = sort byname keys %builds; | ||
31 | $size = @keys; | ||
32 | $final = @keys[$size - 1]; | ||
33 | for my $b (@keys) | ||
34 | { | ||
35 | $key = $b; | ||
36 | $key =~ s/:/%:/; | ||
37 | $name = $builds{$b}{name}; | ||
38 | $name =~ s/:/%:/; | ||
39 | |||
40 | print FOUT "\"$key\"" . "=>" . '"' . $name . '"' if ($builds{$b}{status} >= 3); | ||
41 | print FOUT ',' if $b ne $final && $builds{$b}{status} >= 3; | ||
42 | } | ||
43 | |||
44 | for my $b (@keys) | ||
45 | { | ||
46 | $key = $b; | ||
47 | $key =~ s/:/%:/; | ||
48 | $name = $builds{$b}{name}; | ||
49 | $name =~ s/:/%:/; | ||
50 | |||
51 | print FOUT "\"$key\"" . "=>" . '"' . $name . '"' if ($builds{$b}{status} < 3); | ||
52 | print FOUT ',' if $b ne $final && $builds{$b}{status} < 3; | ||
53 | } | ||
54 | |||
55 | print FOUT '); ?>'; | ||
56 | |||
57 | close(FOUT); | ||
58 | |||