���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /home/real/node-v13.0.1/tools/v8_gypfiles/ |
# Copyright (c) 2019 Refael Ackeramnn<[email protected]>. All rights reserved. # Use of this source code is governed by an MIT-style license. import re import os PLAIN_SOURCE_RE = re.compile('\s*"([^/$].+)"\s*') def DoMain(args): gn_filename, pattern = args src_root = os.path.dirname(gn_filename) with open(gn_filename, 'rb') as gn_file: gn_content = gn_file.read().decode('utf-8') scraper_re = re.compile(pattern + r'\[([^\]]+)', re.DOTALL) matches = scraper_re.search(gn_content) match = matches.group(1) files = [] for l in match.splitlines(): m2 = PLAIN_SOURCE_RE.match(l) if not m2: continue files.append(m2.group(1)) # always use `/` since GYP will process paths further downstream rel_files = ['"%s/%s"' % (src_root, f) for f in files] return ' '.join(rel_files)