Gentoo Archives: gentoo-perl

From: antoine.raillon@××××.com
To: gentoo-perl@l.g.o
Subject: Réf. : [gentoo-perl] sub ebuild_exists - a lot of lc($dir)
Date: Thu, 12 May 2005 06:11:49
Message-Id: OF86162A29.874955B4-ONC1256FFF.0021E6C0-C1256FFF.002209BA@mpsa.com
In Reply to: [gentoo-perl] sub ebuild_exists - a lot of lc($dir) by "David (Sniper) Rigaudiere"
1 > $cab->todo->add('svn commit notif email script'); # ;-)
2
3 Theory says it's already there. However, it's not working ;)
4 I guess it's quie easy to debug but i didn't haev the time yet. Remember :
5 i'm a beginner with svn systems ;)
6
7
8
9
10 "David (Sniper)
11 Rigaudiere"
12 <sniper@mongueur Pour
13 s.net> gentoo-perl@l.g.o
14 cc
15 12/05/2005 03:11
16 Objet
17 [gentoo-perl] sub ebuild_exists - a
18 Veuillez lot of lc($dir)
19 répondre à
20 gentoo-perl@gent
21 oo.org
22
23
24
25
26
27
28
29
30
31 sub ebuild_exists {
32 - my ($dir) = lc $_[0];
33 + my ($dir) = $_[0];
34
35 # need to try harder here - see &portage_dir comments.
36 # should return an ebuild name from this, as case matters.
37 @@ -264,8 +270,9 @@
38 next if not -d $sdir;
39 opendir PDIR, $sdir or fatal(ERR_FOLDER_OPEN, $sdir, $!);
40 while(my $file = readdir PDIR) {
41 - if(lc $file eq $dir) {
42 - $found = $dir;
43 + if(lc $file eq lc $dir) {
44 + my $cat = basename($sdir);
45 + $found = "$cat/$file";
46
47
48
49
50 I don't understand this modification.
51 Why lc($dir) for each file in PDIR, best is one and only lc($dir) at the
52 start
53 of sub for best performances.
54
55 If $found must be the original $dir w/o case change, I propose :
56
57
58 sub ebuild_exists {
59 my ($dir) = @_;
60 my $lcase_dir = lc $dir;
61
62 [...later...]
63
64 while(my $file = readdir PDIR) {
65 if(lc $file eq $lcase_dir) {
66 $found = $dir;
67
68
69 $cab->todo->add('svn commit notif email script'); # ;-)
70
71 David "Sniper" Rigaudiere
72 GPG KeyID 0xFF1E982D
73
74 --
75 gentoo-perl@g.o mailing list
76
77
78
79
80 --
81 gentoo-perl@g.o mailing list

Replies

Subject Author
Re: Réf. : [gentoo-perl] sub ebuild_exists - a lot of lc($dir) Michael Cummings <mcummings@g.o>