From c062ff23f231c8d8e14b9168841e532768a382ec Mon Sep 17 00:00:00 2001 From: Ricardo Martincoski Date: Sun, 21 Nov 2021 18:57:13 -0300 Subject: [PATCH] utils/getdeveloperlib.py: fix developer being reported for unrelated path Currently, by following the instructions in the manual and querying for developers for a patch that changes path package/foobar the script reports both developers that have these entries in the DEVELOPERS file: F: package/foo/ F: package/foobar/ Starting from commit "afc112b0e4 utils/getdeveloperlib.py: fix issue with hasfile()" get-developers script uses os.path.abspath() and os.path.relpath(). The catch is that those functions return the absolute path and the relative path without the trailing slash. When the paths associated to a developer are then compared to the paths a patch touches, using the string.startswith(), any substring returns True, leading to developers for package/foo/ being wrongly reported for package/foobar/ . Fix this by re-adding the trailing slash after using relpath(). Signed-off-by: Ricardo Martincoski Cc: Heiko Thiery Cc: James Knight Cc: Thomas Petazzoni Signed-off-by: Arnout Vandecappelle (Essensium/Mind) (cherry picked from commit 29bb478a49712dfa8ec25262cac77b7c8ff1e51f) Signed-off-by: Peter Korsgaard --- utils/getdeveloperlib.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/getdeveloperlib.py b/utils/getdeveloperlib.py index e686bc793f..2575c87a36 100644 --- a/utils/getdeveloperlib.py +++ b/utils/getdeveloperlib.py @@ -254,6 +254,8 @@ def parse_developers(): for f in dev_files: dev_file = os.path.relpath(f, brpath) dev_file = dev_file.replace(os.sep, '/') # force unix sep + if f[-1] == '/': # relpath removes the trailing / + dev_file = dev_file + '/' files.append(dev_file) elif line == "": if not name: