-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi everyone, While auditing the code related to bug 117988, I've noticed that it calls portageexit() directly because the normal atexit hooks do not work with the os.execv call when portage restarts itself. Currently, several other atexit hooks exist but never get called when portage restarts itself. Unfortunately, python's atexit module does not have a public interface for anything but the register() function (_exithandlers and _run_exitfuncs are accessible but undocumented). In the attached patch, I've copied the private code (GPL compatible) directly from /usr/lib/python2.4/atexit.py so that the functionality is duplicated in our portage_exec module. Then I've wrapped all relevant access to the atexit module in calls to the new portage_exec.atexit_register() function. The last hunk uses the new function portage_exec.run_exitfuncs() to manually call the registered functions prior to the os.execv call. Feedback would be appreciated. Zac -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFD5vaC/ejvha5XGaMRAmvFAJ90D3b5N6t8YiVjy4Qp0woo/tFm9wCeNwYH QDCajTK1JPea2fg+AT7WDEs= =8DuV -----END PGP SIGNATURE-----