The commit dd555537fc35c5f934af09d601d70772eb5955ae
'sstate.bbclass: fix errors about read-only sstate mirrors'
adds an additional exception handler to silently mask read
only rootfs errors thrown during the touch.

The exception handler checks the error type with the python module errno
but this module needs to be imported as it don't exist.

Example of the error:

File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:sstate_task_postfunc(d)
     0003:
File: '/home/builder/src/base/poky/meta/classes/sstate.bbclass', lineno: 778, 
function: sstate_task_postfunc
     0774:
     0775:    omask = os.umask(0o002)
     0776:    if omask != 0o002:
     0777:       bb.note("Using umask 0o002 (not %0o) for sstate packaging" % 
omask)
 *** 0778:    sstate_package(shared_state, d)
     0779:    os.umask(omask)
     0780:
     0781:    sstateinst = d.getVar("SSTATE_INSTDIR")
     0782:    d.setVar('SSTATE_FIXMEDIR', shared_state['fixmedir'])
File: '/home/builder/src/base/poky/meta/classes/sstate.bbclass', lineno: 708, 
function: sstate_package
     0704:        except PermissionError:
     0705:            pass
     0706:        except OSError as e:
     0707:            # Handle read-only file systems gracefully
 *** 0708:            if e.errno != errno.EROFS:
     0709:                raise e
     0710:
     0711:    return
     0712:
Exception: NameError: name 'errno' is not defined

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

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 86a7464ae3..fb02ad2dd7 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -705,6 +705,7 @@ def sstate_package(ss, d):
             pass
         except OSError as e:
             # Handle read-only file systems gracefully
+            import errno
             if e.errno != errno.EROFS:
                 raise e
 
@@ -1154,6 +1155,7 @@ python sstate_eventhandler() {
                 pass
             except OSError as e:
                 # Handle read-only file systems gracefully
+                import errno
                 if e.errno != errno.EROFS:
                     raise e
 
-- 
2.32.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#154592): 
https://lists.openembedded.org/g/openembedded-core/message/154592
Mute This Topic: https://lists.openembedded.org/mt/84746142/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to