Skip to contentSkip to conversation

utils/getdeveloperlib.py: handle file removal

PATCH In review Daniel Lang 2 participants 2 messages Sep 11, 2023 – Sep 15, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 utils/getdeveloperlib.py: handle file removal

If a patch only removes files, it is ignored. Meaning, that the registered developer isn't automatically picked up when calling get-developer.
Fix this by also checking if the line starts with ---, as a patch removing a file has a line starting with --- with the name of the removed file and one started with +++ /dev/null.
A set is used to store the changed files, which doesn't allow duplicates. Therefore normal patches aren't affected by this change.

---
 utils/getdeveloperlib.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
utils/getdeveloperlib.py +1 -1
index e7d0d23e49..469360b801 100644
@@ -25,7 +25,7 @@ def analyze_patch(patch):
         m = FIND_INFRA_IN_PATCH.match(line)
         if m:
             infras.add(m.group(2))
-        if not line.startswith("+++ "):
+        if not line.startswith("+++ ") and not line.startswith("--- "):
             continue
         line.strip()
         fname = line[line.find("/") + 1:].strip()
Signature · 6 lines
2.42.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Daniel" == Daniel Lang <[email protected]> writes:

If a patch only removes files, it is ignored. Meaning, that the registered developer isn't automatically picked up when calling get-developer.
Fix this by also checking if the line starts with ---, as a patch removing a file has a line starting with --- with the name of the removed file and one started with +++ /dev/null.
A set is used to store the changed files, which doesn't allow duplicates. Therefore normal patches aren't affected by this change.

Quoted 1 line

Committed to 2023.02.x, 2023.05.x and 2023.08.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot