代码拉取完成,页面将自动刷新
同步操作将从 openKylin/linux-firmware 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/bin/python
import os, re, sys
from io import open
def list_whence():
with open('WHENCE', encoding='utf-8') as whence:
for line in whence:
match = re.match(r'(?:File|Source):\s*"(.*)"', line)
if match:
yield match.group(1)
continue
match = re.match(r'(?:File|Source):\s*(\S*)', line)
if match:
yield match.group(1)
continue
match = re.match(r'Licen[cs]e: (?:.*\bSee (.*) for details\.?|(\S*))\n',
line)
if match:
if match.group(1):
for name in re.split(r', | and ', match.group(1)):
yield name
continue
if match.group(2):
# Just one word - may or may not be a filename
if not re.search(r'unknown|distributable', match.group(2),
re.IGNORECASE):
yield match.group(2)
continue
def list_git():
with os.popen('git ls-files') as git_files:
for line in git_files:
yield line.rstrip('\n')
def main():
ret = 0
whence_list = list(list_whence())
known_files = set(name for name in whence_list if not name.endswith('/')) | \
set(['check_whence.py', 'configure', 'Makefile',
'README', 'copy-firmware.sh', 'WHENCE'])
known_prefixes = set(name for name in whence_list if name.endswith('/'))
git_files = set(list_git())
for name in sorted(list(known_files - git_files)):
sys.stderr.write('E: %s listed in WHENCE does not exist\n' % name)
ret = 1
for name in sorted(list(git_files - known_files)):
# Ignore subdirectory changelogs and GPG detached signatures
if (name.endswith('/ChangeLog') or
(name.endswith('.asc') and name[:-4] in known_files)):
continue
# Ignore unknown files in known directories
for prefix in known_prefixes:
if name.startswith(prefix):
break
else:
sys.stderr.write('E: %s not listed in WHENCE\n' % name)
ret = 1
return ret
if __name__ == '__main__':
sys.exit(main())
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。