From 8e89cf511d8d1ecc18476df98b0b29d6a771480e Mon Sep 17 00:00:00 2001 From: SilentGhost Date: Fri, 6 Sep 2024 15:05:36 +0200 Subject: [PATCH] Correct traversing cibase Partly revert d9aab228 and fix bug introduced in 548f73d9: modifying list that is being iterated over --- fdroidserver/nightly.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/fdroidserver/nightly.py b/fdroidserver/nightly.py index 0f623580..1b7251ee 100644 --- a/fdroidserver/nightly.py +++ b/fdroidserver/nightly.py @@ -438,17 +438,12 @@ Last updated: {date}'''.format(repo_git_base=repo_git_base, ) for root, dirs, files in os.walk(cibase): - if root.startswith(repo_basedir): - logging.error( - _('Broken dirs.remove(d): {root} is part of {repo_basedir} and should not be scanned').format( - root=root, - repo_basedir=repo_basedir - ) - ) - continue - for d in dirs: - if d == '.git' or d == '.gradle' or (d == 'fdroid' and root == cibase): + for d in ('.git', '.gradle'): + if d in dirs: dirs.remove(d) + if root == cibase and 'fdroid' in dirs: + dirs.remove('fdroid') + for f in files: if f.endswith('-debug.apk'): apkfilename = os.path.join(root, f)