mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 15:32:30 +03:00
scanner: don't error on partially used globs
This meant that using something like `scanignore=*` would error if there were ignores happening in some directories/files, but not all. Fixes #110
This commit is contained in:
parent
59f5d19dfe
commit
d8e1f296e0
1 changed files with 12 additions and 10 deletions
|
@ -72,24 +72,26 @@ def scan_source(build_dir, root_dir, thisbuild):
|
||||||
if r.match(s):
|
if r.match(s):
|
||||||
yield n
|
yield n
|
||||||
|
|
||||||
scanignore = common.getpaths(build_dir, thisbuild['scanignore'])
|
scanignore = common.getpaths_map(build_dir, thisbuild['scanignore'])
|
||||||
scandelete = common.getpaths(build_dir, thisbuild['scandelete'])
|
scandelete = common.getpaths_map(build_dir, thisbuild['scandelete'])
|
||||||
|
|
||||||
scanignore_worked = set()
|
scanignore_worked = set()
|
||||||
scandelete_worked = set()
|
scandelete_worked = set()
|
||||||
|
|
||||||
def toignore(fd):
|
def toignore(fd):
|
||||||
for p in scanignore:
|
for k, paths in scanignore.iteritems():
|
||||||
if fd.startswith(p):
|
for p in paths:
|
||||||
scanignore_worked.add(p)
|
if fd.startswith(p):
|
||||||
return True
|
scanignore_worked.add(k)
|
||||||
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def todelete(fd):
|
def todelete(fd):
|
||||||
for p in scandelete:
|
for k, paths in scandelete.iteritems():
|
||||||
if fd.startswith(p):
|
for p in paths:
|
||||||
scandelete_worked.add(p)
|
if fd.startswith(p):
|
||||||
return True
|
scandelete_worked.add(k)
|
||||||
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def ignoreproblem(what, fd, fp):
|
def ignoreproblem(what, fd, fp):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue