mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
Handle dirs to be ignored in scan_source more gracefully
This commit is contained in:
parent
3f47b4914d
commit
1b0fb05337
1 changed files with 8 additions and 3 deletions
|
|
@ -1241,13 +1241,18 @@ def scan_source(build_dir, root_dir, thisbuild):
|
||||||
def warnproblem(what, fd, fp):
|
def warnproblem(what, fd, fp):
|
||||||
print 'Warning: Found %s at %s' % (what, fd)
|
print 'Warning: Found %s at %s' % (what, fd)
|
||||||
|
|
||||||
|
def insidedir(path, dirname):
|
||||||
|
return path.endswith('/%s' % dirname) or '/%s/' % dirname in path
|
||||||
|
|
||||||
# Iterate through all files in the source code...
|
# Iterate through all files in the source code...
|
||||||
for r,d,f in os.walk(build_dir):
|
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:
|
if any(insidedir(r, igndir) for igndir in ('.hg', '.git', '.svn')):
|
||||||
|
print r
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
for curfile in f:
|
||||||
|
|
||||||
# Path (relative) to the file...
|
# Path (relative) to the file...
|
||||||
fp = os.path.join(r, curfile)
|
fp = os.path.join(r, curfile)
|
||||||
fd = fp[len(build_dir):]
|
fd = fp[len(build_dir):]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue