[144221] trunk/dports/textproc/cloc
mojca at macports.org
mojca at macports.org
Mon Jan 4 16:12:54 PST 2016
Revision: 144221
https://trac.macports.org/changeset/144221
Author: mojca at macports.org
Date: 2016-01-04 16:12:54 -0800 (Mon, 04 Jan 2016)
Log Message:
-----------
cloc: switch to perl5.22 (#48365), patches for compatibility with 5.22
Modified Paths:
--------------
trunk/dports/textproc/cloc/Portfile
Added Paths:
-----------
trunk/dports/textproc/cloc/files/
trunk/dports/textproc/cloc/files/patch-cloc.diff
Modified: trunk/dports/textproc/cloc/Portfile
===================================================================
--- trunk/dports/textproc/cloc/Portfile 2016-01-05 00:02:53 UTC (rev 144220)
+++ trunk/dports/textproc/cloc/Portfile 2016-01-05 00:12:54 UTC (rev 144221)
@@ -2,10 +2,12 @@
# $Id$
PortSystem 1.0
+PortGroup perl5 1.0
name cloc
version 1.64
-set perl_version 5.16
+perl5.branches 5.22
+revision 1
categories textproc devel
license GPL-2 Artistic-1
platforms darwin
@@ -23,27 +25,21 @@
checksums rmd160 025b0347177dcfa245c35789362c5ce0dc8f6634 \
sha256 309701142f54ee5b244307dec2d07848b71af9b9fee01437d3f7440193f975f0
-depends_run-append port:perl${perl_version} \
- port:p${perl_version}-algorithm-diff \
- port:p${perl_version}-regexp-common \
- port:p${perl_version}-digest-md5
+depends_run-append port:perl${perl5.major} \
+ port:p${perl5.major}-algorithm-diff \
+ port:p${perl5.major}-regexp-common \
+ port:p${perl5.major}-digest-md5
-use_configure no
-
-patch {
+patchfiles patch-cloc.diff
+post-patch {
reinplace -W ${worksrcpath} \
- "s|^#!/usr/bin/env perl|#!${prefix}/bin/perl${perl_version}|" \
+ "s|^#!/usr/bin/env perl|#!${perl5.bin}|" \
cloc sqlite_formatter
}
-build {}
+use_configure no
+build {}
destroot.args-append prefix=${prefix}
-post-destroot {
- reinplace -W ${destroot}${prefix}/bin \
- "s|#!/usr/bin/env perl|#! ${prefix}/bin/perl${perl_version}|" \
- cloc
-}
-
livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)\.pl
Added: trunk/dports/textproc/cloc/files/patch-cloc.diff
===================================================================
--- trunk/dports/textproc/cloc/files/patch-cloc.diff (rev 0)
+++ trunk/dports/textproc/cloc/files/patch-cloc.diff 2016-01-05 00:12:54 UTC (rev 144221)
@@ -0,0 +1,70 @@
+--- cloc.orig
++++ cloc
+@@ -1281,8 +1281,8 @@
+ $not_Filters_by_Language_Lang_LR = 1;
+ }
+ } else {
+- if (!defined(@{$Filters_by_Language{$Lang_L} }) or
+- !defined(@{$Filters_by_Language{$Lang_R} })) {
++ if (!(@{$Filters_by_Language{$Lang_L} }) or
++ !(@{$Filters_by_Language{$Lang_R} })) {
+ $not_Filters_by_Language_Lang_LR = 1;
+ }
+ }
+@@ -1618,7 +1618,7 @@
+ $Ignored{$file} = "--exclude-lang=$Language{$file}";
+ next;
+ }
+- my $Filters_by_Language_Language_file = !defined @{$Filters_by_Language{$Language{$file}} };
++ my $Filters_by_Language_Language_file = !@{$Filters_by_Language{$Language{$file}} };
+ if ($Filters_by_Language_Language_file) {
+ if ($Language{$file} eq "(unknown)") {
+ $Ignored{$file} = "language unknown (#1)";
+@@ -1759,7 +1759,7 @@
+ if ($PERL_516) {
+ next unless @{$rhaa_Filters_by_Language->{$1}};
+ } else {
+- next unless defined @{$rhaa_Filters_by_Language->{$1}};
++ next unless @{$rhaa_Filters_by_Language->{$1}};
+ }
+ # above test necessary to avoid trying to sum reports
+ # of reports (which have no language breakdown).
+@@ -3259,7 +3259,7 @@
+ } # 1}}}
+ sub print_language_filters { # {{{1
+ my ($language,) = @_;
+- if (!defined @{$Filters_by_Language{$language}}) {
++ if (!@{$Filters_by_Language{$language}}) {
+ warn "Unknown language: $language\n";
+ warn "Use --show-lang to list all defined languages.\n";
+ return;
+@@ -4623,7 +4623,7 @@
+
+ open (FILE, $file);
+ while (<FILE>) {
+- if (m/^\\begin{code}/) { close FILE; return 2; }
++ if (m/^\\begin\{code}/) { close FILE; return 2; }
+ if (m/^>\s/) { close FILE; return 1; }
+ }
+
+@@ -4652,9 +4652,9 @@
+ if (!s/^>//) { s/.*//; }
+ } elsif ($literate == 2) {
+ if ($inlitblock) {
+- if (m/^\\end{code}/) { s/.*//; $inlitblock = 0; }
++ if (m/^\\end\{code}/) { s/.*//; $inlitblock = 0; }
+ } elsif (!$inlitblock) {
+- if (m/^\\begin{code}/) { s/.*//; $inlitblock = 1; }
++ if (m/^\\begin\{code}/) { s/.*//; $inlitblock = 1; }
+ else { s/.*//; }
+ }
+ }
+@@ -6582,7 +6582,7 @@
+ my $language = $rh_Language_by_Extension->{$ext};
+ next if defined $extension_collisions{$language};
+ next if $seen_it{$language};
+- if (!defined @{$rhaa_Filters_by_Language->{$language}}) {
++ if (!@{$rhaa_Filters_by_Language->{$language}}) {
+ $OK = 0;
+ warn "Missing language filter for $language\n";
+ }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160104/83509795/attachment-0001.html>
More information about the macports-changes
mailing list