mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
armbian-next: patching: remove quotes from author name during parsing
This commit is contained in:
@@ -277,10 +277,10 @@ class PatchInPatchFile:
|
||||
self.problems.append("invalid_author")
|
||||
log.warning(
|
||||
f"Failed to parse name and email from: '{from_str}' while parsing patch {self.counter} in file {self.parent.full_file_path()}")
|
||||
return downgrade_to_ascii(from_str), "unknown-email@domain.tld"
|
||||
return downgrade_to_ascii(remove_quotes(from_str)), "unknown-email@domain.tld"
|
||||
else:
|
||||
# Return the name and email
|
||||
return downgrade_to_ascii(m.group("name")), m.group("email")
|
||||
return downgrade_to_ascii(remove_quotes(m.group("name"))), remove_quotes(m.group("email"))
|
||||
|
||||
def one_line_patch_stats(self) -> str:
|
||||
files_desc = ", ".join(self.patched_file_stats_dict)
|
||||
@@ -713,6 +713,10 @@ def downgrade_to_ascii(utf8: str) -> str:
|
||||
return unidecode(utf8)
|
||||
|
||||
|
||||
def remove_quotes(utf8: str) -> str:
|
||||
return utf8.replace('"', '')
|
||||
|
||||
|
||||
# Try hard to read a possibly invalid utf-8 file
|
||||
def read_file_as_utf8(file_name: str) -> tuple[str, list[str]]:
|
||||
with open(file_name, "rb") as f:
|
||||
|
||||
Reference in New Issue
Block a user