pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/url2pkg/files pkgtools/url2pkg: refactoring: ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fd7d8d9b8be7
branches:  trunk
changeset: 339378:fd7d8d9b8be7
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Thu Sep 12 05:56:59 2019 +0000

description:
pkgtools/url2pkg: refactoring: don't use experimental smartmatch

diffstat:

 pkgtools/url2pkg/files/url2pkg.pl |  22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diffs (56 lines):

diff -r 443c075f800c -r fd7d8d9b8be7 pkgtools/url2pkg/files/url2pkg.pl
--- a/pkgtools/url2pkg/files/url2pkg.pl Thu Sep 12 05:49:03 2019 +0000
+++ b/pkgtools/url2pkg/files/url2pkg.pl Thu Sep 12 05:56:59 2019 +0000
@@ -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 @@
        #
        # 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 @@
                $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();



Home | Main Index | Thread Index | Old Index