Skip to contentSkip to conversation

sstatesig: Add try/except around the stat calls

PATCH New Richard Purdie 1 participant 1 message Jun 18, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sstatesig: Add try/except around the stat calls

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.

meta/lib/oe/sstatesig.py +8 -2
index acff2a0..d58147f 100644
@@ -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