Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] sstatesig: Add try/except around the stat calls
Date: Wed, 18 Jun 2014 17:58:56 +0100	[thread overview]
Message-ID: <1403110736.2104.79.camel@ted> (raw)

Its possible sstate symlinks to other sstate mirrors which then my get
removed/cleaned. If we find invalid symlinks, skip over them rather
than error with a backtrace.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index acff2a0..d58147f 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -125,7 +125,10 @@ def find_siginfo(pn, taskname, taskhashlist, d):
                         foundall = True
                         break
         else:
-            filedates[fullpath] = os.stat(fullpath).st_mtime
+            try:
+                filedates[fullpath] = os.stat(fullpath).st_mtime
+            except OSError:
+                continue
 
     if not taskhashlist or (len(filedates) < 2 and not foundall):
         # That didn't work, look in sstate-cache
@@ -156,7 +159,10 @@ def find_siginfo(pn, taskname, taskhashlist, d):
                         if taskhashlist:
                             hashfiles[hashval] = fullpath
                         else:
-                            filedates[fullpath] = os.stat(fullpath).st_mtime
+                            try:
+                                filedates[fullpath] = os.stat(fullpath).st_mtime
+                            except:
+                                continue
 
     if taskhashlist:
         return hashfiles




                 reply	other threads:[~2014-06-18 16:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1403110736.2104.79.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox