diff --git a/0003-Fix-autodetection-of-rpmautospec.patch b/0003-Fix-autodetection-of-rpmautospec.patch new file mode 100644 index 0000000..c3c5bd0 --- /dev/null +++ b/0003-Fix-autodetection-of-rpmautospec.patch @@ -0,0 +1,31 @@ +From b9e95b4d61739f21c2f64ee3df497d93272a67af Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Mon, 28 Feb 2022 14:01:20 +0100 +Subject: [PATCH 2/3] Fix autodetection of rpmautospec + +When store_true or store_false are used, the default default changes +from None to a boolean. I didn't know about this, and I wrote the code +to assume args.rpmautospec would be None. rpmautospec detection was +effectively always disabled. +--- + rust2rpm/__main__.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py +index 0f575ad12f..13dc26a313 100644 +--- a/rust2rpm/__main__.py ++++ b/rust2rpm/__main__.py +@@ -360,8 +360,10 @@ def main(): + parser.add_argument("-s", "--store-crate", action="store_true", + help="Store crate in current directory") + parser.add_argument("-a", "--rpmautospec", action="store_true", ++ default=None, + help="Use autorelease and autochangelog features") + parser.add_argument("--no-rpmautospec", action="store_false", ++ default=None, + help="Do not use rpmautospec") + parser.add_argument("--relative-license-paths", action="store_true", + help="Put all license files in main license directory") +-- +2.35.1 + diff --git a/0004-Print-information-about-written-files.patch b/0004-Print-information-about-written-files.patch new file mode 100644 index 0000000..fd6ac2f --- /dev/null +++ b/0004-Print-information-about-written-files.patch @@ -0,0 +1,31 @@ +From 7d8c9a802866ef0a35ab4d67d8869f30c650827a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Mon, 28 Feb 2022 10:32:10 +0100 +Subject: [PATCH 3/3] Print information about written files + +We already output some messages, but not the most important part: what +files were written. +--- + rust2rpm/__main__.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py +index 13dc26a313..a011217443 100644 +--- a/rust2rpm/__main__.py ++++ b/rust2rpm/__main__.py +@@ -515,10 +515,11 @@ def main(): + with open(spec_file, "w") as fobj: + fobj.write(spec_contents) + fobj.write("\n") ++ print(f'Wrote {fobj.name}') + if patch_file is not None: + with open(patch_file, "w") as fobj: + fobj.writelines(diff) +- ++ print(f'Wrote {fobj.name}') + + if __name__ == "__main__": + main() +-- +2.35.1 + diff --git a/rust-packaging.spec b/rust-packaging.spec index 127c87a..41c0663 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -13,6 +13,8 @@ Source: https://pagure.io/fedora-rust/rust2rpm/archive/v%{version}/rust2 Patch: 0001-Add-comment-about-unused-macro.patch Patch: 0002-Allow-easy-overriding-of-the-opt-level-debuginfo-cod.patch +Patch: 0003-Fix-autodetection-of-rpmautospec.patch +Patch: 0004-Print-information-about-written-files.patch ExclusiveArch: %{rust_arches}