Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Contents of /trunk/web/www/routino/update-profiles.pl
Parent Directory
|
Revision Log
Revision 1520 -
(show annotations)
(download)
(as text)
Sat Mar 8 19:36:35 2014 UTC (11 years ago) by amb
File MIME type: text/x-perl
File size: 2390 byte(s)
Sat Mar 8 19:36:35 2014 UTC (11 years ago) by amb
File MIME type: text/x-perl
File size: 2390 byte(s)
Update all Perl scripts to "use strict".
1 | #!/usr/bin/perl |
2 | # |
3 | # Update the Routino profile files |
4 | # |
5 | # Part of the Routino routing software. |
6 | # |
7 | # This file Copyright 2011-2014 Andrew M. Bishop |
8 | # |
9 | # This program is free software: you can redistribute it and/or modify |
10 | # it under the terms of the GNU Affero General Public License as published by |
11 | # the Free Software Foundation, either version 3 of the License, or |
12 | # (at your option) any later version. |
13 | # |
14 | # This program is distributed in the hope that it will be useful, |
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 | # GNU Affero General Public License for more details. |
18 | # |
19 | # You should have received a copy of the GNU Affero General Public License |
20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
21 | # |
22 | |
23 | use strict; |
24 | |
25 | # Use the directory paths script |
26 | require "paths.pl"; |
27 | |
28 | |
29 | # The parameters for the execution |
30 | |
31 | my $params=""; |
32 | |
33 | $params.=" --dir=$main::data_dir" if($main::data_dir); |
34 | $params.=" --prefix=$main::data_prefix" if($main::data_prefix); |
35 | |
36 | |
37 | # Generate the Perl profiles. |
38 | |
39 | open(PROFILE,">profiles.pl") || die "Cannot open 'profiles.pl' to write.\n"; |
40 | |
41 | print PROFILE "################################################################################\n"; |
42 | print PROFILE "########################### Routino default profile ############################\n"; |
43 | print PROFILE "################################################################################\n"; |
44 | print PROFILE "\n"; |
45 | |
46 | open(EXECUTE,"$main::bin_dir/$main::router_exe $params --help-profile-perl |") || die "Failed to execute router to generate profiles.\n"; |
47 | |
48 | while(<EXECUTE>) |
49 | { |
50 | print PROFILE; |
51 | } |
52 | |
53 | close(EXECUTE); |
54 | |
55 | print PROFILE "\n"; |
56 | print PROFILE "1;\n"; |
57 | |
58 | close(PROFILE); |
59 | |
60 | |
61 | # Generate the Javascript profiles. |
62 | |
63 | open(PROFILE,">profiles.js") || die "Cannot open 'profiles.js' to write.\n"; |
64 | |
65 | print PROFILE "////////////////////////////////////////////////////////////////////////////////\n"; |
66 | print PROFILE "/////////////////////////// Routino default profile ////////////////////////////\n"; |
67 | print PROFILE "////////////////////////////////////////////////////////////////////////////////\n"; |
68 | print PROFILE "\n"; |
69 | |
70 | open(EXECUTE,"$main::bin_dir/$main::router_exe $params --help-profile-json |") || die "Failed to execute router to generate profiles.\n"; |
71 | |
72 | while(<EXECUTE>) |
73 | { |
74 | print PROFILE; |
75 | } |
76 | |
77 | close(EXECUTE); |
78 | |
79 | close(PROFILE); |
Properties
Name | Value |
---|---|
svn:executable | * |