]> code.ossystems Code Review - openembedded-core.git/commitdiff
sstatesig: Add try/except around the stat calls
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 18 Jun 2014 16:58:56 +0000 (17:58 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 19 Jun 2014 16:55:02 +0000 (17:55 +0100)
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>
meta/lib/oe/sstatesig.py

index acff2a05691cbeda20735e5644fa2df948ee3638..d58147f78f17ba0a4b0ae1bf653341c394704d96 100644 (file)
@@ -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