Gentoo Archives: gentoo-commits

From: Kent Fredric <kentnl@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-perl/librg-utils-perl/files/, dev-perl/librg-utils-perl/
Date: Sun, 29 Oct 2017 15:07:18
Message-Id: 1509289626.aadc48d174804624649c8414d352091f72455f28.kentnl@gentoo
1 commit: aadc48d174804624649c8414d352091f72455f28
2 Author: Kent Fredric <kentnl <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 29 14:42:57 2017 +0000
4 Commit: Kent Fredric <kentnl <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 29 15:07:06 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aadc48d1
7
8 dev-perl/librg-utils-perl: Add tests, fixed defined(@array)
9
10 - EAPI6
11 - Add basic compile test
12 - fix defined(@array) bug exposed by basic compile test
13 - Clearly nobody is actually using this.
14
15 Package-Manager: Portage-2.3.8, Repoman-2.3.3
16
17 .../librg-utils-perl-1.0.43-defined-array.patch | 160 +++++++++++++++++++++
18 .../librg-utils-perl-1.0.43-r1.ebuild | 59 ++++++++
19 2 files changed, 219 insertions(+)
20
21 diff --git a/dev-perl/librg-utils-perl/files/librg-utils-perl-1.0.43-defined-array.patch b/dev-perl/librg-utils-perl/files/librg-utils-perl-1.0.43-defined-array.patch
22 new file mode 100644
23 index 00000000000..3042d3af577
24 --- /dev/null
25 +++ b/dev-perl/librg-utils-perl/files/librg-utils-perl-1.0.43-defined-array.patch
26 @@ -0,0 +1,160 @@
27 +From 73e9e3126de1ac485462284fd1d97cb2ea3b09e8 Mon Sep 17 00:00:00 2001
28 +From: Kent Fredric <kentnl@g.o>
29 +Date: Mon, 30 Oct 2017 03:36:42 +1300
30 +Subject: Fix deprecated use of defined(@array)
31 +
32 +---
33 + lib/RG/Utils/Conv_hssp2saf.pm | 4 ++--
34 + lib/RG/Utils/Copf.pm | 14 +++++++-------
35 + lib/RG/Utils/Hssp_filter.pm | 14 +++++++-------
36 + 3 files changed, 16 insertions(+), 16 deletions(-)
37 +
38 +diff --git a/lib/RG/Utils/Conv_hssp2saf.pm b/lib/RG/Utils/Conv_hssp2saf.pm
39 +index 20bd803..f4a309e 100644
40 +--- a/lib/RG/Utils/Conv_hssp2saf.pm
41 ++++ b/lib/RG/Utils/Conv_hssp2saf.pm
42 +@@ -604,7 +604,7 @@ sub hsspRdAli {
43 + # of all numbers wanted (i.e. = $want[M])
44 + undef @ptr_numFin2numWant; # $ptr[M]= N : see previous, the other way around!
45 +
46 +- $#want=0 if (! defined @want);
47 ++ $#want=0 if (!@want);
48 + $LreadAll=0;
49 + # ------------------------------
50 + # digest input
51 +@@ -657,7 +657,7 @@ sub hsspRdAli {
52 + # sort the array
53 + @wantNum= sort bynumber (@wantNum);
54 + # too many wanted
55 +- if (defined @wantNum && ($wantNum[$#wantNum] > $locNum[$#locNum])){
56 ++ if (@wantNum && ($wantNum[$#wantNum] > $locNum[$#locNum])){
57 + $#tmp=0;
58 + foreach $want (@wantNum){
59 + if ($want <= $locNum[$#locNum]){
60 +diff --git a/lib/RG/Utils/Copf.pm b/lib/RG/Utils/Copf.pm
61 +index eb43700..c132f90 100644
62 +--- a/lib/RG/Utils/Copf.pm
63 ++++ b/lib/RG/Utils/Copf.pm
64 +@@ -2112,7 +2112,7 @@ sub brIniSet {
65 + $par{$kwd}=$par{"dirOut"}.$par{$kwd} if (-d $par{"dirOut"});}}
66 + # ------------------------------
67 + # push array of output files
68 +- $#fileOut=0 if (! defined @fileOut);
69 ++ $#fileOut=0 if (!@fileOut);
70 + foreach $kwd (@kwdFileOut){
71 + push(@fileOut,$par{$kwd});}
72 + # ------------------------------
73 +@@ -2240,7 +2240,7 @@ sub brIniWrt {
74 + printf $fhTraceLocSbr "--- %-20s '%-s'\n",$kwd,$par{$kwd};}}
75 + # ------------------------------
76 + # input files
77 +- if (defined @fileIn && $#fileIn>1){
78 ++ if (@fileIn && $#fileIn>1){
79 + # get dirs
80 + $#tmpdir=0; undef %tmpdir;
81 + foreach $file (@fileIn){
82 +@@ -2262,10 +2262,10 @@ sub brIniWrt {
83 + $tmp=$fileIn[$it2]; $tmp=~s/^.*\///g;
84 + printf $fhTraceLocSbr "%-18s ",$tmp;++$it2;}
85 + print $fhTraceLocSbr "\n";}}
86 +- elsif ((defined @fileIn && $#fileIn==1) || (defined $fileIn && -e $fileIn)){
87 ++ elsif ((@fileIn && $#fileIn==1) || (defined $fileIn && -e $fileIn)){
88 + $tmp=0;
89 + $tmp=$fileIn if (defined $fileIn && $fileIn);
90 +- $tmp=$fileIn[1] if (! $tmp && defined @fileIn && $#fileIn==1);
91 ++ $tmp=$fileIn[1] if (! $tmp && @fileIn && $#fileIn==1);
92 + print $fhTraceLocSbr "--- \n";
93 + printf $fhTraceLocSbr "--- %-20s '%-s'\n","Input file:",$tmp;}
94 + print $fhTraceLocSbr "--- \n";
95 +@@ -4737,7 +4737,7 @@ sub getSysARCH {
96 + # ------------------------------
97 + # (1) find in arguments passed
98 + # ------------------------------
99 +-# if (defined @argLoc && $#argLoc > 0) {
100 ++# if (@argLoc && $#argLoc > 0) {
101 + # foreach $arg (@argLoc) {
102 + # if ($arg=~/^ARCH=(\S+)/i) {
103 + # $archFound=$1;
104 +@@ -5022,7 +5022,7 @@ sub hsspRdAli {
105 + # of all numbers wanted (i.e. = $want[M])
106 + undef @ptr_numFin2numWant; # $ptr[M]= N : see previous, the other way around!
107 +
108 +- $#want=0 if (! defined @want);
109 ++ $#want=0 if (!@want);
110 + $LreadAll=0;
111 + # ------------------------------
112 + # digest input
113 +@@ -5075,7 +5075,7 @@ sub hsspRdAli {
114 + # sort the array
115 + @wantNum= sort bynumber (@wantNum);
116 + # too many wanted
117 +- if (defined @wantNum && ($wantNum[$#wantNum] > $locNum[$#locNum])){
118 ++ if (@wantNum && ($wantNum[$#wantNum] > $locNum[$#locNum])){
119 + $#tmp=0;
120 + foreach $want (@wantNum){
121 + if ($want <= $locNum[$#locNum]){
122 +diff --git a/lib/RG/Utils/Hssp_filter.pm b/lib/RG/Utils/Hssp_filter.pm
123 +index 0172713..1e31573 100644
124 +--- a/lib/RG/Utils/Hssp_filter.pm
125 ++++ b/lib/RG/Utils/Hssp_filter.pm
126 +@@ -1436,7 +1436,7 @@ sub brIniSet {
127 + $par{"$kwd"}=$par{"dirOut"}.$par{"$kwd"} if (-d $par{"dirOut"});}}
128 + # ------------------------------
129 + # push array of output files
130 +- $#fileOut=0 if (! defined @fileOut);
131 ++ $#fileOut=0 if (!@fileOut);
132 + foreach $kwd (@kwdFileOut){
133 + push(@fileOut,$par{"$kwd"});}
134 + # ------------------------------
135 +@@ -1564,7 +1564,7 @@ sub brIniWrt {
136 + printf $fhTraceLocSbr "--- %-20s '%-s'\n",$kwd,$par{"$kwd"};}}
137 + # ------------------------------
138 + # input files
139 +- if (defined @fileIn && $#fileIn>1){
140 ++ if (@fileIn && $#fileIn>1){
141 + # get dirs
142 + $#tmpdir=0; undef %tmpdir;
143 + foreach $file (@fileIn){
144 +@@ -1586,10 +1586,10 @@ sub brIniWrt {
145 + $tmp=$fileIn[$it2]; $tmp=~s/^.*\///g;
146 + printf $fhTraceLocSbr "%-18s ",$tmp;++$it2;}
147 + print $fhTraceLocSbr "\n";}}
148 +- elsif ((defined @fileIn && $#fileIn==1) || (defined $fileIn && -e $fileIn)){
149 ++ elsif ((@fileIn && $#fileIn==1) || (defined $fileIn && -e $fileIn)){
150 + $tmp=0;
151 + $tmp=$fileIn if (defined $fileIn && $fileIn);
152 +- $tmp=$fileIn[1] if (! $tmp && defined @fileIn && $#fileIn==1);
153 ++ $tmp=$fileIn[1] if (! $tmp && @fileIn && $#fileIn==1);
154 + print $fhTraceLocSbr "--- \n";
155 + printf $fhTraceLocSbr "--- %-20s '%-s'\n","Input file:",$tmp;}
156 + print $fhTraceLocSbr "--- \n";
157 +@@ -1816,7 +1816,7 @@ sub getSysARCH {
158 + # ------------------------------
159 + # (1) find in arguments passed
160 + # ------------------------------
161 +- if (defined @argLoc && $#argLoc > 0) {
162 ++ if (@argLoc && $#argLoc > 0) {
163 + foreach $arg (@argLoc) {
164 + if ($arg=~/^ARCH=(\S+)/i) {
165 + $archFound=$1;
166 +@@ -2318,7 +2318,7 @@ sub hsspFilterMarkFile {
167 + # check arguments
168 + return(0,"*** $sbrName: not def fileInLoc!") if (! defined $fileInLoc);
169 + return(0,"*** $sbrName: not def fileOutLoc!") if (! defined $fileOutLoc);
170 +- return(0,"*** $sbrName: not def \@takeLoc!") if (! defined @takeLoc || $#takeLoc<1);
171 ++ return(0,"*** $sbrName: not def \@takeLoc!") if (! @takeLoc || $#takeLoc<1);
172 + return(0,"*** $sbrName: miss in file '$fileInLoc'!") if (! -e $fileInLoc);
173 + # open files
174 + &open_file("$fhinLoc","$fileInLoc") ||
175 +@@ -2371,7 +2371,7 @@ sub hsspGetFile {
176 + $#dir2=$Lok=0;
177 + return(0,"no input file") if (! defined $fileInLoc);
178 + $chainLoc="";$idLoc=$fileInLoc;$idLoc=~s/^.*\///g;
179 +- $#dir=0 if (! defined @dir);
180 ++ $#dir=0 if (!@dir);
181 + $Lscreen=0 if (! defined $Lscreen);
182 + # passed dir instead of Lscreen
183 + if (-d $Lscreen) { @dir=($Lscreen,@dir);
184 +--
185 +2.14.3
186 +
187
188 diff --git a/dev-perl/librg-utils-perl/librg-utils-perl-1.0.43-r1.ebuild b/dev-perl/librg-utils-perl/librg-utils-perl-1.0.43-r1.ebuild
189 new file mode 100644
190 index 00000000000..88b8d7cf6e0
191 --- /dev/null
192 +++ b/dev-perl/librg-utils-perl/librg-utils-perl-1.0.43-r1.ebuild
193 @@ -0,0 +1,59 @@
194 +# Copyright 1999-2017 Gentoo Foundation
195 +# Distributed under the terms of the GNU General Public License v2
196 +
197 +EAPI=6
198 +
199 +inherit perl-module
200 +
201 +DESCRIPTION="Parsers and format conversion utilities used by (e.g.) profphd"
202 +HOMEPAGE="http://rostlab.org/"
203 +SRC_URI="ftp://rostlab.org/librg-utils-perl/${P}.tar.gz"
204 +
205 +SLOT="0"
206 +LICENSE="GPL-2"
207 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
208 +IUSE=""
209 +
210 +RDEPEND="
211 + dev-perl/List-MoreUtils"
212 +DEPEND="${RDEPEND}
213 + sci-libs/profphd-utils
214 + dev-perl/Module-Build
215 +"
216 +PATCHES=("${FILESDIR}/${P}-defined-array.patch")
217 +src_configure() {
218 + econf
219 + perl-module_src_configure
220 +}
221 +
222 +src_install() {
223 + rm mat/Makefile* || die
224 + perl-module_src_install
225 + insinto /usr/share/${PN}
226 + doins -r mat
227 + exeinto /usr/share/${PN}
228 + doexe *.pl dbSwiss
229 + doman blib/libdoc/*
230 +}
231 +src_test() {
232 + local MODULES=(
233 + "RG::Utils::Conv_hssp2saf"
234 + "RG::Utils::Hssp_filter"
235 + "RG::Utils::Copf"
236 + )
237 + local failed=()
238 + for dep in "${MODULES[@]}"; do
239 + ebegin "Compile testing ${dep}"
240 + perl -Mblib="${S}" -M"${dep} ()" -e1
241 + eend $? || failed+=( "$dep" )
242 + done
243 + if [[ ${failed[@]} ]]; then
244 + echo
245 + eerror "One or more modules failed compile:";
246 + for dep in "${failed[@]}"; do
247 + eerror " ${dep}"
248 + done
249 + die "Failing due to module compilation errors";
250 + fi
251 + perl-module_src_test
252 +}