From 3f9d6b2947721b953df07c8713674c76446312da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 17 Apr 2015 13:02:47 +0200 Subject: [PATCH] Don't try reading lines from directories --- fdroidserver/build.py | 2 ++ fdroidserver/common.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index f80fb933..e44dd5bb 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -434,6 +434,8 @@ def adapt_gradle(build_dir): if not filename.endswith('.gradle'): continue path = os.path.join(root, filename) + if not os.path.isfile(path): + continue logging.debug("Adapting %s at %s" % (filename, path)) FDroidPopen(['sed', '-i', diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 810cf729..ec4a6eea 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -1312,6 +1312,8 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver= if not filename.endswith('.gradle'): continue path = os.path.join(dir_path, filename) + if not os.path.isfile(path): + continue for line in file(path): match = version_regex.match(line) if match: @@ -1588,6 +1590,8 @@ def scan_source(build_dir, root_dir, thisbuild): warnproblem('unknown compressed or binary file', fd) elif has_extension(fp, 'java') and os.path.isfile(fp): + if not os.path.isfile(fp): + continue for line in file(fp): if 'DexClassLoader' in line: count += handleproblem('DexClassLoader', fd, fp)