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
In Reply to: [gentoo-perl] sub ebuild_exists - a lot of lc($dir) by "David (Sniper) Rigaudiere"
> $cab->todo->add('svn commit notif email script'); # ;-)
Theory says it's already there. However, it's not working ;) I guess it's quie easy to debug but i didn't haev the time yet. Remember : i'm a beginner with svn systems ;) "David (Sniper) Rigaudiere" <sniper@mongueur Pour> gentoo-perl@l.g.o cc 12/05/2005 03:11 Objet [gentoo-perl] sub ebuild_exists - a Veuillez lot of lc($dir) répondre à gentoo-perl@gent sub ebuild_exists { - my ($dir) = lc $_[0]; + my ($dir) = $_[0]; # need to try harder here - see &portage_dir comments. # should return an ebuild name from this, as case matters. @@ -264,8 +270,9 @@ next if not -d $sdir; opendir PDIR, $sdir or fatal(ERR_FOLDER_OPEN, $sdir, $!); while(my $file = readdir PDIR) { - if(lc $file eq $dir) { - $found = $dir; + if(lc $file eq lc $dir) { + my $cat = basename($sdir); + $found = "$cat/$file"; I don't understand this modification. Why lc($dir) for each file in PDIR, best is one and only lc($dir) at the start of sub for best performances. If $found must be the original $dir w/o case change, I propose : sub ebuild_exists { my ($dir) = @_; my $lcase_dir = lc $dir; [...later...] while(my $file = readdir PDIR) { if(lc $file eq $lcase_dir) { $found = $dir; $cab->todo->add('svn commit notif email script'); # ;-) David "Sniper" Rigaudiere GPG KeyID 0xFF1E982D -- gentoo-perl@g.o mailing list -- gentoo-perl@g.o mailing list


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