Skip to contentSkip to conversation

fetch2/perforce: Fix localfile to include ud.module

PATCH New Richard Purdie 1 participant 1 message Jan 21, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fetch2/perforce: Fix localfile to include ud.module

As reported by Katu Txakur, the output depends on the module path set so this needs to be accounted for in localfile.

---
 lib/bb/fetch2/perforce.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/bb/fetch2/perforce.py +2 -1
index 6f3c95b6ce..da6d337461 100644
@@ -119,6 +119,7 @@ class Perforce(FetchMethod):
         cleanedpath = ud.path.replace('/...', '').replace('/', '.')
         cleanedhost = ud.host.replace(':', '.')
 
+        cleanedmodule = ""
         # Merge the path and module into the final depot location
         if ud.module:
             if ud.module.find('/') == 0:
@@ -133,7 +134,7 @@ class Perforce(FetchMethod):
 
         ud.setup_revisions(d)
 
-        ud.localfile = d.expand('%s_%s_%s.tar.gz' % (cleanedhost, cleanedpath, ud.revision))
+        ud.localfile = d.expand('%s_%s_%s_%s.tar.gz' % (cleanedhost, cleanedpath, cleandedmodule, ud.revision))
 
     def _buildp4command(self, ud, d, command, depot_filename=None):
         """
Signature · 1 line
2.27.0