* [Buildroot] [PATCH v2 1/1] utils/check-package: add a check for the new spacing convention
@ 2020-05-31 20:42 Heiko Thiery
2020-06-02 21:24 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Heiko Thiery @ 2020-05-31 20:42 UTC (permalink / raw)
To: buildroot
The seperation of the fields in the hash file should be 2 spaces for
consistency.
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
---
utils/checkpackagelib/lib_hash.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/utils/checkpackagelib/lib_hash.py b/utils/checkpackagelib/lib_hash.py
index 3e381119a5..a82ef23fe7 100644
--- a/utils/checkpackagelib/lib_hash.py
+++ b/utils/checkpackagelib/lib_hash.py
@@ -40,7 +40,7 @@ class HashType(_CheckFunction):
if len(fields) < 2:
return
- htype, hexa = fields[:2]
+ htype, hexa, filename = fields[:3]
if htype == "none":
return
if htype not in self.len_of_hash.keys():
@@ -53,3 +53,7 @@ class HashType(_CheckFunction):
.format(self.filename, lineno, self.url_to_manual),
text,
"expected {} hex digits".format(self.len_of_hash[htype])]
+ if not re.match("^{} {} {}.*$".format(htype, hexa, filename), text):
+ return ["{}:{}: separation does not match expectation "
+ "({}#adding-packages-hash)"
+ .format(self.filename, lineno, self.url_to_manual), text]
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH v2 1/1] utils/check-package: add a check for the new spacing convention
2020-05-31 20:42 [Buildroot] [PATCH v2 1/1] utils/check-package: add a check for the new spacing convention Heiko Thiery
@ 2020-06-02 21:24 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2020-06-02 21:24 UTC (permalink / raw)
To: buildroot
On Sun, 31 May 2020 22:42:31 +0200
Heiko Thiery <heiko.thiery@gmail.com> wrote:
> The seperation of the fields in the hash file should be 2 spaces for
> consistency.
>
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
> Cc: Yann E. MORIN <yann.morin.1998@free.fr>
I'm not sure how to proceed with this: it causes a huge number of
warnings, because there are many packages still not fixed.
So, two options:
(1) We merge this and live for warnings for the next few weeks until
all packages are fixed. The advantage is that people will notice that
packages need to be fixed.
(2) We wait until all packages are fixed, and then we merge the
check-package change to make sure we don't regress on this.
I'm not sure which is best. Perhaps we need to do (2) for a little
while in order to reduce the number of warnings, and then go for (1) ?
I'm not sure.
In any case, I'm also getting some weird Python exceptions while
running "make check-package":
Traceback (most recent call last):
File "./utils/check-package", line 194, in <module>
__main__()
File "./utils/check-package", line 177, in __main__
nwarnings, nlines = check_file_using_lib(fname)
File "./utils/check-package", line 146, in check_file_using_lib
nwarnings += print_warnings(cf.check_line(lineno + 1, text))
File "/home/thomas/projets/buildroot/utils/checkpackagelib/lib_hash.py", line 56, in check_line
if not re.match("^{} {} {}.*$".format(htype, hexa, filename), text):
File "/usr/lib64/python3.8/re.py", line 191, in match
return _compile(pattern, flags).match(string)
File "/usr/lib64/python3.8/re.py", line 304, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/lib64/python3.8/sre_compile.py", line 764, in compile
p = sre_parse.parse(p, flags)
File "/usr/lib64/python3.8/sre_parse.py", line 948, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
File "/usr/lib64/python3.8/sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "/usr/lib64/python3.8/sre_parse.py", line 671, in _parse
raise source.error("multiple repeat",
re.error: multiple repeat at position 50
make: *** [Makefile:1203: check-package] Error 1
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-02 21:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-31 20:42 [Buildroot] [PATCH v2 1/1] utils/check-package: add a check for the new spacing convention Heiko Thiery
2020-06-02 21:24 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox