Subject: Re: [patch net-next] tools: ynl-gen: use temporary file for rendering

From: Jakub Kicinski <[email-masked]>
Date: Fri, 18 Aug 2023 14:38:13 -0700

On Fri, 18 Aug 2023 13:19:27 +0200 Jiri Pirko wrote:
> From: Jiri Pirko <[email-masked]>
> 
> Currently any error during render leads to output an empty file.
> That is quite annoying when using tools/net/ynl/ynl-regen.sh
> which git greps files with content of "YNL-GEN.." and therefore ignores
> empty files. So once you fail to regen, you have to checkout the file.
> 
> Avoid that by rendering to a temporary file first, only at the end
> copy the content to the actual destination.
> 
> Signed-off-by: Jiri Pirko <[email-masked]>

Neat! I thought this would be harder to implement.

Reviewed-by: Jakub Kicinski <[email-masked]>