2022-05-21 23:21:24 +09:00
|
|
|
import requests
|
|
|
|
|
|
|
|
|
2022-05-22 00:46:39 +09:00
|
|
|
res = requests.get(
|
|
|
|
'https://raw.githubusercontent.com/brain-hackers/buildbrain/master/os-brainux/setup_brainux.sh'
|
|
|
|
)
|
2022-05-21 23:21:24 +09:00
|
|
|
lines = res.text.split('\n')
|
|
|
|
|
|
|
|
found_packages = []
|
|
|
|
backslashed = False
|
|
|
|
|
2022-05-22 00:46:39 +09:00
|
|
|
for (i, line) in enumerate(lines):
|
2022-05-21 23:21:24 +09:00
|
|
|
if line.strip().startswith('apt install') or backslashed:
|
|
|
|
if backslashed:
|
|
|
|
packages = line.strip().split(' ')
|
|
|
|
else:
|
|
|
|
packages = line.strip().split(' ')[2:]
|
|
|
|
packages = [p for p in packages if not p.startswith('-')]
|
|
|
|
packages = [p for p in packages if not p == '\\']
|
|
|
|
packages = [p.rstrip('\\') for p in packages]
|
|
|
|
found_packages.extend(packages)
|
|
|
|
backslashed = line.endswith('\\')
|
|
|
|
|
2022-05-21 23:49:28 +09:00
|
|
|
print('|パッケージ名|')
|
|
|
|
print('|:-|')
|
2022-05-22 00:46:39 +09:00
|
|
|
print('\n'.join(f'|{p}|' for p in found_packages))
|