Also the ./ prefix is not being stripped from the filename prior to being inserted in the automake chunk, which also causes it to not sort correctly. (despite the usage example showing a ./ prefix.)
Nit: maybe we could use os.path.relpath() for consistency with topdir_file()?
I found the path handling in this script really hard to understand. So I created a PR that distinguishes tor-relative (topdir, renamed to tordir) and tor/src-relative (srcdir) paths. I also made the canonicalisation more reliable.
I found the path handling in this script really hard to understand. So I created a PR that distinguishes tor-relative (topdir, renamed to tordir) and tor/src-relative (srcdir) paths. I also made the canonicalisation more reliable.
I had to rebase to avoid conflicts with the include.am split from #32137 (moved).
Thanks! This is a lot easier to understand now. Looks good to me.
Nits:
Maybe we should avoid using assert() for invalid user input? I prefer to reserve assertions for internal inconsistencies. On the other hand, this is a maintainer tool, and I suspect it's not especially confusing if there's an assertion failure?
I ran this in a build directory, whereupon it created the files but couldn't find the include.am to modify. Maybe we should also look for a src/Makefile.am?
These are fairly minor and I'm also ok with merging this as is.