Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-perl
Navigation:
Lists: gentoo-perl: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-perl@g.o
From: antoine.raillon@...
Subject: Réf. : sub ebuild_exists - a lot of lc($dir)
Date: Thu, 12 May 2005 08:11:47 +0200



> $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 
             s.net>                    gentoo-perl@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                                              
                  oo.org                                                   
                                                                           
                                                                           
                                                                           






 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

Replies:
Re: Réf. : sub ebuild_exists - a lot of lc($dir)
-- Michael Cummings
References:
sub ebuild_exists - a lot of lc($dir)
-- David (Sniper) Rigaudiere
Navigation:
Lists: gentoo-perl: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
sub ebuild_exists - a lot of lc($dir)
Next by thread:
Re: Réf. : sub ebuild_exists - a lot of lc($dir)
Previous by date:
g-cpan.pl
Next by date:
Réf. : look'n'feel


Updated Jun 17, 2009

Summary: Archive of the gentoo-perl mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.