This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
parts/inc/ppphbin: Use dependency info for min support
authorKarl Williamson <khw@cpan.org>
Thu, 8 Aug 2019 19:18:21 +0000 (13:18 -0600)
committerNicolas R <atoomic@cpan.org>
Fri, 27 Sep 2019 22:51:27 +0000 (16:51 -0600)
Some items don't get tested, and so we don't know their minimum
supported version.  But if they're dependent on some other thing whose
minimum version we do know, we can glean that they aren't supported
prior the the dependent thing's support.

(cherry picked from commit 311664e55550bf20d255a952ad2532c1c8747c73)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/parts/inc/ppphbin

index c90908e..3057d12 100644 (file)
@@ -295,6 +295,14 @@ if (exists $opt{'api-info'}) {
             }
         }
         elsif (! $base || $base > $int_min_perl) {
+            if (exists $depends{$f}) {
+                my $max = 0;
+                for (@{$depends{$f}}) {
+                    $max = int_parse_version($API{$_}{todo}) if $API{$_}{todo} && $API{$_}{todo} > $max;
+                    # XXX What to assume unspecified values are?  This effectively makes them MIN_PERL
+                }
+                $todo = $max if $max;
+            }
             print "\n$ppport provides support for this, but ironically, does not",
                   " currently know,\n",
                   "for this report, the minimum version it supports for this";
@@ -305,6 +313,17 @@ if (exists $opt{'api-info'}) {
                       "help by submitting a documentation patch";
             }
             print ".\n";
+            if ($todo) {
+                if ($todo <= $int_min_perl) {
+                    print "It may very well be supported all the way back to ",
+                          format_version(__MIN_PERL__), ".\n";
+                }
+                else {
+                    print "But given the things $f depends on, it's a good",
+                          " guess that it isn't\n",
+                          "supported prior to ", format_version($todo), ".\n";
+                }
+            }
         }
     }
     if ($API{$f}{provided}) {