diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py index 7c5ceef..ac3f1c4 100644 --- a/rust2rpm/__main__.py +++ b/rust2rpm/__main__.py @@ -584,7 +584,6 @@ def main(): else: with open(spec_file, "w") as fobj: fobj.write(spec_contents) - fobj.write("\n") print(f'Wrote {fobj.name}') for fname, diff in zip(patch_files, diffs): if fname: diff --git a/rust2rpm/generator.py b/rust2rpm/generator.py index 63b595f..ef3aded 100644 --- a/rust2rpm/generator.py +++ b/rust2rpm/generator.py @@ -109,6 +109,9 @@ def spec_file_render( metadata=metadata, patch_file_manual=patch_file_manual, patch_file_automatic=patch_file_automatic, - **kwargs) + '\n' + **kwargs) + + if not spec_contents.endswith("\n"): + spec_contents += "\n" return spec_contents