Commit f65f305
tools: ynl-gen: use temporary file for rendering
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 <jiri@nvidia.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 58f2ffd commit f65f305
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
2304 | 2306 | | |
2305 | 2307 | | |
2306 | 2308 | | |
2307 | | - | |
| 2309 | + | |
2308 | 2310 | | |
2309 | 2311 | | |
2310 | 2312 | | |
| |||
2329 | 2331 | | |
2330 | 2332 | | |
2331 | 2333 | | |
2332 | | - | |
| 2334 | + | |
2333 | 2335 | | |
2334 | 2336 | | |
2335 | 2337 | | |
| |||
2578 | 2580 | | |
2579 | 2581 | | |
2580 | 2582 | | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
2581 | 2587 | | |
2582 | 2588 | | |
2583 | 2589 | | |
0 commit comments