From c4b77fbe1eb5074d21dc0b8ea5eb44721ee7821a Mon Sep 17 00:00:00 2001 From: Jean Abou Samra Date: Sun, 22 May 2022 19:58:14 +0200 Subject: [PATCH] merge.py: Use git ls-files to get list of downstream PO files The previous method could lead to problems if a dependency installed within venv/ shipped with its own PO files. --- merge.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/merge.py b/merge.py index d15bf23d..08aa0dee 100644 --- a/merge.py +++ b/merge.py @@ -123,9 +123,8 @@ def main(): for file in pot_path.glob("**/*.pot") } downstream = { - po - for po in Path(".").glob("**/*.po") - if not (po.is_relative_to(Path("locales")) or po.is_relative_to(Path(".git"))) + Path(po) + for po in run("git", "ls-files", "*.po", stdout=PIPE).stdout.splitlines() } copy_new_files(upstream - downstream, pot_path=pot_path) update_known_files(upstream & downstream, pot_path=pot_path)