chiark / gitweb /
Merge branch 'master' into logging
authorDaniel Martí <mvdan@mvdan.cc>
Thu, 30 Jan 2014 22:58:23 +0000 (23:58 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Thu, 30 Jan 2014 22:58:23 +0000 (23:58 +0100)
Conflicts:
fdroidserver/common.py

1  2 
fdroidserver/common.py

index 9469f77645934b2dc0b8e1dc498f7ff24c275859,4a85bf3dc659d83cd3adcf81f1042a8274849139..413937ce3288e0406da2c03054054fce0bbc8645
@@@ -1210,16 -1239,20 +1210,20 @@@ def scan_source(build_dir, root_dir, th
              problems.append('Found %s at %s' % (what, fd))
  
      def warnproblem(what, fd, fp):
 -        print 'Warning: Found %s at %s' % (what, fd)
 +        logging.info('Warning: Found %s at %s' % (what, fd))
  
 -    # Iterate through all files in the source code...
+     def insidedir(path, dirname):
+         return path.endswith('/%s' % dirname) or '/%s/' % dirname in path
 +    # Iterate through all files in the source code
      for r,d,f in os.walk(build_dir):
-         for curfile in f:
  
-             if '/.hg' in r or '/.git' in r or '/.svn' in r:
-                 continue
+         if any(insidedir(r, igndir) for igndir in ('.hg', '.git', '.svn')):
+             continue
+         for curfile in f:
  
 -            # Path (relative) to the file...
 +            # Path (relative) to the file
              fp = os.path.join(r, curfile)
              fd = fp[len(build_dir):]