| @@ -1,15 +1,15 @@ | | | @@ -1,15 +1,15 @@ |
1 | #! @PERL@ | | 1 | #! @PERL@ |
2 | # $NetBSD: url2pkg.pl,v 1.40 2019/08/17 11:57:36 rillig Exp $ | | 2 | # $NetBSD: url2pkg.pl,v 1.41 2019/08/17 13:12:00 rillig Exp $ |
3 | # | | 3 | # |
4 | | | 4 | |
5 | # Copyright (c) 2010 The NetBSD Foundation, Inc. | | 5 | # Copyright (c) 2010 The NetBSD Foundation, Inc. |
6 | # All rights reserved. | | 6 | # All rights reserved. |
7 | # | | 7 | # |
8 | # This code is derived from software contributed to The NetBSD Foundation | | 8 | # This code is derived from software contributed to The NetBSD Foundation |
9 | # by Roland Illig. | | 9 | # by Roland Illig. |
10 | # | | 10 | # |
11 | # Redistribution and use in source and binary forms, with or without | | 11 | # Redistribution and use in source and binary forms, with or without |
12 | # modification, are permitted provided that the following conditions | | 12 | # modification, are permitted provided that the following conditions |
13 | # are met: | | 13 | # are met: |
14 | # 1. Redistributions of source code must retain the above copyright | | 14 | # 1. Redistributions of source code must retain the above copyright |
15 | # notice, this list of conditions and the following disclaimer. | | 15 | # notice, this list of conditions and the following disclaimer. |
| @@ -171,30 +171,31 @@ sub magic_libtool() { | | | @@ -171,30 +171,31 @@ sub magic_libtool() { |
171 | } | | 171 | } |
172 | } | | 172 | } |
173 | | | 173 | |
174 | sub magic_perlmod() { | | 174 | sub magic_perlmod() { |
175 | if (-f "${abs_wrksrc}/Build.PL") { | | 175 | if (-f "${abs_wrksrc}/Build.PL") { |
176 | | | 176 | |
177 | # It's a Module::Build module. Dependencies cannot yet be | | 177 | # It's a Module::Build module. Dependencies cannot yet be |
178 | # extracted automatically. | | 178 | # extracted automatically. |
179 | push(@todo, "Look for the dependencies in Build.PL."); | | 179 | push(@todo, "Look for the dependencies in Build.PL."); |
180 | | | 180 | |
181 | push(@build_vars, ["PERL5_MODULE_TYPE", "Module::Build"]); | | 181 | push(@build_vars, ["PERL5_MODULE_TYPE", "Module::Build"]); |
182 | | | 182 | |
183 | } elsif (-f "${abs_wrksrc}/Makefile.PL") { | | 183 | } elsif (-f "${abs_wrksrc}/Makefile.PL") { |
184 | # To avoid fix_up_makefile error, generate Makefile previously. | | 184 | |
185 | # Ignore exit status (no "or die"). | | 185 | # To avoid fix_up_makefile error for p5-HTML-Quoted, generate Makefile first. |
186 | system("cd ${abs_wrksrc} && perl Makefile.PL"); | | 186 | system("cd ${abs_wrksrc} && perl -I. Makefile.PL < /dev/null") or "ignore"; |
187 | open(DEPS, "cd ${abs_wrksrc} && perl -I${perllibdir} Makefile.PL |") or die; | | 187 | |
| | | 188 | open(DEPS, "cd ${abs_wrksrc} && perl -I${perllibdir} -I. Makefile.PL |") or die; |
188 | while (defined(my $dep = <DEPS>)) { | | 189 | while (defined(my $dep = <DEPS>)) { |
189 | chomp($dep); | | 190 | chomp($dep); |
190 | if ($dep =~ qr"\.\./\.\./") { | | 191 | if ($dep =~ qr"\.\./\.\./") { |
191 | # Many Perl modules write other things to | | 192 | # Many Perl modules write other things to |
192 | # stdout, so filter them out. | | 193 | # stdout, so filter them out. |
193 | push(@depends, $dep); | | 194 | push(@depends, $dep); |
194 | } | | 195 | } |
195 | } | | 196 | } |
196 | close(DEPS) or die; | | 197 | close(DEPS) or die; |
197 | | | 198 | |
198 | } else { | | 199 | } else { |
199 | return; | | 200 | return; |
200 | } | | 201 | } |