Revision: 6190
          http://ipcop.svn.sourceforge.net/ipcop/?rev=6190&view=rev
Author:   gespinasse
Date:     2011-12-26 14:26:13 +0000 (Mon, 26 Dec 2011)
Log Message:
-----------
Learn to find a file include by directory.
This is in fact very simple, just search too ^#file$

Simplify always replacing MACHINE and PERLVER form the file we search.
That would be twice faster for CPAN files only.

Adjust a few comments

Modified Paths:
--------------
    ipcop/trunk/tools/comp_md5.pl

Modified: ipcop/trunk/tools/comp_md5.pl
===================================================================
--- ipcop/trunk/tools/comp_md5.pl       2011-12-26 13:23:31 UTC (rev 6189)
+++ ipcop/trunk/tools/comp_md5.pl       2011-12-26 14:26:13 UTC (rev 6190)
@@ -162,26 +162,19 @@
 #        }
 #    }
 
-    # Hello, major hack. Find the package that causes the difference.
+    # Find the package the file come from : could be directly include or by 
directory in which case file is found with '#' prefix
     my $file_in_rootfile = substr($file, 1);
-    if ($file_in_rootfile eq 'usr/bin/[') { $file_in_rootfile = 'usr/bin/\['; 
} # simple escape
-    my $rootfile = `grep -l "^${file_in_rootfile}\$" 
$BASEDIR/config/rootfiles/common/* $BASEDIR/config/rootfiles/arch_$MACHINE/*`;
+    if ($file_in_rootfile eq 'usr/bin/[') { $file_in_rootfile = 'usr/bin/\['; 
} # simple escape for [
+    # Try with MACHINE and PERLVER replaced to find CPAN packages
+    $file_in_rootfile =~ s/$MACHINE/MACHINE/;
+    $file_in_rootfile =~ s/$PERLVER/PERLVER/;
+    #print "Searching for $file_in_rootfile package\n";
+    my $rootfile = `egrep -l "^${file_in_rootfile}\$|^#${file_in_rootfile}\$" 
$BASEDIR/config/rootfiles/common/* $BASEDIR/config/rootfiles/arch_$MACHINE/*`;
     chomp($rootfile);
     if (-e "$rootfile") {
         $rootfile = `basename $rootfile`;
         chomp($rootfile);
     }
-    else {
-        # Try again with MACHINE and PERLVER replaced to find CPAN packages
-        $file_in_rootfile =~ s/$MACHINE/MACHINE/;
-        $file_in_rootfile =~ s/$PERLVER/PERLVER/;
-        $rootfile = `grep -l "^${file_in_rootfile}\$" 
$BASEDIR/config/rootfiles/common/* $BASEDIR/config/rootfiles/arch_$MACHINE/*`;
-        chomp($rootfile);
-        if (-e "$rootfile") {
-            $rootfile = `basename $rootfile`;
-            chomp($rootfile);
-        }
-    }
     printf OUTLIST "DIFF    %-60s %s\n", $file, $rootfile;
 }
 close (OUTLIST);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Ipcop-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to