On Fri, 2024-02-23 at 13:25 +0000, Eilís 'pidge' Ní Fhlannagáin wrote: > python useradd_sysroot_sstate () { > - scriptfile = None > - task = d.getVar("BB_CURRENTTASK") > - if task == "package_setscene": > - bb.build.exec_func("useradd_sysroot", d) > - elif task == "prepare_recipe_sysroot": > - # Used to update this recipe's own sysroot so the user/groups are > available to do_install > - > - # If do_populate_sysroot is triggered and we write the file here, > there would be an overlapping > - # files. See > usergrouptests.UserGroupTests.test_add_task_between_p_sysroot_and_package > - scriptfile = > d.expand("${RECIPE_SYSROOT}${bindir}/postinst-useradd-${PN}-recipedebug") > - > - bb.build.exec_func("useradd_sysroot", d) > - elif task == "populate_sysroot": > - # Used when installed in dependent task sysroots > - scriptfile = > d.expand("${SYSROOT_DESTDIR}${bindir}/postinst-useradd-${PN}") > - > - if scriptfile: > - bb.utils.mkdirhier(os.path.dirname(scriptfile)) > - with open(scriptfile, 'w') as script: > - script.write("#!/bin/sh -e\n") > - bb.data.emit_func("useradd_sysroot", script, d) > - script.write("useradd_sysroot\n") > - os.chmod(scriptfile, 0o755) > + for type, sort_prefix in [("group", "01"), ("user", "02"), ("groupmems", > "03")]: > + scriptfile = None > + task = d.getVar("BB_CURRENTTASK") > + if task == "package_setscene": > + bb.build.exec_func(f"{type}add_sysroot", d) > + elif task == "prepare_recipe_sysroot": > + # Used to update this recipe's own sysroot so the user/groups > are available to do_install > + scriptfile = d.expand("${RECIPE_SYSROOT}${bindir}/" > f"postinst-useradd-{sort_prefix}{type}" "-${PN}") > + bb.build.exec_func(f"{type}add_sysroot", d) > + elif task == "populate_sysroot": > + # Used when installed in dependent task sysroots > + scriptfile = d.expand("${SYSROOT_DESTDIR}${bindir}/" > f"postinst-useradd-{sort_prefix}{type}" "-${PN}") > + > + if scriptfile: > + bb.utils.mkdirhier(os.path.dirname(scriptfile)) > + with open(scriptfile, 'w') as script: > + script.write("#!/bin/sh\n") > + bb.data.emit_func(f"{type}add_sysroot", script, d) > + script.write(f"{type}add_sysroot\n") > + os.chmod(scriptfile, 0o755) > }
This change has all kinds of hidden issues and changes. The -e change isn't mentioned but probably a good idea. The addition of trailing whitespace is not great but harmless. This is on top of the previous issues the series had. What really upsets me though is that this reverted: https://git.yoctoproject.org/poky/commit/?id=4bb222e0d71a4cb159b8a4f1a90b65b1af32ac10 which thankfully we have a test for, which then failed: https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/6395/steps/14/logs/stdio This amounts to a lack of attention to detail and really frustrates me. I'll queue something in -next to fix this up as I do want to fix the ordering issue and we are now close with that but it will make me worry a lot about future patches. Richard
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#196127): https://lists.openembedded.org/g/openembedded-core/message/196127 Mute This Topic: https://lists.openembedded.org/mt/104527871/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-