<div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 8, 2018 at 2:48 AM Urs Fässler &lt;<a href="mailto:urs.fassler@bbv.ch">urs.fassler@bbv.ch</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Provide more information in the case the sources are not found in the<br>
unpack step.<br>
<br>
Signed-off-by: Urs Fässler &lt;<a href="mailto:urs.fassler@bbv.ch" target="_blank">urs.fassler@bbv.ch</a>&gt;<br>
Signed-off-by: Pascal Bach &lt;<a href="mailto:pascal.bach@siemens.com" target="_blank">pascal.bach@siemens.com</a>&gt;<br>
---<br>
 lib/bb/fetch2/git.py  | 29 +++++++++++++++++++++--------<br>
 lib/bb/tests/fetch.py |  2 ++<br>
 2 files changed, 23 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py<br>
index 51259df9..15858a62 100644<br>
--- a/lib/bb/fetch2/git.py<br>
+++ b/lib/bb/fetch2/git.py<br>
@@ -476,14 +476,27 @@ class Git(FetchMethod):<br>
         if os.path.exists(destdir):<br>
             bb.utils.prunedir(destdir)<br>
<br>
-        clonedir_is_up_to_date = not self.clonedir_need_update(ud, d)<br>
-        if clonedir_is_up_to_date:<br>
-            runfetchcmd(&quot;%s clone %s %s/ %s&quot; % (ud.basecmd, ud.cloneflags, ud.clonedir, destdir), d)<br>
-        elif ud.shallow and os.path.exists(ud.fullshallow):<br>
-            bb.utils.mkdirhier(destdir)<br>
-            runfetchcmd(&quot;tar -xzf %s&quot; % ud.fullshallow, d, workdir=destdir)<br>
-        else:<br>
-            raise bb.fetch2.UnpackError(&quot;No up to date source found&quot;, ud.url)<br>
+        source_found = False<br>
+        source_error = []<br>
+<br>
+        if not source_found:<br>
+            clonedir_is_up_to_date = not self.clonedir_need_update(ud, d)<br>
+            if clonedir_is_up_to_date:<br>
+                runfetchcmd(&quot;%s clone %s %s/ %s&quot; % (ud.basecmd, ud.cloneflags, ud.clonedir, destdir), d)<br>
+                source_found = True<br>
+            else:<br>
+                source_error.append(&quot;clone directory not available or not up to date: &quot; + ud.clonedir)<br>
+<br>
+        if not source_found:<br>
+            if ud.shallow and os.path.exists(ud.fullshallow):<br>
+                bb.utils.mkdirhier(destdir)<br>
+                runfetchcmd(&quot;tar -xzf %s&quot; % ud.fullshallow, d, workdir=destdir)<br>
+                source_found = True<br>
+            else:<br>
+                source_error.append(&quot;shallow clone not enabled or not available: &quot; + ud.fullshallow)<br></blockquote><div><br></div><div>This logic is flawed. In the case where the source hasn’t been found and ud.shallow is false, as shallow is disabled, the else clause tries to access ud.fullshallow, which isn’t an existing attribute:</div><div><br></div><div>Exception: AttributeError: &#39;FetchData&#39; object has no attribute &#39;fullshallow&#39;</div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Christopher Larson<br>kergoth at gmail dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Senior Software Engineer, Mentor Graphics</div></div></div></div></div></div>