Commit 26c2df1f authored by Sören Tempel's avatar Sören Tempel

testing/cloc: upgrade to 1.66

parent 46093a00
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=cloc
pkgver=1.64
pkgver=1.66
pkgrel=0
pkgdesc="Count Lines of Code"
url="http://cloc.sourceforge.net/"
pkgdesc="Count lines of code"
url="https://github.com/AlDanial/cloc"
arch="noarch"
license="GPL"
depends="perl"
depends="perl perl-algorithm-diff perl-regexp-common"
depends_dev=""
makedepends=""
install=""
subpackages="$pkgname-doc"
source="http://downloads.sourceforge.net/project/${pkgname}/${pkgname}/v${pkgver}/${pkgname}-${pkgver}.tar.gz
perl522.patch" # See https://sourceforge.net/p/cloc/bugs/135/
_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
cd "$_builddir"
local i=
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1 ;;
esac
done
}
source="https://github.com/AlDanial/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz"
_builddir="$srcdir"/$pkgname-$pkgver/Unix
build () {
make -C "$_builddir" || return 1
}
......@@ -36,9 +24,6 @@ package() {
install || return 1
}
md5sums="ef5bac179f64bb2af1a6d67c2b0f7194 cloc-1.64.tar.gz
3d43994945cc7304cdcb27614d7a11a3 perl522.patch"
sha256sums="309701142f54ee5b244307dec2d07848b71af9b9fee01437d3f7440193f975f0 cloc-1.64.tar.gz
5600b8b5a03add484079d8a22cd6f8ae80e29c44a8583e3f4302ad3730513036 perl522.patch"
sha512sums="2532c8f57a5d9b10a03fe8056708b79f7eb588831dec4b89ac85f354049cdf1e150a0a0c1add359831a1d89a0ed8ac56092ff31e54f4ccfb9491c21b50a960b6 cloc-1.64.tar.gz
3f4f421db0cfac693eab632dc143fe6ee70dd189164a93b2d2a919b0147923d6caa9dc1c553bffa9e8adb7b65b7765508306540ac4f11290013ef7617e966d7a perl522.patch"
md5sums="08bc2552826d907a2206316135568e72 cloc-1.66.tar.gz"
sha256sums="3a8a6d090e6adda9c842583eb49847d6469c65fcf8b2ccefd8e4b18dbb29524e cloc-1.66.tar.gz"
sha512sums="2f0bb2de83c6cd8eee251dbf418002301fdfa76bfda6cfbd0d746d9ea0c9d27cf3ee91110504819c4b85e0ae6c1c496fb125c3ede0d516d452cfea6af46e9473 cloc-1.66.tar.gz"
--- cloc-1.64.orig/cloc
+++ cloc-1.64/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";
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment