summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen L Arnold <nerdboy@gentoo.org>2015-11-09 13:01:04 -0800
committerStephen L Arnold <nerdboy@gentoo.org>2015-11-09 13:05:50 -0800
commitf45619d86ce8a00a2bb6e8ec3ac91206456adb1e (patch)
tree248822be56a3ec7076287b1cc1a7a97645739761 /dev-util/cloc
parentdev-libs/libxml2: re-add missing call to eprefixify (diff)
downloadgentoo-f45619d86ce8a00a2bb6e8ec3ac91206456adb1e.tar.gz
gentoo-f45619d86ce8a00a2bb6e8ec3ac91206456adb1e.tar.bz2
gentoo-f45619d86ce8a00a2bb6e8ec3ac91206456adb1e.zip
dev-util/cloc: add patch for perl 5.22 array error
Pretty much just what it says; this will keep cropping up in more packages. Package-Manager: portage-2.2.24
Diffstat (limited to 'dev-util/cloc')
-rw-r--r--dev-util/cloc/cloc-1.64.ebuild12
-rw-r--r--dev-util/cloc/files/cloc-fix_stupid_perl_array_error_again.patch71
2 files changed, 82 insertions, 1 deletions
diff --git a/dev-util/cloc/cloc-1.64.ebuild b/dev-util/cloc/cloc-1.64.ebuild
index 066490bc9b57..6d8b4d959673 100644
--- a/dev-util/cloc/cloc-1.64.ebuild
+++ b/dev-util/cloc/cloc-1.64.ebuild
@@ -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"
@@ -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}
}
diff --git a/dev-util/cloc/files/cloc-fix_stupid_perl_array_error_again.patch b/dev-util/cloc/files/cloc-fix_stupid_perl_array_error_again.patch
new file mode 100644
index 000000000000..9f41e07d019c
--- /dev/null
+++ b/dev-util/cloc/files/cloc-fix_stupid_perl_array_error_again.patch
@@ -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";
+ }