diff mbox series

[2/2] cache: Simplify virtualfn2realfn()

Message ID 20231121020951.1069234-2-pkj@axis.com
State Accepted, archived
Commit d766e9bd22ec6392fbf1694eea5032b9d09f1949
Headers show
Series [1/2] cookerdata: Be consistent with what type bb_data represents | expand

Commit Message

Peter Kjellerstedt Nov. 21, 2023, 2:09 a.m. UTC
Also correct the description of variant2virtual().

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 bitbake/lib/bb/cache.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index 5ea41c5de0..18d5574a31 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -344,9 +344,7 @@  def virtualfn2realfn(virtualfn):
     """
     mc = ""
     if virtualfn.startswith('mc:') and virtualfn.count(':') >= 2:
-        elems = virtualfn.split(':')
-        mc = elems[1]
-        virtualfn = ":".join(elems[2:])
+        (_, mc, virtualfn) = virtualfn.split(':', 2)
 
     fn = virtualfn
     cls = ""
@@ -369,7 +367,7 @@  def realfn2virtual(realfn, cls, mc):
 
 def variant2virtual(realfn, variant):
     """
-    Convert a real filename + the associated subclass keyword to a virtual filename
+    Convert a real filename + a variant to a virtual filename
     """
     if variant == "":
         return realfn