From be68fdf87b4bc25b77832b6868efda4d89dd2b36 Mon Sep 17 00:00:00 2001 From: Kevin Kofler Date: Wed, 7 Jun 2017 19:33:48 +0200 Subject: [PATCH] Update get_free_ffmpeg_source_files.py from Chromium dist-git There are no longer 'ffmpeg_branding == "Chromium"' conditionals, we need to key on the absence of 'ffmpeg_branding == "Chrome"' or 'ffmpeg_branding == "ChromeOS"' conditionals instead. --- get_free_ffmpeg_source_files.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/get_free_ffmpeg_source_files.py b/get_free_ffmpeg_source_files.py index e659d63..5a0e421 100755 --- a/get_free_ffmpeg_source_files.py +++ b/get_free_ffmpeg_source_files.py @@ -50,19 +50,24 @@ def parse_ffmpeg_gyni_file(gyni_path, arch_not_arm): # Get all the sections. sections = re.findall(r"if (.*?})", content, re.DOTALL) for section in sections: - # Get all the conditions (first group) and sources (second group)for the + # Get all the conditions (first group) and sources (second group) for the # current section. blocks = re.findall(r"(\(.*?\))\s\{(.*?)\}", section, re.DOTALL) for block in blocks: conditions = re.findall(r"\(?\((.*?)\)", block[0]) + inserted = False for condition in conditions: - limitations = ['is_linux', 'ffmpeg_branding == "Chromium"'] - if all(limitation in condition for limitation in limitations): + if inserted: + break + limitations = ['ffmpeg_branding == "Chrome"', 'ffmpeg_branding == "ChromeOS"'] + if ('is_linux' in condition) and not any(limitation in condition for limitation in limitations): if (arch_not_arm): if ('x64' in condition) or ('x86' in condition): parse_sources (block[1], output_sources, arch_not_arm) + inserted = True else: parse_sources (block[1], output_sources, arch_not_arm) + inserted = True print ' '.join(output_sources)