]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1261114 - Release notes cannot be displayed due to missing REQUIRED_MODULES and...
authorDavid Lawrence <dkl@mozilla.com>
Mon, 16 May 2016 15:23:19 +0000 (15:23 +0000)
committerDavid Lawrence <dkl@mozilla.com>
Mon, 16 May 2016 15:23:32 +0000 (15:23 +0000)
r=dylan

Bugzilla/Template.pm
template/en/default/pages/release-notes.html.tmpl

index 49294244adfcbcee2acc744987a897f92dc5a31a..40079339a4f14e66a5e273bddf160278a9f3cd8c 100644 (file)
@@ -1153,18 +1153,32 @@ sub create {
 
             # These don't work as normal constants.
             DB_MODULE        => \&Bugzilla::Constants::DB_MODULE,
-            REQUIRED_MODULES => 
-                \&Bugzilla::Install::Requirements::REQUIRED_MODULES,
+            REQUIRED_MODULES => sub {
+                my %required_modules;
+                my $cache = Bugzilla->request_cache;
+                my $meta = $cache->{cpan_meta} ||= Bugzilla::Install::Requirements::load_cpan_meta();
+                my $reqs = $meta->effective_prereqs->merged_requirements(['configure', 'runtime'], ['requires']);
+                foreach my $module (sort $reqs->required_modules) {
+                    next if $module eq 'perl';
+                    $required_modules{$module} = { version => $reqs->requirements_for_module($module) };
+                }
+                return \%required_modules;
+            },
             OPTIONAL_MODULES => sub {
-                my @optional = @{OPTIONAL_MODULES()};
-                foreach my $item (@optional) {
-                    my @features;
-                    foreach my $feat_id (@{ $item->{feature} }) {
-                        push(@features, install_string("feature_$feat_id"));
+                my %optional_modules;
+                my $cache = Bugzilla->request_cache;
+                my $meta = $cache->{cpan_meta} ||= Bugzilla::Install::Requirements::load_cpan_meta();
+                foreach my $feature ($meta->features) {
+                    my $reqs = $feature->prereqs->merged_requirements(['configure', 'runtime'], ['requires']);
+                    foreach my $module ($reqs->required_modules) {
+                        my $version = $reqs->requirements_for_module($module);
+                        $optional_modules{$module} ||= {};
+                        $optional_modules{$module}{version} = $version;
+                        $optional_modules{$module}{features} ||= [];
+                        push(@{$optional_modules{$module}{features}}, $feature->description);
                     }
-                    $item->{feature} = \@features;
                 }
-                return \@optional;
+                return \%optional_modules;
             },
             'default_authorizer' => sub { return Bugzilla::Auth->new() },
 
index 358298bc8188a6f97fb31ce4ec444bab95aaa766..ce72afa84f9cc99956c2cd9248daf9c6fb1f8659 100644 (file)
 
 <h3 id="req_perl">Perl</h3>
 
-<p>Perl <span class="req_new">v5.10.1</span></p>
+<p>Perl <span class="req_new">v5.14.1</span></p>
 
-[% INCLUDE db_req db='mysql' %]
+[% INCLUDE db_req db = 'mysql'
+                  module = 'DBD::mysql' %]
 
-[% INCLUDE db_req db='pg' %]
+[% INCLUDE db_req db = 'pg'
+                  module = 'DBD::Pg' %]
 
-[% INCLUDE db_req db='oracle' %]
+[% INCLUDE db_req db ='oracle'
+                  module = 'DBD::Oracle' %]
 
-[% INCLUDE db_req db='sqlite' %]
+[% INCLUDE db_req db = 'sqlite'
+                  module = 'DBD::SQLite' %]
 
 <h3 id="req_modules">Required Perl Modules</h3>
 
 [% INCLUDE req_table reqs = REQUIRED_MODULES
-                     new = ['File-Slurp','JSON-XS', 'Email-Sender']
-                     updated = ['DateTime', 'DateTime-TimeZone',
-                                'Template-Toolkit', 'URI'] %]
+                     new = ['File::Slurp','JSON::XS', 'Email::Sender']
+                     updated = ['DateTime', 'DateTime::TimeZone',
+                                'Template', 'URI'] %]
 
 <h3 id="req_optional_mod">Optional Perl Modules</h3>
 
   features of Bugzilla:</p>
 
 [% INCLUDE req_table reqs = OPTIONAL_MODULES
-                     new  = ['Cache-Memcached','File-Copy-Recursive']
-                     updated = ['Chart', 'Test-Taint']
+                     new  = ['Cache::Memcached::Fast','File::Copy::Recursive']
+                     updated = ['Chart::Lines', 'Test::Taint']
                      include_feature = 1 %]
 
 <h3 id="req_apache">Optional Apache Modules</h3>
        </li>
     <li><strong>perl module:</strong>
       [%+ m.dbd.module FILTER html %]
-      [%+ '<span class="req_new">' IF dbd_new %]v[% m.dbd.version FILTER html %]
+      [%+ '<span class="req_new">' IF dbd_new %]v[% OPTIONAL_MODULES.$module.version FILTER html %]
       [% '</span>' IF dbd_new %]</li>
   </ul>
 [% END %]
         <th>Enables Feature</th>
       [% END %]
     </tr>
-    [% FOREACH req = reqs %]
+    [% FOREACH module = reqs.keys.sort %]
+      [% NEXT IF module.match('^DBD') %]
+      [% version = reqs.$module.version %]
       <tr>
-        <td [% ' class="req_new"' IF new.contains(req.package) %]>
-          [%- req.module FILTER html %]</td>
-        <td [% ' class="req_new"' IF updated.contains(req.package)
-                                     OR new.contains(req.package) %]>
-          [%- IF req.version == 0 %]
+        <td [% ' class="req_new"' IF new.contains(module) %]>
+          [%- module FILTER html %]</td>
+        <td [% ' class="req_new"' IF updated.contains(module)
+                                     OR new.contains(module) %]>
+          [%- IF version == 0 %]
             (Any)
           [% ELSE %]
-            [%- req.version FILTER html %]
+            [%- version FILTER html %]
           [% END %]
         </td>
         [% IF include_feature %]
-          <td>[% req.feature.join(', ') FILTER html %]</td>
+          <td>[% reqs.$module.features.join(', ') FILTER html %]</td>
         [% END %]
       </tr>
     [% END %]