From 22804aeab0cb6c2dde97b567b1a951457adeda18 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sep 17 2021 07:40:05 +0000 Subject: fedora: use rpmautospec by default rpmautspec has some shortcomings (e.g. lack of support for multi-line changelog entries), but those shortcomings are not very important for rust packages. Let's just use rpmautospec by default for convenience. --- diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py index 673ade7..c47b376 100644 --- a/rust2rpm/__main__.py +++ b/rust2rpm/__main__.py @@ -259,6 +259,9 @@ def to_list(s): return list(filter(None, (l.strip() for l in s.splitlines()))) def main(): + default_target = get_default_target() + default_rpmautospec = default_target in {"fedora"} + parser = argparse.ArgumentParser("rust2rpm", formatter_class=argparse.RawTextHelpFormatter) parser.add_argument("--show-license-map", action="store_true", @@ -270,13 +273,13 @@ def main(): parser.add_argument("-", "--stdout", action="store_true", help="Print spec and patches into stdout") parser.add_argument("-t", "--target", action="store", - choices=("plain", "fedora", "mageia", "opensuse"), default=get_default_target(), + choices=("plain", "fedora", "mageia", "opensuse"), default=default_target, help="Distribution target") parser.add_argument("-p", "--patch", action="store_true", help="Do initial patching of Cargo.toml") parser.add_argument("-s", "--store-crate", action="store_true", help="Store crate in current directory") - parser.add_argument("-a", "--rpmautospec", action="store_true", default=False, + parser.add_argument("-a", "--rpmautospec", action="store_true", default=default_rpmautospec, help="Use autorelease and autochangelog features") parser.add_argument("--all-features", action="store_true", help="Activate all available features")