@@ -243,3 +243,39 @@ index 7bc9662..dd79c65 100644
243243 # e.g. for autosplit .ix and .al files. In the latter case,
244244 # the key may also start with "./" if found via a relative path in @INC.
245245 $key =~ s|\\|/|g;
246+
247+
248+ From 49468814a24221affe113664899be21aef60e846 Mon Sep 17 00:00:00 2001
249+ From: rschupp <roderich.schupp@gmail.com>
250+ Date: Fri, 8 Nov 2024 19:17:30 +0100
251+ Subject: [PATCH] fix parsing of "use if ..."
252+
253+ Fixes errors in PAR::Packer test t/90-rt59710.t
254+ ---
255+ lib/Module/ScanDeps.pm | 6 ++++--
256+ 1 file changed, 4 insertions(+), 2 deletions(-)
257+
258+ diff --git a/lib/Module/ScanDeps.pm b/lib/Module/ScanDeps.pm
259+ index f911440..71d8b75 100644
260+ --- a/lib/Module/ScanDeps.pm
261+ +++ b/lib/Module/ScanDeps.pm
262+ @@ -925,7 +925,7 @@ sub scan_line {
263+ next CHUNK;
264+ }
265+
266+ - if (my ($pragma, $args) = /^use \s+ (autouse|if) \s+ (.+)/x)
267+ + if (my ($pragma, $args) = /^(?:use|no) \s+ (autouse|if) \s+ (.+)/x)
268+ {
269+ # NOTE: There are different ways the MODULE may
270+ # be specified for the "autouse" and "if" pragmas, e.g.
271+ @@ -938,7 +938,9 @@ sub scan_line {
272+ else {
273+ # The syntax of the "if" pragma is
274+ # use if COND, MODULE => ARGUMENTS
275+ - (undef, $module) = _parse_module_list($args);
276+ + # NOTE: This works only for simple conditions.
277+ + $args =~ s/.*? (?:,|=>) \s*//x;
278+ + ($module) = _parse_module_list($args);
279+ }
280+ $found{_mod2pm($pragma)}++;
281+ $found{_mod2pm($module)}++ if $module;
0 commit comments