line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XUL::App::View::Install; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
5
|
|
|
|
|
|
|
#use Smart::Comments; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use base 'Template::Declare'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
1128
|
|
8
|
|
|
|
|
|
|
use Template::Declare::Tags |
9
|
1
|
|
|
1
|
|
13131
|
'RDF::EM' => { namespace => 'em' }, 'RDF'; |
|
1
|
|
|
|
|
8507
|
|
|
1
|
|
|
|
|
10
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our %UUID = ( |
12
|
|
|
|
|
|
|
mozilla => '{86c18b42-e466-45a9-ae7a-9b95ba6f5640}', |
13
|
|
|
|
|
|
|
firefox => '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}', |
14
|
|
|
|
|
|
|
flock => '{a463f10c-3994-11da-9945-000d60ca027b}', |
15
|
|
|
|
|
|
|
seamonkey => '{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}', |
16
|
|
|
|
|
|
|
thunderbird => '{3550f703-e582-4d05-9a08-453d09bdfdc6}', |
17
|
|
|
|
|
|
|
nvu => '{136c295a-4a5a-41cf-bf24-5cee526720d5}', |
18
|
|
|
|
|
|
|
sunbird => '{718e30fb-e89b-41dd-9da7-e25a45638b28}', |
19
|
|
|
|
|
|
|
netscape => '{3db10fab-e461-4c80-8b97-957ad5f8ea47}', |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# for install.rdf generation: |
23
|
|
|
|
|
|
|
template main => sub { |
24
|
|
|
|
|
|
|
my ($self, $xpifile) = @_; |
25
|
|
|
|
|
|
|
xml_decl { 'xml', version => '1.0', encoding => 'UTF-8' }; |
26
|
|
|
|
|
|
|
RDF { |
27
|
|
|
|
|
|
|
attr { |
28
|
|
|
|
|
|
|
'xmlns' => "http://www.w3.org/1999/02/22-rdf-syntax-ns#", |
29
|
|
|
|
|
|
|
'xmlns:em' => 'http://www.mozilla.org/2004/em-rdf#' |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
Description { |
32
|
|
|
|
|
|
|
attr { about => 'urn:mozilla:install-manifest' } |
33
|
|
|
|
|
|
|
em::id { $xpifile->id } |
34
|
|
|
|
|
|
|
em::name { $xpifile->display_name || $xpifile->name } |
35
|
|
|
|
|
|
|
em::description { $xpifile->description } |
36
|
|
|
|
|
|
|
em::version { $xpifile->version } |
37
|
|
|
|
|
|
|
em::creator { $xpifile->creator }; |
38
|
|
|
|
|
|
|
for (@{ $xpifile->developers }) { |
39
|
|
|
|
|
|
|
em::developer { $_ } |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
for (@{ $xpifile->contributors }) { |
42
|
|
|
|
|
|
|
em::contributor { $_ } |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my $targets = $xpifile->targets; |
46
|
|
|
|
|
|
|
while (my ($app, $ver_range) = each %$targets) { |
47
|
|
|
|
|
|
|
outs_raw("\n\n "); |
48
|
|
|
|
|
|
|
em::targetApplication { |
49
|
|
|
|
|
|
|
Description { |
50
|
|
|
|
|
|
|
em::id { get_uuid($app) } |
51
|
|
|
|
|
|
|
em::minVersion { $ver_range->[0] } |
52
|
|
|
|
|
|
|
em::maxVersion { $ver_range->[1] } |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
em::homepageURL { $xpifile->homepageURL }; |
57
|
|
|
|
|
|
|
if ($xpifile->updateURL) { |
58
|
|
|
|
|
|
|
em::updateURL { $xpifile->updateURL } |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
if ($xpifile->iconURL) { |
61
|
|
|
|
|
|
|
em::iconURL { $xpifile->iconURL } |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
}; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub get_uuid { |
69
|
0
|
|
|
0
|
0
|
|
my $name = shift; |
70
|
0
|
|
|
|
|
|
my $key = lc($name); |
71
|
|
|
|
|
|
|
#warn $key; |
72
|
|
|
|
|
|
|
### %UUID |
73
|
0
|
|
|
|
|
|
my $value = $UUID{$key}; |
74
|
0
|
0
|
|
|
|
|
if (!$value) { |
75
|
0
|
|
|
|
|
|
die "Can't find UUID for target app $name\n"; |
76
|
|
|
|
|
|
|
} |
77
|
0
|
|
|
|
|
|
return $value; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |
81
|
|
|
|
|
|
|
|