All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sstate.bbclass: adds warnings for the exceptions of os.utime in siginfo
@ 2021-10-03 21:38 Jose Quaresma
  2021-10-04 14:11 ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Jose Quaresma @ 2021-10-03 21:38 UTC (permalink / raw)
  To: openembedded-core; +Cc: Jose Quaresma

When we can't update the access and modified times of sstate siginfo
it is useful to infor the user about that.

Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
---
 meta/classes/sstate.bbclass | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 92a73114bb..2deecd8777 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -720,11 +720,15 @@ def sstate_package(ss, d):
         try:
             os.utime(siginfo, None)
         except PermissionError:
+            bb.warn("Cannot sets the access and modified times of sstate siginfo %s, no access rights" % siginfo)
             pass
         except OSError as e:
             # Handle read-only file systems gracefully
             import errno
-            if e.errno != errno.EROFS:
+            if e.errno == errno.EROFS:
+                bb.warn("Cannot sets the access and modified times of sstate siginfo %s, read-only file system" % siginfo)
+                pass
+            else:
                 raise e
 
     return
@@ -1165,11 +1169,15 @@ python sstate_eventhandler() {
             try:
                 os.utime(siginfo, None)
             except PermissionError:
+                bb.warn("Cannot sets the access and modified times of sstate siginfo %s, no access rights" % siginfo)
                 pass
             except OSError as e:
                 # Handle read-only file systems gracefully
                 import errno
-                if e.errno != errno.EROFS:
+                if e.errno == errno.EROFS:
+                    bb.warn("Cannot sets the access and modified times of sstate siginfo %s, read-only file system" % siginfo)
+                    pass
+                else:
                     raise e
 
 }
-- 
2.33.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-06  8:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-03 21:38 [PATCH] sstate.bbclass: adds warnings for the exceptions of os.utime in siginfo Jose Quaresma
2021-10-04 14:11 ` [OE-core] " Richard Purdie
2021-10-04 17:59   ` Jose Quaresma
2021-10-04 20:03     ` Richard Purdie
2021-10-06  8:10       ` Jose Quaresma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.