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

2020-09-04 Thread Zac Medico
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
Description: OpenPGP digital signature


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

2020-09-04 Thread Florian Schmaus
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()"?

- Florian



signature.asc
Description: OpenPGP digital signature