Skip to contentSkip to conversation

utils/getdeveloperlib.py: fix issue with hasfile()

PATCH New Heiko Thiery 2 participants 2 messages Nov 13, 2020 – Nov 17, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 utils/getdeveloperlib.py: fix issue with hasfile()

pkg-stats is not able anymore to set the developers for defconfigs and packages. This issue is introduced with ae86067a151b6596ca492d6f94ed513f4f8e18d7. The hasfile() method from Developer object tries to check an absolute path against a relative path.

Convert the filepath to be checked also into an absolute path.

Cc Thomas Petazzoni <[email protected]>
---
 utils/getdeveloperlib.py | 1 +
 1 file changed, 1 insertion(+)
utils/getdeveloperlib.py +1 -0
index dc0cc07cc7..f57f41887b 100644
@@ -126,6 +126,7 @@ class Developer:
     def hasfile(self, f):
         f = os.path.abspath(f)
         for fs in self.files:
+            fs = os.path.abspath(fs)
             if f.startswith(fs):
                 return True
         return False
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 utils/getdeveloperlib.py: fix issue with hasfile()

Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Heiko" == Heiko Thiery <[email protected]> writes:

pkg-stats is not able anymore to set the developers for defconfigs and packages. This issue is introduced with ae86067a151b6596ca492d6f94ed513f4f8e18d7. The hasfile() method from Developer object tries to check an absolute path against a relative path.

Convert the filepath to be checked also into an absolute path.

Cc Thomas Petazzoni <[email protected]>

I know that Thomas has some pending patches to clean this up more, but this is a trivial change and fixes the immediate issue, so committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard