mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
man/check-os-release.py: strip trailing whitespace
The shell parser would do that, so so should we.
This commit is contained in:
@@ -10,7 +10,7 @@ def read_os_release():
|
||||
f = open('/usr/lib/os-release')
|
||||
|
||||
for line_number, line in enumerate(f):
|
||||
if m := re.match(r'([A-Z][A-Z_0-9]+)=(.*)', line):
|
||||
if m := re.match(r'([A-Z][A-Z_0-9]+)=(.*?)\s*$', line):
|
||||
name, val = m.groups()
|
||||
if val and val[0] in '"\'':
|
||||
val = ast.literal_eval(val)
|
||||
|
||||
Reference in New Issue
Block a user