Robert Bieber | d73c81f | 2010-07-30 20:47:25 +0000 | [diff] [blame] | 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 | |