summaryrefslogtreecommitdiff
path: root/pkgtools/url2pkg/files/url2pkg.pl
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2019-09-12 05:56:59 +0000
committerrillig <rillig@pkgsrc.org>2019-09-12 05:56:59 +0000
commitafc6607fd2b92c39e408400cf80dc305f2123dad (patch)
tree437196fb1d77abc688f69b30c23974c7d7920d2a /pkgtools/url2pkg/files/url2pkg.pl
parentabbf74f50bac47b7a7a8a86358a8499f26a4faf1 (diff)
downloadpkgsrc-afc6607fd2b92c39e408400cf80dc305f2123dad.tar.gz
pkgtools/url2pkg: refactoring: don't use experimental smartmatch
Diffstat (limited to 'pkgtools/url2pkg/files/url2pkg.pl')
-rw-r--r--pkgtools/url2pkg/files/url2pkg.pl22
1 files changed, 10 insertions, 12 deletions
diff --git a/pkgtools/url2pkg/files/url2pkg.pl b/pkgtools/url2pkg/files/url2pkg.pl
index ed50e802fb2..3f0ae2ad6dd 100644
--- a/pkgtools/url2pkg/files/url2pkg.pl
+++ b/pkgtools/url2pkg/files/url2pkg.pl
@@ -1,5 +1,5 @@
#! @PERL5@
-# $NetBSD: url2pkg.pl,v 1.68 2019/09/12 05:45:34 rillig Exp $
+# $NetBSD: url2pkg.pl,v 1.69 2019/09/12 05:56:59 rillig Exp $
#
# Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -29,7 +29,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-use feature qw{ switch };
use strict;
use warnings;
@@ -719,19 +718,18 @@ sub adjust_package_from_extracted_distfiles($)
#
# Determine the value of WRKSRC.
#
+
my @files = ();
opendir(WRKDIR, $abs_wrkdir) or die;
while (defined(my $f = readdir(WRKDIR))) {
- no if $] >= 5.018, warnings => "experimental::smartmatch";
- given ($f) {
- next when qr"^\.";
- next when "pax_global_header";
- next when "package.xml";
- next when qr".*\.gemspec";
- default { push(@files, $f) }
- }
+ next if $f =~ qr"^\."
+ || $f eq "pax_global_header"
+ || $f eq "package.xml"
+ || $f =~ qr"\.gemspec$";
+ push(@files, $f);
}
closedir(WRKDIR);
+
if (@files == 1) {
if ($files[0] ne $distname) {
push(@build_vars, var("WRKSRC", "=", "\${WRKDIR}/$files[0]"));
@@ -743,8 +741,8 @@ sub adjust_package_from_extracted_distfiles($)
$abs_wrksrc = $abs_wrkdir;
}
- chomp(@wrksrc_files = `cd "$abs_wrksrc" && find * -type f`);
- chomp(@wrksrc_dirs = `cd "$abs_wrksrc" && find * -type d`);
+ chomp(@wrksrc_files = `cd "$abs_wrksrc" && find * -type f -print`);
+ chomp(@wrksrc_dirs = `cd "$abs_wrksrc" && find * -type d -print`);
adjust_configure();
adjust_cmake();