CVS update by matsl xemacs-builds/matsl/gplv3 ...

xemacs-cvs at xemacs.org xemacs-cvs at xemacs.org
Wed Jan 9 05:24:50 EST 2008


  User: matsl   
  Date: 08/01/09 11:24:50

  Modified:    xemacs-builds/matsl/gplv3 findgplv2
Log:
Patch from Jerry James.

Revision  Changes    Path
1.2       +13 -12    XEmacs/xemacs-builds/matsl/gplv3/findgplv2

Index: findgplv2
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs-builds/matsl/gplv3/findgplv2,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- findgplv2	2008/01/09 10:19:38	1.1
+++ findgplv2	2008/01/09 10:24:50	1.2
@@ -14,10 +14,10 @@ import re
 maxSearchLines = 200
 
 # Don't recurse down these folders
-ignoreDirNames = re.compile('\.|\.\.|CVS')
+ignoreDirNames = re.compile('\.|\.\.|\.hg|CVS')
 
 # Don't bother with these files at all.
-ignoreFiles = re.compile('^.*\.(png|xbm|xpm)$')
+ignoreFiles = re.compile('.*\.(bmp|gpg|ico|png|ps\.gz|xbm|xpm)$|\.(cvs|hg)(ignore|tags)|README.*|.*(~|ChangeLog|NEWS)|depend|dir|install-sh|COPYING')
 
 gplv2 = re.compile('GNU General Public License as published by the Free Software Foundation; either version 2(| of the License), or \(at your option\) any later version\.')
 lgplv2 = re.compile('GNU Library General Public License as published by the Free Software Foundation; either version 2(| of the License), or \(at your option\) any later version\.')
@@ -47,25 +47,26 @@ def fileToStr(f):
     return ' '.join(lines)
 
 def checkGPLv2(f):
-    print '"' + f + '"',
     fstr = fileToStr(f)
     if gplv2.search(fstr):
-        print 'GPLv2'
+        pass
     elif lgplv2.search(fstr):
-        print 'LGPLv2'
+        pass
     else:
-        print '?'
-        
+        print f
+
 def findFiles(p):
     for f in os.listdir(p):
-        if ignoreFiles.match(f) or ignoreDirNames.match(f):
+        fn = os.path.join(p, f)
+        isdir = os.path.isdir(fn)
+
+        if (not isdir and ignoreFiles.match(f)) or (isdir and ignoreDirNames.match(f)):
             continue
 
-        fn = os.path.join(p, f)
-        if os.path.isdir(fn):
+        if isdir:
             findFiles(fn)
             continue
-        
+
         checkGPLv2(fn)
-    
+
 findFiles('.')





More information about the XEmacs-CVS mailing list