-
Notifications
You must be signed in to change notification settings - Fork 69
Update constants for systemd 258 #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
$ ninja -C build update-constants -v ninja: Entering directory `build' [1/1] /home/zbyszek/src/python-systemd/update-constants.py /home/zbyszek/src/python-systemd/src/systemd/id128-constants.h /home/zbyszek/src/python-systemd/docs/id128.rst /home/zbyszek/src/python-systemd/src/systemd/id128-defines.h /usr/include/systemd/sd-messages.h Writing /home/zbyszek/src/python-systemd/src/systemd/id128-constants.h… Writing /home/zbyszek/src/python-systemd/src/systemd/id128-defines.h… Writing /home/zbyszek/src/python-systemd/docs/id128.rst… The helper is updated to do the everything in the python script. The wrapper in Makefile is dropped. It wasn't working properly anyway, and I think the version in meson is enough.
The previous commit changes the sorting algorithm, so a few lines moved up or down a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Changing the sed stuff to Python makes it a lot more readable.
defs = sum((list(defines(file)) for file in inputs), start=[]) | ||
defs = sorted(set(defs)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a bit obtuse, let's add a comment here.
defs = sum((list(defines(file)) for file in inputs), start=[]) | |
defs = sorted(set(defs)) | |
# Collect all messages into a single sorted, deduplicated list | |
defs = sum((list(defines(file)) for file in inputs), start=[]) | |
defs = sorted(set(defs)) |
assert 'SD_ID128_MAKE' in value | ||
yield name, value | ||
|
||
def process(output, docfile, inputs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: two empty lines
def process(output, docfile, inputs): | |
def process(output, docfile, inputs): |
assert 'SD_ID128_MAKE' in value | ||
yield name, value | ||
|
||
def process(output, docfile, inputs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inputs[0]
is special, since it will be rewritten, let's treat it separately
def process(output, docfile, inputs): | |
def process(output, docfile, msgheader, extra_inputs): |
|
||
with open(inputs[0], 'wt') as out: | ||
print(f'Writing {out.name}…') | ||
for (name, value) in defs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
for (name, value) in defs: | |
for name, value in defs: |
print(line, file=out) | ||
if 'autogenerated' in line: | ||
break | ||
for (name, value) in defs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
for (name, value) in defs: | |
for name, value in defs: |
|
||
include_dir = libsystemd_dep.get_variable(pkgconfig: 'includedir') | ||
|
||
update_constants = custom_target( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having bashed my head against meson for a bit now, shouldn't this be a run_target
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno. I copied from the systemd config, update-man-rules
target.
No description provided.