File: 0001-Adapt-to-Scalar-Util-change-to-use-builtin-functions.patch

package info (click to toggle)
libkiokudb-perl 0.57-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,412 kB
  • sloc: perl: 13,316; makefile: 12
file content (38 lines) | stat: -rw-r--r-- 1,358 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 1cd69975f17a3e883690565032c94fcff39e504b Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Sun, 24 Aug 2025 17:56:49 +0100
Subject: [PATCH] Adapt to Scalar::Util change to use builtin:: functions where
 available

Starting with Scalar::Util 1.64 (bundled with Perl 5.42),
Scalar::Util::weaken() is really builtin::weaken() on newer Perls.

See https://github.com/Dual-Life/Scalar-List-Utils/pull/132

Bug-Debian: https://bugs.debian.org/1111980
Forwarded: https://github.com/kiokudb/kiokudb/pull/18
Bug: https://github.com/kiokudb/kiokudb/pull/18

---
 t/coderefs.t | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/t/coderefs.t b/t/coderefs.t
index 2a9b4ed..d935243 100644
--- a/t/coderefs.t
+++ b/t/coderefs.t
@@ -472,7 +472,10 @@ sub blah { 42 }
     my $entry = $dir->live_objects->id_to_entry($sub_id);
 
     ok( !exists($entry->data->{file}), "XSUB detected" );
-    is_deeply( $entry->data, { package => "Scalar::Util", name => "weaken" }, "FQ reference only" );
+    # see https://github.com/Dual-Life/Scalar-List-Utils/pull/132
+    my $expected_package = ($] >= 5.040 and eval { Scalar::Util->VERSION("1.64") }) ?
+        'builtin': 'Scalar::Util';
+    is_deeply( $entry->data, { package => $expected_package, name => "weaken" }, "FQ reference only" );
 
     $dir->live_objects->clear;
 }
-- 
2.49.0