]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
fetch2: Avoid recursive errors
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 14 Jan 2017 14:17:13 +0000 (14:17 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 19 Jan 2017 15:26:09 +0000 (15:26 +0000)
If PATH contains WORKDIR which contains PV which contains SRCPV we can end
up in circular recursion within the fetcher. This code change allows for the recursion
to be broken by giving PV a temporary dummy value in a data store copy.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/fetch2/__init__.py

index d6d7850dfb1645c4a0d36b928693132e49543218..525f47e4173e9073dbf89783cf7faa4e07838b88 100644 (file)
@@ -819,6 +819,15 @@ def runfetchcmd(cmd, d, quiet=False, cleanup=None, log=None, workdir=None):
     if not cleanup:
         cleanup = []
 
+    # If PATH contains WORKDIR which contains PV which contains SRCPV we
+    # can end up in circular recursion here so give the option of breaking it
+    # in a data store copy.
+    try:
+        d.getVar("PV")
+    except bb.data_smart.ExpansionError:
+        d = bb.data.createCopy(d)
+        d.setVar("PV", "fetcheravoidrecurse")
+
     origenv = d.getVar("BB_ORIGENV", False)
     for var in exportvars:
         val = d.getVar(var) or (origenv and origenv.getVar(var))