sync-rebuild: create backup file explicitly
commit518d24b5ba74e9ddf08f3801a2be82ca9861ef10
authorAlad Wenter <alad@archlinux.org>
Mon, 26 Jun 2023 12:17:24 +0000 (26 14:17 +0200)
committerAlad Wenter <alad@archlinux.org>
Mon, 26 Jun 2023 12:18:25 +0000 (26 14:18 +0200)
treecae02993ab75c0eea05c1c60fb8d48145f8d958e
parent0f62567e7329a96e0d7d7ad5ba4e04161b6d894e
sync-rebuild: create backup file explicitly

According to the `fileinput` documentation,

> If the backup parameter is given (typically as backup='.<some extension>'), it
> specifies the extension for the backup file, and the backup file remains
> around; by default, the extension is '.bak' and it is deleted when the output
> file is closed.

However, it seems that when `backup` is specified closing the output file still
deletes it. Create the backup file in the caller as a workaround.
examples/sync-rebuild