dt_makefile_patcher: fix dtbs with dot in filename#7194
dt_makefile_patcher: fix dtbs with dot in filename#7194amazingfate merged 1 commit intoarmbian:mainfrom
Conversation
162bceb to
b9391f4
Compare
rpardini
left a comment
There was a problem hiding this comment.
I can't grok regular expressions (even the ones I wrote lol), so I asked an LLM, and it said it's fine ✅
The difference between the two regular expressions lies in how they define the part that captures the filename (before the .dtb extension) and how they handle special characters.
-
regex_dtb = r"(.)\s(([a-zA-Z0-9-]+).dtb)(.)"
(.*): This captures any character (except newline) zero or more times before the space.
\s: This matches any whitespace character (space, tab, etc.).
([a-zA-Z0-9-]+): This captures one or more occurrences of any alphanumeric character (a-z, A-Z, 0-9), hyphen (-), or underscore (_).
.dtb: This matches the .dtb extension.
(.*): This captures any character zero or more times after the .dtb.
This regular expression is designed to match filenames that only contain alphanumeric characters, hyphens, and underscores before the .dtb extension. -
regex_dtb = r"(.)\s(([^ \f\n\r\t\v]+).dtb)(.)"
(.): Same as before, it captures any character zero or more times before the space.
\s: This matches any whitespace character.
([^ \f\n\r\t\v]+): This captures one or more characters that are not whitespace characters (spaces, form feeds, newlines, carriage returns, tabs, and vertical tabs).
.dtb: This matches the .dtb extension.
(.): This captures any character zero or more times after the .dtb.
This version is more flexible, as it allows for any character that is not a whitespace character before the .dtb extension, rather than restricting it to alphanumeric characters, hyphens, or underscores. It will capture filenames with special characters like @, #, $, etc., as long as they are not whitespace.
b9391f4 to
5e8f425
Compare
Description
We do not build dtbs with dot in filename because the current re match rule will ignore them.
This fixes #7187
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.
./compile.sh kernel-dtb BOARD=orangepi3b BRANCH=vendor DEB_COMPRESS=xz KERNEL_CONFIGURE=no KERNEL_GIT=shallowwith kernel https://github.com/dust-7/linux-rockchip/tree/opi3b-v2,rk3566-orangepi-3b-v1.1.dtbandrk3566-orangepi-3b-v1.1.dtbare built.Checklist:
Please delete options that are not relevant.