Skip to content

Commit

Permalink
dev-util/cloc: add patch for perl 5.22 array error
Browse files Browse the repository at this point in the history
Pretty much just what it says; this will keep cropping up in more
packages.

Package-Manager: portage-2.2.24
  • Loading branch information
sarnold committed Nov 9, 2015
1 parent 622c2c7 commit f45619d
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 1 deletion.
12 changes: 11 additions & 1 deletion dev-util/cloc/cloc-1.64.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

EAPI=5

inherit eutils

DESCRIPTION="Count Lines of Code"
HOMEPAGE="http://cloc.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.pl mirror://sourceforge/${PN}/${PN}.1.pod"
Expand All @@ -27,9 +29,17 @@ src_unpack() { :; }

src_prepare() {
pod2man "${DISTDIR}"/${PN}.1.pod > ${PN}.1 || die

# hacky, but otherwise we only get a symlink in distdir...
cp -L "${DISTDIR}"/${P}.pl "${WORKDIR}"/

# fix stuoid perl array error... again...
if has_version '>=dev-lang/perl-5.22.0' ; then
epatch "${FILESDIR}"/${PN}-fix_stupid_perl_array_error_again.patch
fi
}

src_install() {
doman ${PN}.1
newbin "${DISTDIR}"/${P}.pl ${PN}
newbin "${WORKDIR}"/${P}.pl ${PN}
}
71 changes: 71 additions & 0 deletions dev-util/cloc/files/cloc-fix_stupid_perl_array_error_again.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
--- cloc-1.64.pl.orig 2015-08-26 18:59:16.045264847 -0700
+++ cloc-1.64.pl 2015-08-26 19:30:23.241507263 -0700
@@ -1280,11 +1280,6 @@
!(@{$Filters_by_Language{$Lang_R} })) {
$not_Filters_by_Language_Lang_LR = 1;
}
- } else {
- if (!defined(@{$Filters_by_Language{$Lang_L} }) or
- !defined(@{$Filters_by_Language{$Lang_R} })) {
- $not_Filters_by_Language_Lang_LR = 1;
- }
}
if ($not_Filters_by_Language_Lang_LR) {
if (($Lang_L eq "(unknown)") or ($Lang_R eq "(unknown)")) {
@@ -1618,7 +1613,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 +1754,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 +3254,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 +4618,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 +4647,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 +6577,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";
}

0 comments on commit f45619d

Please sign in to comment.