From 90cf507065d89010a5f4df830c116d51ce716236 Mon Sep 17 00:00:00 2001 From: hongjinghao Date: Mon, 24 Oct 2022 03:47:36 +0000 Subject: [PATCH] 1231231 Signed-off-by: hongjinghao --- ...ify-the-upgrade-to-next-stable-logic.patch | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 backport-Simplify-the-upgrade-to-next-stable-logic.patch diff --git a/backport-Simplify-the-upgrade-to-next-stable-logic.patch b/backport-Simplify-the-upgrade-to-next-stable-logic.patch new file mode 100644 index 0000000..dba58f5 --- /dev/null +++ b/backport-Simplify-the-upgrade-to-next-stable-logic.patch @@ -0,0 +1,31 @@ +From 33e0c0e1de3fdecb4a627eaa1662871e13e041d2 Mon Sep 17 00:00:00 2001 +From: Leon Timmermans +Date: Fri, 4 Feb 2022 13:29:58 +0100 +Subject: [PATCH] Simplify the upgrade-to-next-stable logic + +--- + lib/experimental.pm | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/lib/experimental.pm b/lib/experimental.pm +index 41b3994..9fa4461 100644 +--- a/lib/experimental.pm ++++ b/lib/experimental.pm +@@ -72,12 +72,8 @@ sub _enable { + croak "Can't enable unknown feature $pragma"; + } + elsif ($] < $min_version{$pragma}) { +- my $stable = $min_version{$pragma}; +- if ($stable->{version}[1] % 2) { +- $stable = version->new( +- "5.".($stable->{version}[1]+1).'.0' +- ); +- } ++ my $stable = $min_version{$pragma}->stringify; ++ $stable =~ s/^ 5\. ([0-9]?[13579]) \. \d+ $/"5." . ($1 + 1) . ".0"/xe; + croak "Need perl $stable or later for feature $pragma"; + } + elsif ($] >= ($removed_in_version{$pragma} || 7)) { +-- +2.33.0 +