Re: Re: [PATCH v4] env-update: create systemd env configuration if required

Zac Medico <[email protected]>
Newsgroups gmane.linux.gentoo.portage.devel
Message-ID <[email protected]>
On 9/4/20 8:39 AM, Florian Schmaus wrote:
> On 9/3/20 7:57 PM, Florian Schmaus wrote:
>> +	systemd_profile_env_path = os.path.join(systemd_environment_dir,
>> +					     "10-gentoo-profile-env.conf")
>> +	with open(systemd_profile_env_path, "w") as systemd_profile_env:
> 
> I just noticed that portage has atomic_ofstream(). Would you prefer this
> change to use atomic_ofstream() instead of using "with open()"?

Yes, please do. Also, we can eliminate the earlier os.path.isdir by
using os.makedirs(systemd_environment_dir, exist_ok=True).
-- 
Thanks,
Zac
signature.asc (application/pgp-signature, 981 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQKTBAEBCgB9FiEE8OgXaltWzqgSupCu0HX7jBBKPSAFAl9S5gFfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEYw
RTgxNzZBNUI1NkNFQTgxMkJBOTBBRUQwNzVGQjhDMTA0QTNEMjAACgkQ0HX7jBBK
PSAXVRAAt+hrm43PsQPDFEa54EzTg+hN7PDQm/GP7u2T58qdE7lUrVdRJ8ag786P
lj34GdP4PZNJlCPC2j13UOPBICM/srlMwfZSgOEPyGDLd+3Xb9iBDNMIfqO1P3aE
OywzU66YXfowJ/3TwIsZEt6/QV4+1aN2gQXck19VRIrdQqk3d1JlmF9RvvMhNYlZ
jEju9SEAI7Kq+gFt/+/q5ftS8rFdc7xOA9bn0qA0ey42DJDQ50C9Fe+pxMnSbBUK
A9ld7NteUDv8M0JNyz1YiLQODp6S8UB5nJX+q1Odlr9kUcAJgFEPagKjPQ+5Yar7
VuaxRnDzycvT1aR25g9f0j+TgpFGpPiChpguQU3EvMLZ2ts6MNr4ivUAxII+mEmo
9tem4FguaoiJo0WOFgKuBuLAbYF/jqiQA25sGOZLslFJA/ETlQajnWJqrgsIdS0R
rF0JHbscTfI0FY3HmKWVu7iXKCRp8ilF1inSKLzj0bbdN3SdMFLbqF9mNJecjhSf
8qu1vF9Q+XjUiwJMoH1y8/aXhi2LXKN8sowYLZU1KhtbbNtzPEaEoayiV2mAkRqF
RTrlVBRnMHqgT4aMYJuNh6X93ImzYR5YvxsQSbJPAYer7JAnLxu2WF5FCBSvxDQt
zbzFQd+68aw5xj69nrv2n7qF9hDYxVJKQt/LposPu/7vHDmMUi8=
=5wAu
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.